In this notebook we'll examine three sites along the Gwynns Falls, in Maryland. 'Falls' in this case is a local word for 'River', like in the Jones Falls or Gunpowder Falls. It doesn't refer to a waterfall!
Because the three sites are in a row on the same river, the upstream site has a watershed that is nested inside of the middle site, which is nested inside the downstream site, which has the largest watershed.
In [1]:
import hydrofunctions as hf
%matplotlib inline
The three stream gauges are:
In [2]:
streamid = ['01589197', '01589300','01589352']
# request data for our two sites for a three-year period.
sites = hf.NWIS(streamid, 'dv', start_date='2001-01-01', end_date='2003-12-31')
sites
Out[2]:
In [3]:
#create a dataframe of the sites
Q = sites.df('discharge')
#rename the columns
Q.columns=['Upper', 'Middle', 'Lower']
#show the first few rows of the data
Q.head()
Out[3]:
In [4]:
#look at the descriptive statistics for each part of the stream.
#Note that the mean and standard deviation increase as you move down the stream
Q.describe()
Out[4]:
In [5]:
#create a flow duration for each of the streams
hf.flow_duration(Q)
Out[5]:
In [6]:
# create a hydrograph of the upper portion of the stream.
# the .loc method selects a subset of a dataframe.
# The first item selects rows, with ':' selecting every row.
# The second item selects columns, with 'Upper' selecting the column with the 'Upper' label.
# The .plot() method plots the values in the columns on the y axis, with the rows as the x axis.
Q.loc[:, 'Upper'].plot()
Out[6]: