Skip to content

Instantly share code, notes, and snippets.

@dharhas
dharhas / mean_discharge.py
Created April 30, 2014 17:18
simple example of using ulmo and pandas to download nwis daily streamflow data and calculate historic mean discharge
import numpy as np
import pandas as pd
from ulmo.usgs import nwis
# download and cache site data (this will take a long time the first time)
# currently downloads all available parameters
nwis.hdf5.update_site_data('06043500')
# read daily mean discharge data from cache (statistics code 00003)
data = nwis.hdf5.get_site_data('06043500', parameter_code='00060:00003')['00060:00003']