This is the codebase for "A Machine Learning Model for Estimating Snow Density and Snow Water Equivalent from Snow Depth and Seasonal Snow Climate Classes."
Overview
This study proposes a machine learning model for estimating snowpack bulk density (
- Source code for our paper (DOI will be shared after paper acceptance).
- Instructions for setup and usage.
The dataset used in this study comes from thre sources:
- SNOTEL Dataset - was downloaded using metloom.
- Global Seasonal Snow Classification.
- Maine Snow Survey Data.
Software used | Version | Hardware specifications | OS required |
---|---|---|---|
Python | 3.11.5 | The codes in this repository should work on any recent PC/Laptop | Linux (any), MacOS, Windows |
This project uses Conda for environment management. However, you can use any environment management tool of your choice. For example, you can manage Python versions with pyenv and create a virtual environment using venv. Go to Step 3 if you wish not to use Conda.
If you don’t have Conda installed, download Anaconda or MiniConda. See Installing Conda to know which installer is right for you.
conda env create --file environment.yml
conda activate ml_density_env
For those not using Conda, you can set up a virtual environment with venv:
python -m venv ml_density_env
source ml_density_env/bin/activate # activate the virtual environment
Note: the Python version will be the default version on your PC. You can manage Python version using pyenv.
mkdir ml_density
cd ml_density
git clone https://github.com/cryogars/density-models.git
cd density-models
Ensure everything is set up correctly:
python --version # Should return 3.11.5
pip list # Displays installed packages
To verify the models are working correctly, you can run the tests:
pytest -v # Run all tests
pip install .
If you wish to modify the source code, install in development mode:
pip install -e .
Note: This project uses conda
to only manage the Python version and install Jupyter. All package dependencies are installed via pip
. This approach makes the installation process more consistent whether you're using conda or another environment management tool (e.g., pyenv + venv). All dependencies are specified in requirements.txt
Create the data folder and download:
- SNOTEL Data: link.
- Global Seasonal Snow Classification on NSIDC: NSIDC link. For this project, download
SnowClass_NA_300m_10.0arcsec_2021_v01.0.nc
. - Main Snow Survey Data: link.
After running the experiments, you can deactivate the conda environment by running the command below:
conda deactivate
To completely remove the environment, run:
conda env remove --name ml_density_env
The authors would like to thank:
- USDA NRCS for providing the SNOTEL data
- M3Works for their metloom package, which we used to download the SNOTEL data.
- Maine Geological Survey and the United States Geological Survey for providing the Maine Snow Survey data.
- The creators of the srtm.py Python package for their open-source tool, which we used to obtain the SRTM elevation data.
- U.S. Army CRREL for the funding (BAA W913E520C0017).
For any questions or issues, please open an issue or reach out to [email protected].