Skip to content
Prev 388954 / 398506 Next

Calculate daily means from 5-minute interval data

It is not clear to me who Jeff Newmiller's comment about periodicity
is addressed to.
The original poster, for asking for daily summaries?
A summary of what I wrote:
- daily means and standard deviations are a very poor choice for river flow data
- if you insist on doing that anyway, no fancy packages are required, just
  reshape the data into a matrix where rows correspond to days using matrix()
  and summarise it using rowMeans() and apply(... FUN=sd).
- but it is quite revealing to just plot the data using image(), which makes no
  assumptions about periodicity or anything else, just a way of wrapping 1D
  data to fill a 2D space and still have interpretable axes
- the river data I examined showed fairly boring time series interrupted by
  substantial shocks (caused by rainfall in catchment areas).

New stuff...
The river data I looked at came from Environment Canterbury.
River flows there are driven by (a) snow-melt from the Southern Alps.
which *is* roughly periodic with a period of one year and (b) rainfall
events which charge the upstream catchment areas, leading to a
rapid ramp up following by a slower exponential-looking decay.
The (a) elemen happens to be invisible in the Environment Canterbury
data, as they only release the latest month of flow data, The ratio
between low flows and high flows ranged from 2 to 10 in the data I
could get.

The (b) component is NOT periodic and is NOT aligned with days
and is NOT predictable and is extremely important.

Where you begin is not with R or a search for packages but with
the question "what is actually going on in the real world?  What
are the influences on river flow, are they natural (and which) or
human (and which)?"  It's going to matter a lot how much
irrigation water is drawn from a river, and that may be roughly
predictable.  If water is occasionally diverted into another river
for flood control, that's going to make a difference.  If there is a
dam, that's going to make a difference.  Rainfall and snowmelt
are going to be seasonal (in a hand-wavy sense) but differently so.

And there is an equally important question:  "Why am I doing this?
What do I want to see in the data that doesn't already leap to the
eye?  What is anyone going to DO differently if they see that?"
Are you interested in whether minimum flows are adequate for
irrigation or whether flood control systems are adequate for high
flows?

Thinking about the people who might read my report, if I were
tasked with analysing river data, I would want to analyse the
data and present the results in such a way that most of them
would say "Why did I need this guy?  It's so obvious!  I could
have done that!  (If I had ever thought of it.)"  But that is because
I am thinking of farmers and politicians who have other maddened
grizzly bears to stun (thanks, Terry Pratchett).  If writing for an
audience of hydrologists and statisticians, you would make
different choices.

Here's a little bit of insight from the physics.
Why is it that the spikes in the flows rise rapidly and fall slowly?
Because the fall is limited by the rate at which the river system
can carry water away, but the rate at which a storm can deliver
water to the river system is not.  Did I know this before looking
at the ECan data?  Well, I had *seen* rivers rising rapidly and
falling slowly, but I had never *observed*; I had never thought
about it.   But now that I have, it's *obvious*: you cannot
understand the river without understanding the weather that
the river is subject to.  Anyone who genuinely understands
hydrology is looking at me sadly and saying "Just now you
figured this out?  At your mother's knee you didn't learn this?"
But it has such repercussions.  It means you need data on
rainfall in the catchment areas.  (Which ECan, to their credit,
also provide.)  In an important sense, there is no right way to
analyse river flow data *on its own*.
On Mon, 30 Aug 2021 at 14:47, Jeff Newmiller <jdnewmil at dcn.davis.ca.us> wrote:

Thread (25 messages)

Rich Shepard Calculate daily means from 5-minute interval data Aug 29 Eric Berger Calculate daily means from 5-minute interval data Aug 29 Jeff Newmiller Calculate daily means from 5-minute interval data Aug 29 Rich Shepard Calculate daily means from 5-minute interval data Aug 29 Rich Shepard Calculate daily means from 5-minute interval data Aug 29 Jeff Newmiller Calculate daily means from 5-minute interval data Aug 29 Rui Barradas Calculate daily means from 5-minute interval data Aug 29 Rich Shepard Calculate daily means from 5-minute interval data Aug 29 Rui Barradas Calculate daily means from 5-minute interval data Aug 29 Rich Shepard Calculate daily means from 5-minute interval data Aug 29 Rich Shepard Calculate daily means from 5-minute interval data Aug 29 Andrew Simmons Calculate daily means from 5-minute interval data Aug 29 Rich Shepard Calculate daily means from 5-minute interval data Aug 29 Richard O'Keefe Calculate daily means from 5-minute interval data Aug 29 Jeff Newmiller Calculate daily means from 5-minute interval data Aug 29 Richard O'Keefe Calculate daily means from 5-minute interval data Aug 30 Rich Shepard Calculate daily means from 5-minute interval data Aug 30 Richard O'Keefe Calculate daily means from 5-minute interval data Aug 30 Rich Shepard Calculate daily means from 5-minute interval data Aug 30 Avi Gross Calculate daily means from 5-minute interval data Aug 30 Bert Gunter Calculate daily means from 5-minute interval data Aug 30 Richard O'Keefe Calculate daily means from 5-minute interval data Aug 30 Rich Shepard Calculate daily means from 5-minute interval data Aug 31 Rich Shepard Calculate daily means from 5-minute interval data Aug 31 Jeff Newmiller Calculate daily means from 5-minute interval data Aug 31