Skip to content
This repository has been archived by the owner on Mar 8, 2021. It is now read-only.

Commit

Permalink
Describe behavior of Station and Analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
mroberge committed Nov 1, 2016
1 parent 75fc99b commit ddc7592
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
25 changes: 25 additions & 0 deletions hydropy/analysis.py
Expand Up @@ -13,6 +13,31 @@

class Analysis(object):
"""holds data for multiple Stations.
TODO: Structure
* a start date
* an end date
* at least one Station object
* a dailymean panel
* a realtime panel
TODO: a peak discharge panel
* panel structure:
* axis 0 (items): Each item is a dataframe for a site.
* axis 1 (major_axis / index / rows): uses a datetime index.
* axis 2 (minor_axis / columns): each column represents a different
kind of value. the first is Q, or discharge, also Qbf,
Qquickflow, precip...
TODO: a site analysis dataframe. Each row is a site, each column
is some watershed variable or global variable...
TODO: Behavior
* Can init with as little as a list of sites.
* distant future TODO: init with no sites, select from map or list
* If no start or end specified, and no data exists, then a warning is
printed.
* __init__() creates new Stations (these do most of the work)
* data from Stations gets pulled out into panels for further analysis.
* all work takes place on the panels.
"""

def __init__(self, data, source=None, start=None,
Expand Down
15 changes: 15 additions & 0 deletions hydropy/station.py
Expand Up @@ -19,6 +19,21 @@ class Station(object):
from a source. Later, add logic that allows these functions to be
called from inside the __init__().
TODO: Behavior:
Initialize with as little as a site ID.
INIT will check for saved files for this site
if a file exists, it will return with a description of what data
exists in the file: dailymean, realtime, start, end
INIT will check if a start or end parameter has been specified, and
will request additional data if start is earlier or end is later
than what might be in the datafile.
If no start, end, or period set, init will finish.
Maybe provide a warning that no date selected?
Whenever data is requested, it gets added to whatever already exists
and saved to disk.
Different types of data get held in different dataframes. Daily mean
discharge is separated from 15 minute instantaneous data and peak
instantaneous data. Each series can have derived series that share the same
Expand Down

1 comment on commit ddc7592

@stijnvanhoey
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work an sorry I missed this earlier; I should have provided some feedback earlier. I'm interested to see how far this would work. I collected some thoughts in #10

Please sign in to comment.