The NWIS provides continuous discharge data in two different formats: 'Daily Mean Discharge' and 'Instantaneous Values'. The Daily Mean Discharge is the average discharge for an entire day, from midnight, local time to midnight local time. The Instantaneous Discharge is also known as 'Real Time' data. It is the current discharge at the time of the measurement. In this case, measurements can occur as often as every five minutes, but most often is every fifteen minutes. Both Daily Mean and Instantaneous discharge values are given in units of 'cubic feet per second'.
On this page I illustrate the differences in the two datasets and show applications for each.
In [1]:
# Start our Jupyter Notebook the usual way:
import hydrofunctions as hf
import matplotlib.pyplot as plt
print(hf.__version__)
%matplotlib inline
In [2]:
daily = hf.NWIS('01589330', 'dv', '2018-06-01', '2018-07-01', file='DeadRun_Daily.parquet')
When we list the dataset, you can see that the discharge is collected at a daily interval.
In [3]:
daily
Out[3]:
In [4]:
instant = hf.NWIS('01589330', 'iv', '2018-06-01', '2018-07-01', file='DeadRun_Instant.parquet')
instant
Out[4]:
Now, we'll put the discharge data into two dataframes, one for the Daily data, and one for the Instantaneous data. The .head() method will list the first five lines of each table.
In [5]:
# This table needs to be shifted four hours: The data are averaged over 24 hours,
# midnight to midnight, local time (+4 UTC).
D = daily.df('q').shift(4, freq='H')
D.head()
Out[5]:
In [6]:
I = instant.df('q')
I.head()
Out[6]:
In [7]:
# Discharge data can vary over several orders of magnitude, so we usually plot it on a logarithmic scale.
D.plot(logy=True)
I.plot(logy=True)
Out[7]:
That was nice and all, but it would be better if we could plot our data on the same graph. Also, since the daily mean discharage data represent the mean discharge over the course of an entire day, these data are better plotted with a step function.
In [8]:
# A week of data
fig, ax = plt.subplots(figsize=(20, 10))
ax.step(D.loc['2018-06-01':'2018-06-08'].index.values, D.loc['2018-06-01':'2018-06-08'].values, where='post')
ax.plot(I.loc['2018-06-01':'2018-06-07'])
plt.yscale('log')
In [9]:
# Plot the entire month-long dataset.
fig, ax = plt.subplots(figsize=(14, 7))
ax.plot(I, "orange", label="Instantaneous Discharge")
ax.step(D.index.values, D.values, where='post', label="Daily Mean Discharge")
plt.xlabel('Time')
plt.ylabel('Discharge, cfs')
plt.legend()
# I've commented out the command to plot this on a logarithmic scale, but you can try it.
#plt.yscale('log')
Out[9]:
The Instantaneous Values are the 'raw' data that gets collected at each stream gauge site. They get processed to produce the Daily Mean Discharge values. The Daily Mean discharge data then become the 'official' data for each USGS stream gauge. These data get error-checked.
The Daily Mean discharge data are great for situations where you want to know the baseflow of a watershed, or the volume of water that is entering a reservoir or if you want to learn about the long-term hydrology of a watershed. Daily values get used for:
The Instantaneous Values are better for examining the shape and timing of flood waves. They get used for: