Spaces:
Build error
Build error
ovelay
Browse files- funcs/plot_func.py +11 -3
funcs/plot_func.py
CHANGED
@@ -67,9 +67,17 @@ def plot_sensor_data_from_json(json_file, sensor, slice_select=1):
|
|
67 |
return fig, fig1, fig2, file, fig3
|
68 |
|
69 |
def plot_overlay_data_from_json(json_file, slice_select, sensors=['GZ1', 'GZ2', 'GZ3', 'GZ4']):
|
70 |
-
|
71 |
-
|
72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
|
74 |
# Create subplots for each sensor
|
75 |
fig, axs = plt.subplots(len(sensors), 1, figsize=(12, 2 * len(sensors)), sharex=True)
|
|
|
67 |
return fig, fig1, fig2, file, fig3
|
68 |
|
69 |
def plot_overlay_data_from_json(json_file, slice_select, sensors=['GZ1', 'GZ2', 'GZ3', 'GZ4']):
|
70 |
+
|
71 |
+
try:
|
72 |
+
with open(json_file, "r") as f:
|
73 |
+
slices = json.load(f)
|
74 |
+
except:
|
75 |
+
with open(json_file.name, "r") as f:
|
76 |
+
slices = json.load(f)
|
77 |
+
|
78 |
+
# # Read the JSON file
|
79 |
+
# with open(json_file, "r") as f:
|
80 |
+
# slices = json.load(f)
|
81 |
|
82 |
# Create subplots for each sensor
|
83 |
fig, axs = plt.subplots(len(sensors), 1, figsize=(12, 2 * len(sensors)), sharex=True)
|