Skip to main content

Conceptual snow density model for transferring snow water equivalent to snow depth.

Project description

Documentation Gitlab pipeline status (self-hosted) PyPI-Server PyPI - Python Version

swe2hs

SWE2HS is a conceptual snow density model for transferring daily snow water equivalent (SWE) of the snow cover to snow depth (HS). Some people informally call it JOPACK, which is an acronym for Just density Of the snowPACK.

The density model calculates snow depth at a daily resolution and is driven by the daily snow water equivalent of the snow cover only. The model creates a new layer with a fixed new snow density \(\rho_{new}\) for every increase in SWE such that, over time, a snowpack of individual layers builds up. The density of a layer increases with an exponential decay function towards a time-varying maximum density. The maximum density starts with an initial value at creation time of the layer and subsequently increases towards a higher value based on the overburden a layer has experienced and the occurrence of SWE losses in the snow pack. When SWE decreases, the model removes layers from the top of the snowpack. The layer number \(n\) can thus undergo changes over time based on the number of SWE increases and losses in the snowpack. The model neglects constructive metamorphism, refreezing, and is not able to capture rain-on-snow events which might lead to an increase in SWE but no increase in snow depth.

Citation

For more information on the model and how it was calibrated, please refer to the model description paper:

Aschauer, J.; Michel, A.; Jonas, T.; Marty, C., 2023: An empirical model to calculate snow depth from daily snow water equivalent: SWE2HS 1.0. Geoscientific Model Development, 16, 14: 4063-4081. doi: 10.5194/gmd-16-4063-2023


Schematic snowpack evolution

The figure shows the schematic modeled snow pack evolution for the station Kühtai in the winter 2001/02. The red dotted line is the measured snow depth (HS), the black solid line bounding the colored area is the modeled snow depth, the thin black lines depict the layer borders within the modeled snowpack, and the coloring refers to the modeled layer densities. The bottom panel shows the daily snow water equivalent time series which was used to force the model. The data for station Kühtai is available from Krajci et al. (2017) [1].

Installation

Please create a dedicated environment before you install the package in order to avoid dependency issues with other installed Python packages. You can do this by using virtualenv:

virtualenv <PATH TO VENV>
source <PATH TO VENV>/bin/activate

or if you use Anaconda/Miniconda:

conda create -n swe2hs_env
conda activate swe2hs_env

Afterwards you can install the latest version of swe2hs to the newly created and activated environment by running:

pip install swe2hs

This will also install all dependencies which are necessary for the package to work correctly.

Verify the installation by running the following commands in a Python console:

>>> import swe2hs as jopack
>>> print(jopack.__version__)

Installing from source

If you want to work on the package and make changes, it is recommended to clone a copy of this repositoy and install the package from source in editable mode. Clone the repository:

$ git clone https://gitlabext.wsl.ch/aschauer/swe2hs.git

A new directory swe2hs will be created. After navigating to this directory with:

$ cd swe2hs

You can install the package in editable mode which allows you to import the package under development in the Python REPL:

$ pip install -e .

Tests

Testing is done with tox and pytest. In order to run the tests locally on your machine, navigate to the root directory of the project and run:

$ tox

You can also run only the tests from a single module with:

$ tox tests/test_module.py

Documentation and Examples

API documentation as well as examples on how to use the package are available at <https://aschauer.gitlab-pages.wsl.ch/swe2hs/>. There you can also find instructions on how to contribute and a changelog.

Help

If something is not working or you find an error, please get in touch via a new issue on the GitLab repository in case you do not find any relevant information in existing issues.


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

swe2hs-1.0.4.tar.gz (508.7 kB view details)

Uploaded Source

Built Distribution

swe2hs-1.0.4-py3-none-any.whl (34.6 kB view details)

Uploaded Python 3

File details

Details for the file swe2hs-1.0.4.tar.gz.

File metadata

  • Download URL: swe2hs-1.0.4.tar.gz
  • Upload date:
  • Size: 508.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for swe2hs-1.0.4.tar.gz
Algorithm Hash digest
SHA256 f67d773bd010059cc3efd396c1d8f3313a72842f2233ed6b10be09cf010061e9
MD5 cc072938e58b250b6386b2abb3843b64
BLAKE2b-256 2db7699ebb6d797a5d0f2abadc61145e8042c9ad0fa2576e2f61641dfa01241d

See more details on using hashes here.

File details

Details for the file swe2hs-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: swe2hs-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 34.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for swe2hs-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f5174705c2615292b8c0fd30153e85bfe58771ab6f158ab2f87895c1c3c729a0
MD5 968898607ac9c9c7a1cb2b8899d73c65
BLAKE2b-256 b794dda41f3fdc090861d87551b9c3f0110486ddace2df41d6e4c86a992b6b5e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page