Repository navigation
Stochastic Generation
Package: pyhydra.climate.stochastic_generation
This package separates the Python API from the optional stochastic libraries it
uses. NEOPRENE is the library used for NSRP/STNSRP precipitation models.
CoSMoS_py is used for CoSMoS-based time-series and spatial-field generation.
Main APIs from point.py:
NSRPModelanalyze_tsreport_tssimulate_tsgenerate_tsfit_distributionfit_acs
NSRPModel wraps NEOPRENE workflows for point rainfall generation. The general
time-series helpers use CoSMoS-style statistical fitting and simulation when the
dependency is available.
Main API from spatial.py:
STNSRPModel
STNSRPModel wraps NEOPRENE STNSRP workflows for spatially distributed
precipitation generation.
Main APIs from fields.py:
SpatialFieldModelfit_spatial_modelgenerate_random_fieldgenerate_random_field_fastcheck_random_field
These functions support CoSMoS-based spatial random-field fitting and simulation.
The optional dependencies are intentionally loaded lazily. If a workflow needs
NEOPRENE or CoSMoS_py and the package is missing, pyhydra raises an import
error at the point of use.
This distinction matters in publications and documentation:
- NSRP and STNSRP are stochastic rainfall model families implemented through NEOPRENE.
- CoSMoS is used through CoSMoS_py.
-
pyhydraprovides wrappers, configuration helpers and workflow integration, not a reimplementation of those external libraries.
- Fix random seeds in experiments where reproducibility matters.
- Store generated model parameters and YAML configuration files.
- Archive input time series and calibration periods.
- Report which optional library and version were used.
- Validate simulated moments, autocorrelation and extremes against observations.