WSL/SLF GitLab Repository

Skip to content
Snippets Groups Projects
Select Git revision
  • 95ca3414f3806c7d78da09d74c2bcd0cc8c4b471
  • master default protected
  • pooled_R
  • pooled_R_rho
  • pooled_R_overburden
  • most_complex
  • v1.0.4 protected
  • v1.0.3 protected
  • v1.0.2 protected
  • v1.0.1 protected
  • v1.0.0 protected
  • v0.0.3 protected
  • v0.0.2 protected
  • v0.0.1 protected
  • R_rho_overburden
  • pooled_R_overburden
  • pooled_R_rho
  • pooled_R_version
18 results

swe2hs

  • Clone with SSH
  • Clone with HTTPS
  • Aschauer's avatar
    Aschauer authored
    PyPI does not allow relative links
    95ca3414
    History
    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 SWE2HS 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 exponentially with time towards a time-varying maximum density. The maximum density is starting with an initial value at creation time of the layer and is subsequently increasing 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 SWE 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 (ROS) events which might lead to an increase in SWE but no increase in HS.


    Schematic snowpack evolution

    The figure shows the schematic modeled snow pack evolution for the station Kuhtai 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. .. end_figure_caption

    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 an 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 to the package 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.