Skip to main content

eWaterCycle-DA

Documentation Status PyPI github license badge fair-software badge

Code to run Data Assimilation with hydrological models on the eWaterCycle platform.

Installation

Install this package alongside your eWaterCycle installation

pip install ewatercycle-DA

Then DA becomes available to be used in eWaterCycle

from ewatercycle_DA import DA

docs

Documentation can be found here

Changelog

Changelog can be found in CHANGELOG.md on GitHub.

Quick Usage overiew

(maybe migrate this to docs?)

Can be used with or without assimilating, this will run 10 versions of the same model. By varying the setup_kwargs you can vary the model run itself.

Without assimilating

HBVForcing = ...

ensemble = DA.Ensemble(N=10)
ensemble.setup()

ensemble.initialize(model_name="HBV",
                   forcing=HBVForcing,
                   setup_kwargs={'parameters':'7.6,0.5,460,3.8,0.19,1.3,0.082,0.0061',
                                 'initial_storage':'0,100,0,5'}
                    )

ref_model = ensemble.ensemble_list[0].model

lst_Q = []
while ref_model.time < ref_model.end_time:
    ensemble.update(assimilate=False)
    lst_Q.append(ensemble.get_value("Q"))

For running HBV see seperate docs

With assimilating

...
ref_model = ...
#... same as above just add two more definitions
def H(Z):
    """returns discharge which is the last value on the state vector for HBV"""
    return Z[-1] 

ds_obs_dir = ...
ensemble.initialize_da_method(ensemble_method_name = "PF", 
                              hyper_parameters = {
                                               'like_sigma_weights' : 0.05,
                                               'like_sigma_state_vector' : 0.01,
                                                 },
                              state_vector_variables = "all", 
                              # the next three are keyword arguments but are needed:
                              observation_path = ds_obs_dir,
                              observed_variable_name = "Q",
                              measurement_operator = H, 
                           
                            )
lst_Q = []
while ref_model.time < ref_model.end_time:
    ensemble.update(assimilate=True)
    lst_Q.append(ensemble.get_value("Q"))

Metadata

Release files for ewatercycle-DA 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ewatercycle-DA 0.0.7
File Size Uploaded
ewatercycle_da-0.0.7.tar.gz 20.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for ewatercycle-DA 0.0.7
File Interpreter ABI Platform
ewatercycle_da-0.0.7-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 20.2 MB

Release files / ewatercycle_da-0.0.7.tar.gz

Download URL ewatercycle_da-0.0.7.tar.gz
Size 20.1 MB
Tags Source
SHA-256 checksum
How to use checksums
0fb38116097d2a07b5aba847f17af6375171d06f4fd85cd608fca0e13cc27398
BLAKE2b-256 checksum
How to use checksums
98880237d508a3aef608550bc0fc13d46dd0f256eec329bf7117d5b242a43027
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / ewatercycle_da-0.0.7-py2.py3-none-any.whl

Download URL ewatercycle_da-0.0.7-py2.py3-none-any.whl
Size 24.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
f6344d431845cfa87cb3cdb169b8f961de3b67d0fff4d6f1b8ca8eae03d631f2
BLAKE2b-256 checksum
How to use checksums
3e6f11613a1fb6775ab1654febad286d34d6d8bceeb5b98209278cff6b1c2bf2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.0.7 This release

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page