pycequeau.simulations.parameters package¶
- class pycequeau.simulations.parameters.BasinParameterBase(basin_structure: Basin)[source]¶
Bases:
SimulationParameterBaseShared helper layer for parameter sections that depend on basin data.
This class groups the basin-derived calculations shared by simulation parameter sections:
conversion of the watershed centroid latitude into the CEQUEAU
xlacode,determination of the maximum-insolation day from the meteorological file,
empirical time-of-concentration estimators used to populate the transfer block.
- compute_tc() tuple[float, dict[str, float]][source]¶
Compute the basin time of concentration and return the contributing methods.
The exported transfer block stores both the average time of concentration and the individual empirical estimates used to derive it.
- compute_xla() int[source]¶
Compute the CEQUEAU
xlacode from the basin centroid latitude.CEQUEAU expects latitude in the compact integer form
XXxxinstead of a decimal degree valueXX.xx. For example,46.73becomes4673.
- day_max_insolation(meteo_file_name: str) int[source]¶
Compute the CEQUEAU insolation day index from the meteorological forcing.
The CEQUEAU option structure uses
joneiandjoevato represent the reference day of maximum insolation. This value is estimated from the day of year with the highest multi-annual meantMax.
- static normalize_numeric_for_mex(obj)[source]¶
Recursively convert numeric values to float64-compatible structures.
- static tc_giandotti(basin_area: float, main_channel_length: float, height_differences: float) float[source]¶
This method uses the Giandotti (1934) formulation to compute the time of concentration:
\[T_{c} = \frac{4\sqrt{A} + 1.5L}{0.8\sqrt{H}}\]where:
\(A\) is the area of the basin in \(\text{km}^{2}\)
\(L\) is the length of the main channel in \(\text{km}\)
\(H\) is the difference between the mean basin elevation and the outlet elevation
\(T_{c}\) is the time of concentration in hours
This formula was calibrated on 12 basins with drainage areas between 170 and 70 000 \(\text{km}^{2}\).
The returned value is converted to days.
- static tc_kirpich(main_channel_length: float, height_differences: float) float[source]¶
This method uses the Kirpich (1940) formulation to compute the time of concentration:
\[T_{c} = 0.0078 L^{0.77}S^{-0.385}\]where \(L\) is the length of the main channel in \(ft\) and \(S\) is the mean basin slope in \(\text{m m}^{-1}\) computed as:
\[S = \frac{H_{max} - H_{min}}{L}\]\(T_{c}\) is obtained in minutes and then converted to days.
- static tc_pw(main_channel_length: float, height_differences: float) float[source]¶
This method uses the Department of Public Works (1995) formulation to compute the time of concentration:
\[T_{c} = 60 \left ( 11.9 \frac{L^{3}}{H} \right )^{0.385}\]where:
\(L\) is the length of the main channel in \(mi\)
\(H\) is the maximum elevation difference in \(ft\)
\(T_{c}\) is the time of concentration in \(min\)
The returned value is converted to days.
- class pycequeau.simulations.parameters.EvapotranspirationParameters(basin_structure)[source]¶
Bases:
BasinParameterBaseEvapotranspiration parameter structure for supported models.
The selected model controls which keys are exported in the
evapoblock.- apply_option_defaults(option: dict | None) None[source]¶
Propagate option-dependent values into the evapotranspiration blocks.
- class pycequeau.simulations.parameters.HydrologicalParameters(basin_structure)[source]¶
Bases:
BasinParameterBaseContainer for the hydrological part of the CEQUEAU parameter structure.
This section groups the option, soil, initial-state, transfer, snowmelt, and evapotranspiration blocks that are required by the hydrological model.
- property evapo: dict | None¶
- property fonte: dict | None¶
- classmethod from_values(basin_structure, flow_parameters: ndarray, initial_conditions: ndarray, transfer_parameters: ndarray, simulation_options: ndarray, snow_parameters: ndarray, evapotranspiration_parameters: ndarray, meteo_file_name: str) HydrologicalParameters[source]¶
Build the hydrological parameter group from the raw CEQUEAU input vectors.
This constructor hides the ordering dependencies of the setter-based API by computing the insolation day and propagating dependent values internally before returning the fully initialized section.
- set_initial_soil_conditions(values: ndarray) None[source]¶
Populate the initial storage conditions in
solInitial.
- set_option(values: ndarray, jonei: int | None) None[source]¶
Populate the simulation option block.
The
joneiandjoevaentries are computed from the basin meteorological forcing throughday_max_insolation().
- set_soil(values: ndarray) None[source]¶
Populate the
solblock.The exported
xlavalue is derived from the watershed centroid because CEQUEAU stores latitude as an integer code rather than decimal degrees.
- class pycequeau.simulations.parameters.PycequeauParams(bassinVersant: Basin, hydrology: HydrologicalParameters | None = None, water_quality: WaterQualityParameters | None = None, *, ctp: float = 0.0, lac: float = 0.0, surface: float = 0.0)[source]¶
Bases:
BasinParameterBaseTop-level CEQUEAU parameter facade.
This class assembles pre-built hydrology and water-quality sections into the final CEQUEAU parameter dictionary and handles export to JSON/MAT formats.
- class pycequeau.simulations.parameters.SimulationParameterBase(basin_structure: Basin)[source]¶
Bases:
ABCShared base class for simulation-parameter sections.
Each parameter family is responsible for exporting its own CEQUEAU-compatible dictionary fragment through
to_dict().
- class pycequeau.simulations.parameters.SnowmeltParameters(basin_structure)[source]¶
Bases:
BasinParameterBaseSnowmelt parameter structure for the supported hydrological models.
The CEQUEAU parameter file stores several snowmelt model blocks in the
fontesection. This class keeps the snow-specific defaults and model-dependent parameters in one place.- apply_option_defaults(option: dict | None, sol_initial: dict | None) None[source]¶
Inject option- and state-dependent values into the CEQUEAU snow block.
- set_parameters(values: ndarray) None[source]¶
Populate the snowmelt parameter dictionaries.
- Parameters:
values –
Ordered parameter vector used to populate the snowmelt structures. The first seven values correspond to the degree-day CEQUEAU model:
strne_s, tfc_s, tfd_s, tsc_s, tsd_s, ttd, tts_s.CEQUEAU (The exported structure contains the)
UEB
blocks (and CemaNeige)
options. (regardless of the active model selected in the simulation)
- class pycequeau.simulations.parameters.WaterQualityParameters(basin_structure)[source]¶
Bases:
BasinParameterBaseTop-level water-quality parameter group.
Water temperature is currently the only implemented quality module, but it is kept as a child structure so future quality components can be added cleanly.
- property dli: dict¶
- classmethod from_values(basin_structure, temperature_parameters: ndarray, temperature_model: int = 1) WaterQualityParameters[source]¶
Build the water-quality parameter group from raw model values.
- property qualite: dict | None¶
- class pycequeau.simulations.parameters.WaterTemperatureParameters(basin_structure)[source]¶
Bases:
BasinParameterBaseWater-temperature-specific parameters under the water-quality family.
At the moment the water-quality branch only contains the CEQUEAU water temperature model, but the container is intentionally scoped so additional quality modules can be added later without reshaping the top-level API.
- classmethod from_values(basin_structure, values: ndarray, model: int = 1) WaterTemperatureParameters[source]¶
Build a water-temperature parameter section from a raw value vector.
Submodules¶
- pycequeau.simulations.parameters.base module
- pycequeau.simulations.parameters.hydrology module
EvapotranspirationModelEvapotranspirationParametersHydrologicalParametersHydrologicalParameters.evapoHydrologicalParameters.fonteHydrologicalParameters.from_values()HydrologicalParameters.set_evapotranspiration()HydrologicalParameters.set_initial_soil_conditions()HydrologicalParameters.set_option()HydrologicalParameters.set_snowmelt()HydrologicalParameters.set_soil()HydrologicalParameters.set_transfer()HydrologicalParameters.to_dict()
SnowmeltModelSnowmeltParameters
- pycequeau.simulations.parameters.parameters module
- pycequeau.simulations.parameters.water_quality module