Skip to content

Commit b5a53c0

Browse files
author
Alan Snow
committed
2 parents 68ed4cc + 62a3272 commit b5a53c0

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

tethysapp/streamflow_prediction_tool/controllers_ajax.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,9 @@ def get_ecmwf_hydrograph_plot(request):
494494

495495
try:
496496
return_shapes, return_annotations = \
497-
get_return_period_ploty_info(request, datetime_start, datetime_end)
497+
get_return_period_ploty_info(
498+
request, datetime_start, datetime_end,
499+
forecast_statistics['max'].max())
498500
except NotFoundError:
499501
return_annotations = []
500502
return_shapes = []

tethysapp/streamflow_prediction_tool/controllers_functions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ def get_return_period_dict(request):
173173
return return_period_data
174174

175175

176-
def get_return_period_ploty_info(request, datetime_start, datetime_end):
176+
def get_return_period_ploty_info(request, datetime_start, datetime_end,
177+
band_alt_max=-9999):
177178
"""
178179
Get shapes and annotations for plotly plot
179180
"""
@@ -183,7 +184,6 @@ def get_return_period_ploty_info(request, datetime_start, datetime_end):
183184
return_20 = float(return_period_data["twenty"])
184185
return_10 = float(return_period_data["ten"])
185186
return_2 = float(return_period_data["two"])
186-
187187
# plotly info section
188188
shapes = [
189189
# return 20 band
@@ -194,7 +194,7 @@ def get_return_period_ploty_info(request, datetime_start, datetime_end):
194194
x0=datetime_start,
195195
y0=return_20,
196196
x1=datetime_end,
197-
y1=return_max,
197+
y1=max(return_max, band_alt_max),
198198
line=dict(width=0),
199199
fillcolor='rgba(128, 0, 128, 0.3)',
200200
),

0 commit comments

Comments
 (0)