Skip to content

Latest commit

 

History

History
61 lines (44 loc) · 4.54 KB

README.md

File metadata and controls

61 lines (44 loc) · 4.54 KB

Pull daily SNOTEL and CCSS station data from auto-updating CSVs

Eric Gagliano ([email protected])
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.

Contents

This repository hosts the following which are updated daily:

Example notebook:

  • 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:

Quickstart

Create geodataframe of all stations

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]

Read station data given a station code

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:





Acknowledgments

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

To do list:

  • Calculate some variable equivalent of PRCPSA for CCSS stations
    • seems like only accumulated precip available