spicy-snow
Use Sentinel-1 volumetric scattering at C-band to retrieve snow depths.
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: nature.com, zenodo.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.0%) to scientific vocabulary
Repository
Use Sentinel-1 volumetric scattering at C-band to retrieve snow depths.
Basic Info
Statistics
- Stars: 23
- Watchers: 2
- Forks: 7
- Open Issues: 4
- Releases: 12
Metadata Files
README.md
spicy-snow
Python module to use volumetric scattering at C-band to calculate snow depths from Sentinel-1 imagery using Lieven et al.'s 2021 technique.
The relevant papers for this repository technique are:
Lievens et al 2019 - https://www.nature.com/articles/s41467-019-12566-y
Lievens et al 2021 - https://tc.copernicus.org/articles/16/159/2022/

Example Installation
sh
pip install spicy-snow
Example usage:
```python from pathlib import Path
Add main repo to path if you haven't added with conda-develop
import sys
sys.path.append('path/to/the/spicy-snow/')
from spicysnow.retrieval import retrievesnowdepth from spicysnow.IO.userdates import getinput_dates import shapely
change to your minimum longitude, min lat, max long, max lat
area = shapely.geometry.box(-113.2, 43, -113, 43.4)
this will be where your results are saved
out_nc = Path('~/Desktop/spicy-test/test.nc').expanduser()
this will generate a tuple of dates from the previous August 1st to this date
dates = getinputdates('2021-04-01') # run on all s1 images from (2020-08-01, 2021-04-01) in this example
spicyds = retrievesnowdepth(area = area, dates = dates, workdir = Path('~/Desktop/spicy-test/').expanduser(), jobname = f'testingspicy', existingjobname = 'testingspicy', debug=False, outfp=outnc) ```
Running over large areas/memory issues
If you are running out of memory or running over multiple degrees of latitude this code snippet should get you started on batch processing swathes.
```python from shapely import geometry from itertools import product for lonmin, latmin in product(range(-117, -113), range(43, 46)): area = shapely.geometry.box(lonmin, latmin, lonmin + 1, latmin + 1) outnc = Path(f'~/Desktop/spicy-test/swath{lonmin}-{lonmin + 1}{latmin}-{latmin + 1}.nc').expanduser() if outnc.exists(): continue
spicy_ds = retrieve_snow_depth(area = area, dates = dates,
work_dir = Path('~/scratch/spicy-lowman-quadrant/data/').expanduser(),
job_name = f'spicy-lowman-{lon_min}-{lon_min + 1}_{lat_min}-{lat_min + 1}', # v1
existing_job_name = f'spicy-lowman-{lon_min}-{lon_min + 1}_{lat_min}-{lat_min + 1}', # v1
debug=False,
outfp=out_nc)
```
Description of the output netcdf variables.
- wet_snow: layer showing layers flagged as wet snow (1 = wet, 0 = dry)
- snow_depth: derived snow depth in meters
- ims: snow coverage binary mask (2 = no snow, 4 = snow)
- fcf: forest coverage percentage
- s1: raw sentinel-1 with 3 bands for VV, VH backscatter in dB and incidence angle
All the other layers are intermediate layers for if you want to explore the processing pipeline.
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Coverage instructions
Run the following from the root directory of this project to get a coverage report.
You will need to have the dependencies and coverage packages available.
bash
python -m coverage run -m unittest discover -s ./tests
python -m coverage report
License
Distributed under the MIT License. See LICENSE for more information.
Acknowledgments
Readme template: https://github.com/othneildrew/Best-README-Template
Title image: https://openai.com/dall-e-2/
Contact
Zach Hoppinen: zacharyhoppinen@u.boisestate.edu
Project Link: https://github.com/SnowEx/spicy-snow
Links to relevant repos/sites
Sentinel 1 Download: https://github.com/ASFHyP3/hyp3-sdk https://github.com/asfadmin/Discovery-asf_search
IMS Download: https://github.com/tylertucker202/tibetsnowman/blob/master/tutorial/Tibetsnowmanblogentry.ipynb https://github.com/guidocioni/snow_ims
PROBA-V FCF Download: https://zenodo.org/record/3939050/files/PROBAVLC100globalv3.0.12019-nrtTree-CoverFraction-layerEPSG-4326.tif
Xarray: https://github.com/pydata/xarray
Rioxarray: https://github.com/corteva/rioxarray
Owner
- Name: SnowEx
- Login: SnowEx
- Kind: organization
- Repositories: 6
- Profile: https://github.com/SnowEx
GitHub Events
Total
- Watch event: 4
- Issue comment event: 1
- Push event: 1
- Fork event: 1
Last Year
- Watch event: 4
- Issue comment event: 1
- Push event: 1
- Fork event: 1
Issues and Pull Requests
Last synced: 10 months ago
Packages
- Total packages: 1
-
Total downloads:
- pypi 27 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 12
- Total maintainers: 1
pypi.org: spicy-snow
Snow Depth Retrievals from Sentinel-1 Backscatter.
- Homepage: https://github.com/SnowEx/spicy-snow
- Documentation: https://spicy-snow.readthedocs.io/
- License: MIT
-
Latest release: 0.2.1
published over 2 years ago
Rankings
Maintainers (1)
Dependencies
- actions/checkout v3 composite
- actions/setup-python v3 composite
- actions/checkout v2 composite
- actions/create-release v1 composite
- actions/setup-python v2 composite
- actions/upload-release-asset v1 composite
- pypa/gh-action-pypi-publish master composite
- asf_search *
- hyp3_sdk *
- matplotlib *
- numpy *
- pandas *
- rioxarray *
- shapely *
- xarray *