Eric Gagliano (egagli@uw.edu)
Updated: February 19th, 2024
A repository to make SNOTEL and CCSS station (daily) data a little easier to handle. Note that you do not need to clone or install this repo, you simply need pandas and geopandas to read data contained in this repo (or you can just download the CSVs). No confusing / hard to use APIs and download functions! Data is automatically updated daily via a github action.
- a geojson of all SNOTEL and CCSS stations: all_stations.geojson
- a data folder containing a CSV for each station with daily SNWD [m], WTEQ [m], PRCPSA [m], TMIN [C], TMAX [C], TAVG [C]: data/
- a compressed file containing all CSVs: data/all_station_data.tar.lzma
- a notebook showing different ways of reading the data, as well as some example use cases: example_usage.ipynb
Though you shouldn't need to access or edit any of these, I've included a list of the utilities used and general workflow for transparency:
- an admin notebook for resetting the data in this repository: admin_first_time_setup.ipynb
- a file containing all the functions to acquire and clean the data: snotel_ccss_stations/snotel_ccss_stations.py
- a script for updating the data: snotel_ccss_stations/update_csv_files.py
- a github workflow file to automatically update the data via a github action: .github/workflows/update_csv_files.yml
all_stations_gdf = gpd.read_file('https://raw.githubusercontent.com/egagli/snotel_ccss_stations/main/all_stations.geojson').set_index('code')
all_stations_gdf = all_stations_gdf[all_stations_gdf['csvData']==True]
station_id = '679_WA_SNTL'
data_df = pd.read_csv(f'https://raw.githubusercontent.com/egagli/snotel_ccss_stations/main/data/{station_id}.csv',index_col='datetime', parse_dates=True)
Check out the example_usage.ipynb notebook for examples
Here are some screenshots from the example notebook:
This repository builds on the work of a lot of great scientists and coders! Of note:
- The idea for this repo originated while using Scott Henderson's snotel repository and recognizing the value of having SNOTEL data staged somehow. I've also adapted Scott's code to create the all_stations.geojson
- I use Emilio Mayorga's ulmo underneath the hood to fetch SNOTEL data
- I've adapated code from David Shean's SnowEx Hackweek 2021 SNOTEL tutorial to use ulmo to pull SNOTEL data, and also adapted one of his plot ideas in the example notebook
- Github user rgzn for their SnowSurvey repo from which I took inspiration for querying the CCSS stations
- NRCS for the SNOTEL network, and CCSS for theirs
- Calculate some variable equivalent of PRCPSA for CCSS stations
- seems like only accumulated precip available