Watershed#

class hydromodpy.watershed_root.Watershed(dem_path: str, out_path: str, load: bool = False, watershed_name: str = 'Default', from_lib: str = None, from_dem: list = None, from_shp: list = None, from_xyv: list = None, reg_fold: str = None, bottom_path: str = None, save_object: bool = True)[source]#

Bases: object

Class Watershed is used to extract watershed and its data from regional DEM. Hub to all elements necessary or optional to construct watersheds (meaning catchements) and run modflow simulations.

Parameters#

dem_pathstr

Path of the initial Digital Elevation Model (DEM).

out_pathstr

Path of the HydroModPy outputs to store results.

loadbool, optional

Load the existing watershed object. The default is False.

watershed_namestr, optional

Name of the watershed (name of folder results). The default is ‘Default’.

from_libstr, optional

Path of the library (.csv) with list of watershed to generate. The default is None.

from_demlist, optional

List with two parameters: [path, cell_size] path: Path of the DEM cell_size: Resolution of the DEM. To change the initial resolution. The default is empty list.

from_shplist, optional

List of tow parameters: [path, buffer_size] path: Path of the polygon shapefile. buffer_size: Buffer distance (value in percent) The default is empty list.

from_xyvlist, optional

List of four parameters: [x, y, snap_distance, buffer_size] x: X coordinate [m] of the watershed outlet y: Y coordinate [m] of the watershed outlet snap_dist: Maximum distance where the outlet can be moved. buffer_size: Buffer added to the generated watershed polygon (value in percent) The default is empty list.

reg_foldstr, None

Path of the folder with regional data/results. If informed, the regional results will not be created, just loaded from folder. The default is None.

bottom_pathstr, optional

Path of a raster representing the bottom elevation. Need to be the same shape of the model domain area (watershed DEM). The default is None.

save_objectbool, optional

True : To save the watershed object (using pickle). The default is True.

add_climatic()[source]#

Public method to add climatic data.

Returns#

None.

add_driasclimat(driasclimat_path, list_models='all', list_vars='all')[source]#

Public method to add drias climat data. Link: https://www.drias-climat.fr/

Returns#

None.

add_driaseau(driaseau_path, list_models='all', list_vars='all')[source]#

Public method to add drias eau data. Link: https://www.drias-eau.fr/

Returns#

None.

add_geology(geology_path: str, types_obs: str = 'GEO1M.shp', fields_obs: str = 'CODE_LEG')[source]#

Public method to add geology data.

Parameters#

geology_pathstr

Path where the polygon shapefile is located. To date, work for BRGM geological map data: http://infoterre.brgm.fr/page/telechargement-cartes-geologiques

types_obsstr, optional

Name of the geology shapefile. The default is ‘GEO1M.shp’.

fields_obsstr, optional

Field data of the polygons. The default is ‘CODE_LEG’.

add_hydraulic()[source]#

Public method to add hydraulic data.

Returns#

None.

add_hydrography(hydrography_path: str, types_obs: list = ['streams'], fields_obs: list = ['FID'], streams_file=None)[source]#

Public method to add hydrography data.

Parameters#

hydrography_pathstr

Path where the hydrography shapefiles are located.

types_obslist, optional

List of shapefile names. The default is [‘streams’].

fields_obslist, optional

List of field names. The default is [‘FID’].

add_hydrometry(hydrometry_path: str, file_name: str)[source]#

Public method to add watershed hydrometry.

Parameters#

hydrometry_pathstr

Path where the hydrometry files are located.

file_namestr

Name of the file.

add_intermittency(intermittency_path: str, file_name: str)[source]#

Public method to add hydraulic intermittency.

Parameters#

intermittency_pathstr

Path where the intermittency files are located.

file_namestr

Name of the file.

add_oceanic(oceanic_path: str)[source]#

Public method to add oceanic/sea data.

Parameters#

oceanic_pathstr

Path where the oceanic data are located.

add_piezometry()[source]#

Public method to add piezometric data.

Returns#

None.

add_safransurfex(safransurfex_path)[source]#

Pulic method to add safran-surfex (historical reanalysis) climate data.

Returns#

None.

add_settings()[source]#

Pulic method to add specific model settings.

Returns#

None.

add_subbasin(add_path: str = None, sub_snap_dist: int = 200)[source]#

Public method to add subbasins.

Parameters#

add_pathstr, optional

Path of the folder where the data are located. Default is None.

sub_snap_distint

Maximum distance where the subasin outlet can be moved.

add_transport()[source]#

Pulic method to add specific model transport parameters.

Returns#

None.

display_object(dtype: str = 'watershed_dem')[source]#

Public method to display watershed.

Parameters#

dtypestr, optional

Three possibilities:

  • 'watershed_dem' to display the watershed elevation (default).

  • 'watershed_geology' to display the watershed geology.

  • 'watershed_zones' to display the hydraulic zones of the watershed.

filtprocessing_modpath(model_modpath: object, norm_flux: bool = False, filt_time: bool = True, filt_seep: bool = True, filt_inout: bool = True, calc_rtd: bool = True, random_id: int = None)[source]#

Public method to filter output shapefiles of particles.

Parameters#

model_modpathobject

MODPATH model in a Python object.

norm_fluxbool, optional

Noramlization of time by input fluxes (recharge). The default is False.

filt_timebool, optional

Divide the output column “time” by 365 to converte days in years. Delete particles with time at 0. The default is True.

filt_seepbool, optional

Only if ‘track_dir’ is ‘forward’. Keep only particles ending in the first layer. The default is True.

filt_inoutbool, optional

Delete partciles in and out in the same cell. The default is True.

calc_rtdbool, optional

Compute and plot the PDF of residence times. The default is True.

random_idint, optional

Select randomly the number of prticles to keep. The default is None.

postprocessing_modflow(model_modflow: object, watertable_elevation: bool = True, watertable_depth: bool = True, seepage_areas: bool = True, outflow_drain: bool = True, groundwater_flux: bool = True, groundwater_storage: bool = True, accumulation_flux: bool = True, persistency_index: bool = False, intermittency_yearly: bool = False, intermittency_monthly: bool = False, intermittency_weekly: bool = False, intermittency_daily: bool = False, export_all_tif: bool = False)[source]#

Public method to post-process the simulation of the model.

Parameters#

model_modflowobject

MODFLOW model in a Python object.

watertable_elevationbool, optional

Build watertable elevation outputs. The default is True.

watertable_depthbool, optional

Build watertable_depth outputs. The default is True.

seepage_areasbool, optional

Build seepage area outputs. The default is True.

outflow_drainbool, optional

Build outflow drain outputs. The default is True.

groundwater_fluxbool, optional

Build groudwater flux outputs. The default is True.

groundwater_storagebool, optional

Build groundwater storage ouputs. The default is True.

accumulation_fluxbool, optional

Build accumulation flux outputs. The default is True.

persistency_indexbool, optional

Build persistency index outputs. The default is False.

intermittency_monthlybool, optional

Build intermittency monthly. The default is False.

intermittency_yearlybool, optional

Build intermittency daily. The default is False.

intermittency_dailybool, optional

Build intermittency yearly. The default is False.

export_all_tifbool, optional

Build tif files for all time steps. The default is False.

postprocessing_modpath(model_modpath: object, ending_point: bool = True, starting_point: bool = True, pathlines_shp: bool = True, particles_shp: bool = True, random_id: int = None, norm_flux: bool = False)[source]#

Public method to post-process the simulation of the particle tracking.

Parameters#

model_modpathobject

MODPATH model in a Python object.

ending_pointbool, optional

Save ending point shapefile of particles. The default is True.

starting_pointbool, optional

Save starting point shapefile of particles. The default is True.

pathlines_shpbool, optional

Save pathlines shapefile (one line per particles). The default is True.

particles_shpbool, optional

Save particles shapefile (some lines per particles). The default is True.

random_idint, optional

Number of particles to save randomly. The default is None.

postprocessing_mt3dms(model_mt3dms: object, concentration_seepage: bool = True, mass_seepage: bool = True, mass_accumulated: bool = False, export_all_tif: bool = False)[source]#

Public method to post-process the simulation of the particle tracking.

Parameters#

model_mt3dmsobject

MT3DMS model in a Python object.

postprocessing_netcdf(model_modflow: object, datetime_format: bool = True)[source]#

Public method to postprocess the watershed netCDF.

Parameters#

model_modflowobject

MODFLOW model in a Python object.

datetime_formatbool, optional

True if the index is in datetime format (e.g. 1995-10-17 00:00:00). The default is True.

Returns#

netcdf_results :

Python object with results stored.

postprocessing_timeseries(model_modflow: object, model_modpath: int = None, model_mt3dms: int = None, suffix_name: int = None, datetime_format: bool = True, subbasin_results: bool = True, intermittency_yearly: bool = False, intermittency_monthly: bool = False, intermittency_weekly: bool = False, intermittency_daily: bool = False, residence_times: bool = False, concentration_seepage: bool = False, mass_accumulated: bool = False)[source]#

Public method to postprocess the watershed timeseries.

Parameters#

model_modflowobject

MODFLOW model in a Python object.

model_modpathobject

MODPATH model in a Python object. Optional if only flow outputs are required.

model_mt3dmsobject, optional

MT3DMS model used when extracting concentration/mass indicators.

datetime_formatbool, optional

True if the index is in datetime format (e.g. 1995-10-17 00:00:00). The default is True.

subbasin_resultsbool, optional

Extract and clip results for each subbasins previously generated and stored. The default is True.

intermittency_yearlybool, optional

Compute yearly intermittency metrics for the hydrographic network.

intermittency_monthlybool

If True, the intermittent and perennial part of hydrographic network is calculated on a monthly basis.

intermittency_weeklybool

If True, the intermittent and perennial part of hydrographic network is calculated on a weekly basis.

intermittency_dailybool

If True, the intermittent and perennial part of hydrographic network is calculated on a daily basis.

residence_timesbool, optional

Export residence-time diagnostics if MODPATH results are available.

concentration_seepagebool, optional

When True the MT3DMS seepage concentrations are summarised.

mass_accumulatedbool, optional

Aggregate the accumulated mass time series from MT3DMS outputs.

Returns#

timeseries_resultshydromodpy.modeling.timeseries.Timeseries

Python object with results stored. The variable ‘mfdata’ inside correspond to the .csv file results.

preprocessing_modflow(for_calib: bool = False)[source]#

Public method to build the hydrogeological model.

Parameters#

for_calibbool, False

If False, the simulation results are store in folder results_simulations. If True, the simulation results are store in folder results_calibration.

Returns#

model_modflowobject

Python object of the created MODFLOW model.

preprocessing_modpath(model_modflow: object, for_calib: bool = False)[source]#

Public method to set the partickle tracking method.

Parameters#

model_modflowobject

MODFLOW model in a Python object.

for_calibbool, False

If False, the simulation results are store in folder results_simulations. If True, the simulation results are store in folder results_calibration.

Returns#

model_modpathobject

Python object of the created MODPATH model.

preprocessing_mt3dms(model_modflow: object, for_calib: bool = False, suffix_name: str = '_mt')[source]#

Public method to set the partickle tracking method.

Parameters#

model_modflowobject

MODFLOW model in a Python object.

for_calibbool, False

If False, the simulation results are store in folder results_simulations. If True, the simulation results are store in folder results_calibration.

Returns#

model_mt3dmsobject

Python object of the created MT3DMS model.

preprocessing_pyhelp(*, grid_csv, grid_base, workdir: str, ready_csvs, grid_patch, compress_level: int = 4)[source]#
processing_modflow(model_modflow: object, write_model: bool = True, run_model: bool = False, link_mt3dms: bool = False)[source]#

Public method to run the MODFLOW model.

Parameters#

model_modflowobject

MODFLOW model in a Python object.

write_modelbool, True

If True, write input files before run simulation.

run_modelbool, False

Run simulation. The default is False.

Returns#

success_modelbool

Boolean to know if the simulation rans succesfully.

processing_modpath(model_modpath: object, write_model: bool = True, run_model: bool = False)[source]#

Public method to run the partickle tracking.

Parameters#

model_modpathobject

MODPATH model in a Python object.

write_modelbool, True

If True, write input files before run simulation.

run_modelbool, False

Run simulation. The default is False.

Returns#

success_modelbool

Boolean to know if the simulation rans succesfully.

processing_mt3dms(model_mt3dms: object, write_model: bool = True, run_model: bool = False, verbose: bool = True)[source]#

Public method to run the partickle tracking.

Parameters#

model_mt3dmsobject

MT3DMS model in a Python object.

write_modelbool, True

If True, write input files before run simulation.

run_modelbool, False

Run simulation. The default is False.

Returns#

success_modelbool

Boolean to know if the simulation rans succesfully.

save_object()[source]#

Public method to save watershed object.

Returns#

None.