Skip to content

cryogars/density-models

Repository files navigation

Snow Density Estimation using Machine Learning

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 ($\rho_s$) from snow depth ($HS$) and other variables that can be measured or derived from the date and location of $HS$ measurements. This repository contains:

  • Source code for our paper (DOI will be shared after paper acceptance).
  • Instructions for setup and usage.

Dataset

The dataset used in this study comes from thre sources:

Software & Hardware List

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

Installation and Setup

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.

1. Install Conda

If you don’t have Conda installed, download Anaconda or MiniConda. See Installing Conda to know which installer is right for you.

2. Create and Activate the Conda Environment

conda env create --file environment.yml
conda activate ml_density_env 

3. Installation (Non-Conda Users)

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.

4. Create and Navigate to Directory

mkdir ml_density
cd ml_density

5. Clone This Repository

git clone https://github.com/cryogars/density-models.git
cd density-models

6. Verify Installation

Ensure everything is set up correctly:

python --version  # Should return 3.11.5
pip list  # Displays installed packages

7. Run Tests (Optional)

To verify the models are working correctly, you can run the tests:

pytest -v # Run all tests

8. Install Source Code

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

Directory Setup

Create the data folder and download:

  1. SNOTEL Data: link.
  2. Global Seasonal Snow Classification on NSIDC: NSIDC link. For this project, download SnowClass_NA_300m_10.0arcsec_2021_v01.0.nc.
  3. Main Snow Survey Data: link.

Deactivate and/or Remove Environment

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

Acknowledgments

The authors would like to thank:

  1. USDA NRCS for providing the SNOTEL data
  2. M3Works for their metloom package, which we used to download the SNOTEL data.
  3. Maine Geological Survey and the United States Geological Survey for providing the Maine Snow Survey data.
  4. The creators of the srtm.py Python package for their open-source tool, which we used to obtain the SRTM elevation data.
  5. U.S. Army CRREL for the funding (BAA W913E520C0017).

Contact

For any questions or issues, please open an issue or reach out to [email protected].

About

A machine learning for snow density estimation project.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published