Skip to main content
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.


Release files for swe2hs 1.0.4

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

Source distribution (sdist)

Source distribution for swe2hs 1.0.4
File Size Uploaded
swe2hs-1.0.4.tar.gz 508.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for swe2hs 1.0.4
File Interpreter ABI Platform
swe2hs-1.0.4-py3-none-any.whl Python 3 none any Details

Total release size:543.3 kB

Release files / swe2hs-1.0.4.tar.gz

Download URL swe2hs-1.0.4.tar.gz
Size 508.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f67d773bd010059cc3efd396c1d8f3313a72842f2233ed6b10be09cf010061e9
BLAKE2b-256 checksum
How to use checksums
2db7699ebb6d797a5d0f2abadc61145e8042c9ad0fa2576e2f61641dfa01241d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Release files / swe2hs-1.0.4-py3-none-any.whl

Download URL swe2hs-1.0.4-py3-none-any.whl
Size 34.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f5174705c2615292b8c0fd30153e85bfe58771ab6f158ab2f87895c1c3c729a0
BLAKE2b-256 checksum
How to use checksums
b794dda41f3fdc090861d87551b9c3f0110486ddace2df41d6e4c86a992b6b5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Release history Release notifications | RSS feed

This release

1.0.4 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

0.0.3

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