Skip to content

Commit

Permalink
Thermocline layer number
Browse files Browse the repository at this point in the history
  • Loading branch information
thdfw committed Dec 15, 2024
1 parent d2e69c8 commit c5663e1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions visualizer_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1254,6 +1254,11 @@ async def get_plots(request: DataRequest, apirequest: Request):
if not cluster_top:
cluster_top = cluster_bottom.copy()
cluster_bottom = []
if cluster_bottom:
if max(cluster_bottom) > max(cluster_top):
cluster_top_copy = cluster_top.copy()
cluster_top = cluster_bottom.copy()
cluster_bottom = cluster_top_copy
if not cluster_bottom:
fig.add_trace(
go.Scatter(
Expand All @@ -1269,7 +1274,7 @@ async def get_plots(request: DataRequest, apirequest: Request):
x=[csv_times_dt[hour]],
y=[cluster_top[0]],
mode='markers', opacity=0.7,
name='thermocline',
name=f'thermocline-layer{len(cluster_top)}',
line=dict(color='green', dash='solid'),
showlegend=False),
)
Expand All @@ -1286,7 +1291,7 @@ async def get_plots(request: DataRequest, apirequest: Request):
go.Scatter(x=[csv_times_dt[hour]],
y=[max(cluster_top[0], cluster_bottom[0])],
mode='markers', opacity=0.7,
name='thermocline',
name=f'thermocline-layer{len(cluster_top)}',
line=dict(color='green', dash='solid'),
showlegend=False),
)
Expand Down

0 comments on commit c5663e1

Please sign in to comment.