Coder Social home page Coder Social logo

egagli / snotel_ccss_stations Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 7.95 GB

Easily access SNOTEL and CCSS station data daily without cloning this repo. Requires only pandas and geopandas (or just download the CSVs), with no complex APIs or download functions.

Python 0.09% Jupyter Notebook 99.91%
automated ccss equivalent nrcs snotel snow snowpack station swe water

snotel_ccss_stations's Introduction

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

snotel_ccss_stations's People

Contributors

egagli avatar

Stargazers

 avatar  avatar

Watchers

 avatar

snotel_ccss_stations's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.