Climatic#
- class hydromodpy.watershed.climatic.Climatic(out_path: str = None)[source]#
Bases:
objectClass to initialize the climate forcing data (recharge, runoff).
Parameters#
- out_pathstr
Path of the HydroModPy outputs.
- set_steady_recharge()[source]#
Calculate the mean of recharge time series for steady-state simulation.
- update_first_clim(first_clim)[source]#
Define the first value of the recharge list values.
Parameters#
- first_clim
Choice between a float, the mean or the first value in the list of values.
- update_recharge(values, sim_state)[source]#
Function to update recharge based on its own values.
Parameters#
- values
Recharge values, float or list of float.
- sim_statestr
Select the simulation type, steady-state or transient.
- update_recharge_explore1(path_file, clim_mod, clim_sce, first_year, last_year, time_step, sim_state=None)[source]#
Update the recharge from a hydrometeorological hydroclimatic projection EXPLORE1 at the France scale. Greenhouse effect scenarios: RCP2.6, RCP4.5, RCP6.0, RCP8.5.
Parameters#
- path_filestr
Path of the specific file .csv, generated by a specific climatics model.
- clim_modstr
Label of the climatic model (e.g. ‘REA’).
- clim_scestr
Label of the scenario forecast model (e.g. ‘historic’).
- first_yearint
First year of selected period.
- last_yearint
Last year of selected period.
- time_stepstr
Frequency of the period (‘D’,’W’,’M’,’Y’)
- sim_stateTYPE, optional
Select the simulation type, steady-state or transient.
- update_recharge_explore2(path_file, gcm_mod, rcm_mod, sce_mod, first_year, last_year, sim_state=None)[source]#
Update the recharge from a hydrometeorological hydroclimatic projection EXPLORE2 at the France scale. Greenhouse effect scenarios: RCP2.6, RCP4.5, RCP6.0, RCP8.5.
Parameters#
- path_filestr
Path of the specific file .csv, generated by a specific climatics model.
- gcm__modstr
Label of the global climatic model (e.g. ‘CNR’).
- rcm_modstr
Label of the regional climatic model (e.g. ‘ALA’).
- clim_modstr
Label of the scenario forecast model (e.g. ‘historic’).
- first_yearint
First year of selected period.
- last_yearint
Last year of selected period.
- sim_stateTYPE, optional
Select the simulation type, steady-state or transient.
- update_recharge_reanalysis(path_file, clim_mod, clim_sce, first_year, last_year, time_step, sim_state=None)[source]#
Update the recharge from a hydrometeorological reanalysis at the France scale. From an inital REA.h5 file, and after using safransurfex.py class
Parameters#
- path_filestr
Path of the specific file .csv, generated by a specific climatics model.
- clim_modstr
Label of the climatic model (e.g. ‘REA’).
- clim_scestr
Label of the scenario forecast model (e.g. ‘historic’).
- first_yearint
First year of selected period.
- last_yearint
Last year of selected period.
- time_stepstr
Frequency of the period (‘D’,’W’,’M’,’Y’)
- sim_stateTYPE, optional
Select the simulation type, steady-state or transient.
- update_recharge_sinusoid(serie, period, amplitude, offset, omega, phase)[source]#
Create synthetic recharge values from sinusoidal function.
Parameters#
- serie
Pandas series of the initial recharge values.
- periodstr
Inform the time step requested (‘D’,’M’).
- amplitudefloat
Control the mxaimal value of the sinusoidal function.
- offsetfloat
Control the vertical shift of the sinusoidal function.
- omegafloat
Control the number of cycles of the sinusoidal function.
- phaseTYPE
Control the horizontal shift of the sinusoidal function.
- update_recharge_synthetic(rech, shape, years, start_date='2020-08', time_step=None, dis='normal')[source]#
Create synthetic recharge values from mathematical function.
Parameters#
- rechfloat
Total annual recharge requested by the user.
- shapefloat
Value to build the mathematical function.
- yearsfloat
Number of years to generate.
- start_datestr
Year and month for the beginning. The default is “2020-08”.
- freqstr
Inform the time step requested (‘D’,’M’,’Y’). The default is None.
- disstr
Distribution of the mathematical function. The default is ‘normal’.
- update_runoff(values, sim_state)[source]#
Function to update runoff based on its own values.
Parameters#
- values
Runoff values, float or list of float.
- sim_statestr
Select the simulation type, steady-state or transient.
- update_runoff_explore1(path_file, clim_mod, clim_sce, first_year, last_year, time_step, sim_state=None)[source]#
Update the runoff from a hydrometeorological hydroclimatic projection EXPLORE1 at the France scale. Greenhouse effect scenarios: RCP2.6, RCP4.5, RCP6.0, RCP8.5.
Parameters#
- path_filestr
Path of the specific file .csv, generated by a specific climatics model.
- clim_modstr
Label of the climatic model (e.g. ‘IPS1’).
- clim_scestr
Label of the scenario forecast model (e.g. ‘RPC8.5’).
- first_yearint
First year of selected period.
- last_yearint
Last year of selected period.
- time_stepstr
Frequency of the period (‘D’,’W’,’M’,’Y’)
- sim_stateTYPE, optional
Select the simulation type, steady-state or transient.
- update_runoff_explore2(path_file, gcm_mod, rcm_mod, sce_mod, first_year, last_year, sim_state=None)[source]#
Update the runoff from a hydrometeorological hydroclimatic projection EXPLORE2 at the France scale. Greenhouse effect scenarios: RCP2.6, RCP4.5, RCP6.0, RCP8.5.
Parameters#
- path_filestr
Path of the specific file .csv, generated by a specific climatics model.
- gcm__modstr
Label of the global climatic model (e.g. ‘CNR’).
- rcm_modstr
Label of the regional climatic model (e.g. ‘ALA’).
- clim_modstr
Label of the scenario forecast model (e.g. ‘historic’).
- first_yearint
First year of selected period.
- last_yearint
Last year of selected period.
- sim_stateTYPE, optional
Select the simulation type, steady-state or transient.
- update_runoff_reanalysis(path_file, clim_mod, clim_sce, first_year, last_year, time_step, sim_state=None)[source]#
Update the runoff from a hydrometeorological reanalysis at the France scale. From an inital REA.h5 file, and after using safransurfex.py class
Parameters#
- path_filestr
Path of the specific file .csv, generated by a specific climatics model.
- clim_modstr
Label of the climatic model (e.g. ‘REA’).
- clim_scestr
Label of the scenario forecast model (e.g. ‘historic’).
- first_yearint
First year of selected period.
- last_yearint
Last year of selected period.
- sim_stateTYPE, optional
Select the simulation type, steady-state or transient.
- update_sim2_reanalysis(*, var_list, nc_data_path, first_year, last_year=None, time_step='D', sim_state='transient', spatial_mean=False, geographic, disk_clip=None)[source]#
Download SIM2 reanalysis datasets and attach them to the climatic object.
Parameters#
- var_liststr or list[str]
Variables to download (
['recharge', 'runoff', ...]). Accepts a single string which is converted to a list internally.- nc_data_pathstr
Folder where the NetCDF files are cached (created if missing).
- first_yearint
First year included in the extraction window.
- last_yearint, optional
Last year to download (defaults to
first_yearif omitted).- time_step{‘D’, ‘M’}, optional
Temporal resolution requested when querying SIM2 (daily by default).
- sim_state{‘transient’, ‘steady’}, optional
Simulation flavour; used when setting HydroModPy inputs.
- spatial_meanbool, optional
Average each variable over the watershed mask before storing it.
- geographichydromodpy.watershed.geographic.Geographic
Geographic descriptor providing CRS, bounds, and watershed mask.
- disk_clipstr, optional
Either
'watershed'or a shapefile path controlling how cached NetCDF cubes are spatially clipped to save disk space.
Returns#
None