DOI-USGS / snow-to-flow

What does changing snowmelt mean for flow in the western US?
Creative Commons Zero v1.0 Universal
12 stars 8 forks source link

From Snow to Flow Visualization

A screencapture of the Snow to Flow header, which shows an abstract collage of snowy mountains and a frozen lake under a series of snow and discharge line charts.

See the page live: https://labs.waterdata.usgs.gov/visualizations/snow-to-flow/index.html#/

A majority of the water in the Western United States comes from snowmelt. Winter snow accumulation, as well as spring snowmelt, affect streamflow and water availability for the rest of the year. Changes in the timing, magnitude, and duration of snowmelt may substantially alter downstream water availability. In fact, approximately 2 billion people are expected to experience diminished water supplies because of seasonal snowpack decline this century.

This data visualization explores the fundamentals of USGS snow hydrology research. The graphics describe important dynamics that determine how snow turns into flow, and the charts show the connection between snowpack (measured as snow water equivalent) and streamflow (measured as discharge). An R-based data pipeline using the targets package is used to fetch and process data that are displayed in the website. These files are contained in the data_processing_pipeline subdirectory.

All charts, data, and diagrams are free and open to the public. Take screencaptures of what you need, or browse through some extra images at: https://github.com/USGS-VIZLAB/snow-to-flow/tree/main/public/public_images

The Code

The project is Open Source and uses the Vue JavaScript framework in conjunction with animated Scalable Vector Graphics (SVG) and raster graphics. The build process uses the Jenkins task runner.

Project Setup

First, clone the project to your local system and cd to the cloned directory.

To run the data processing pipeline:

To build the website locally:

Notes on Setup

To fix that, do the following:

'vue-cli-service' is not recognized as an internal or external command, operable program or batch file.

Data processing

The data processing steps behind the charts and maps on the Snow-to-flow page are documented in the data_processing_pipeline subdirectory of this repo. Briefly, daily snow water equivalent values were pulled from all USDA NRCS snow telemetry sites since 1981 in 1_fetch/src/fetch_SNOTEL.R. This data was used to calculate peak SWE and SM50 at all sites with a minimum of 20 years of data in the historic record (1981-2011) in 2_process/src/prep_SNOTEL.R. In addition, April 1st SWE was accessed through time for each site and used to find the percentile in WY2021. These metrics were used to draw mouseover SWE curves and trendlines, that were pre-defined in R 6_visualize/src/trend_coords.R. The trendline charts are displayed with an svg map of the Western U.S., that was also first pre-processed in R 6_visualize/src/make_map.R and brought to life using D3.js and Vue.js. The final data files used to draw these charts are labelled SNOTEL_...csv here:https://github.com/USGS-VIZLAB/snow-to-flow/tree/main/public/data

The SWE and streamflow ridgelines are drawn using daily gridded SWE values at 4-km resolution were obtained for the 2011 and 2012 water years at each location from the National Snow & Ice Data Center. Streamflow was obtained from the USGS National Water Information System. The data generating these charts is available here: https://github.com/USGS-VIZLAB/snow-to-flow/tree/main/public/data (mmd_df_2011.csv, mmd_df_2012.csv, swe_df_2011.csv, swe_df_2012.csv).

Disclaimer

This software is preliminary or provisional and is subject to revision. It is being provided to meet the need for timely best science. The software has not received final approval by the U.S. Geological Survey (USGS). No warranty, expressed or implied, is made by the USGS or the U.S. Government as to the functionality of the software and related material nor shall the fact of release constitute any such warranty. The software is provided on the condition that neither the USGS nor the U.S. Government shall be held liable for any damages resulting from the authorized or unauthorized use of the software.

This software is provided "AS IS."

CC0