7
7
from .format_tools import build_title
8
8
from .plotly_helpers import _rperiod_scatters
9
9
10
-
11
10
__all__ = [
12
- 'corrected_historical ' ,
11
+ 'corrected_retrospective ' ,
13
12
'corrected_scatterplots' ,
14
13
'corrected_day_average' ,
15
14
'corrected_month_average' ,
18
17
19
18
20
19
# BIAS CORRECTION PLOTS
21
- def corrected_historical (corrected : pd .DataFrame , simulated : pd .DataFrame , observed : pd .DataFrame ,
22
- rperiods : pd .DataFrame = None , plot_titles : list = None ,
23
- plot_type : str = 'plotly' ) -> go .Figure or str :
20
+ def corrected_retrospective (corrected : pd .DataFrame , simulated : pd .DataFrame , observed : pd .DataFrame ,
21
+ rperiods : pd .DataFrame = None , plot_titles : list = None ,
22
+ plot_type : str = 'plotly' ) -> go .Figure or str :
24
23
"""
25
24
Creates a plot of corrected discharge, observed discharge, and simulated discharge
26
25
@@ -31,7 +30,7 @@ def corrected_historical(corrected: pd.DataFrame, simulated: pd.DataFrame, obser
31
30
rperiods: the csv response from return_periods
32
31
plot_type: either 'plotly', or 'plotly_html' (default plotly)
33
32
plot_titles: (dict) Extra info to show on the title of the plot. For example:
34
- {'Reach ID': 1234567, 'Drainage Area': '1000km^2'}
33
+ {'River ID': 1234567, 'Drainage Area': '1000km^2'}
35
34
36
35
Returns:
37
36
plotly.GraphObject: plotly object, especially for use with python notebooks and the .show() method
@@ -113,7 +112,7 @@ def corrected_scatterplots(corrected: pd.DataFrame, simulated: pd.DataFrame, obs
113
112
merged_sim_obs: (optional) if you have already computed it, hydrostats.data.merge_data(simulated, observed)
114
113
merged_cor_obs: (optional) if you have already computed it, hydrostats.data.merge_data(corrected, observed)
115
114
plot_titles: (dict) Extra info to show on the title of the plot. For example:
116
- {'Reach ID': 1234567, 'Drainage Area': '1000km^2'}
115
+ {'River ID': 1234567, 'Drainage Area': '1000km^2'}
117
116
118
117
Returns:
119
118
plotly.GraphObject: plotly object, especially for use with python notebooks and the .show() method
@@ -201,7 +200,7 @@ def corrected_month_average(corrected: pd.DataFrame, simulated: pd.DataFrame, ob
201
200
merged_sim_obs : pd .DataFrame = False , merged_cor_obs : pd .DataFrame = False ,
202
201
plot_titles : list = None , ) -> go .Figure or str :
203
202
"""
204
- Calculates and plots the monthly average streamflow. This function uses
203
+ Calculates and _plots the monthly average streamflow. This function uses
205
204
hydrostats.data.merge_data on the 3 inputs. If you have already computed these because you are doing a full
206
205
comparison of bias correction, you can provide them to save time
207
206
@@ -212,7 +211,7 @@ def corrected_month_average(corrected: pd.DataFrame, simulated: pd.DataFrame, ob
212
211
merged_sim_obs: (optional) if you have already computed it, hydrostats.data.merge_data(simulated, observed)
213
212
merged_cor_obs: (optional) if you have already computed it, hydrostats.data.merge_data(corrected, observed)
214
213
plot_titles: (dict) Extra info to show on the title of the plot. For example:
215
- {'Reach ID': 1234567, 'Drainage Area': '1000km^2'}
214
+ {'River ID': 1234567, 'Drainage Area': '1000km^2'}
216
215
217
216
Returns:
218
217
plotly.GraphObject: plotly object, especially for use with python notebooks and the .show() method
@@ -243,9 +242,9 @@ def corrected_month_average(corrected: pd.DataFrame, simulated: pd.DataFrame, ob
243
242
244
243
def corrected_day_average (corrected : pd .DataFrame , simulated : pd .DataFrame , observed : pd .DataFrame ,
245
244
merged_sim_obs : pd .DataFrame = False , merged_cor_obs : pd .DataFrame = False ,
246
- titles : dict = None , ) -> go .Figure or str :
245
+ plot_titles : dict = None , ) -> go .Figure or str :
247
246
"""
248
- Calculates and plots the daily average streamflow. This function uses
247
+ Calculates and _plots the daily average streamflow. This function uses
249
248
hydrostats.data.merge_data on the 3 inputs. If you have already computed these because you are doing a full
250
249
comparison of bias correction, you can provide them to save time
251
250
@@ -255,8 +254,8 @@ def corrected_day_average(corrected: pd.DataFrame, simulated: pd.DataFrame, obse
255
254
merged_sim_obs: (optional) if you have already computed it, hydrostats.data.merge_data(simulated, observed)
256
255
merged_cor_obs: (optional) if you have already computed it, hydrostats.data.merge_data(corrected, observed)
257
256
observed: the dataframe of observed data. Must have a datetime index and a single column of flow values
258
- titles : (dict) Extra info to show on the title of the plot. For example:
259
- {'Reach ID': 1234567, 'Drainage Area': '1000km^2'}
257
+ plot_titles : (dict) Extra info to show on the title of the plot. For example:
258
+ {'River ID': 1234567, 'Drainage Area': '1000km^2'}
260
259
261
260
Returns:
262
261
plotly.GraphObject: plotly object, especially for use with python notebooks and the .show() method
@@ -278,7 +277,7 @@ def corrected_day_average(corrected: pd.DataFrame, simulated: pd.DataFrame, obse
278
277
]
279
278
280
279
layout = go .Layout (
281
- title = build_title ('Daily Average Streamflow Comparison' , titles ),
280
+ title = build_title ('Daily Average Streamflow Comparison' , plot_titles ),
282
281
xaxis = dict (title = 'Days' ), yaxis = dict (title = 'Discharge (m<sup>3</sup>/s)' , autorange = True ),
283
282
showlegend = True )
284
283
@@ -289,7 +288,7 @@ def corrected_volume_compare(corrected: pd.DataFrame, simulated: pd.DataFrame, o
289
288
merged_sim_obs : pd .DataFrame = False , merged_cor_obs : pd .DataFrame = False ,
290
289
plot_titles : dict = None , ) -> go .Figure or str :
291
290
"""
292
- Calculates and plots the cumulative volume output on each of the 3 datasets provided. This function uses
291
+ Calculates and _plots the cumulative volume output on each of the 3 datasets provided. This function uses
293
292
hydrostats.data.merge_data on the 3 inputs. If you have already computed these because you are doing a full
294
293
comparison of bias correction, you can provide them to save time
295
294
@@ -300,7 +299,7 @@ def corrected_volume_compare(corrected: pd.DataFrame, simulated: pd.DataFrame, o
300
299
merged_sim_obs: (optional) if you have already computed it, hydrostats.data.merge_data(simulated, observed)
301
300
merged_cor_obs: (optional) if you have already computed it, hydrostats.data.merge_data(corrected, observed)
302
301
plot_titles: (dict) Extra info to show on the title of the plot. For example:
303
- {'Reach ID': 1234567, 'Drainage Area': '1000km^2'}
302
+ {'River ID': 1234567, 'Drainage Area': '1000km^2'}
304
303
305
304
Returns:
306
305
plotly.GraphObject: plotly object, especially for use with python notebooks and the .show() method
0 commit comments