RHESSysWorkflows  1.33
Public Member Functions | Static Public Attributes | List of all members
rhessysworkflows.rhessys.RHESSysOutput Class Reference
Inheritance diagram for rhessysworkflows.rhessys.RHESSysOutput:

Public Member Functions

def readObservedDataFromFile
 Reads the data from the observed data file. More...
 
def readColumnsFromFile
 Reads the specified columns from the text file. More...
 
def readColumnFromFile
 Reads the specified column from the text file. More...
 
def readColumnsFromPatchDailyFile
 Reads the specified columns of data from a RHESSys patch daily output file. More...
 
def readObservedDataFromFile
 Reads the data from the observed data file. More...
 
def readColumnsFromFile
 Reads the specified columns from the text file. More...
 
def readColumnFromFile
 Reads the specified column from the text file. More...
 
def readColumnsFromPatchDailyFile
 Reads the specified columns of data from a RHESSys patch daily output file. More...
 

Static Public Attributes

int TIME_STEP_HOURLY = 1
 
int TIME_STEP_DAILY = 2
 
list TIME_STEPS = [TIME_STEP_HOURLY, TIME_STEP_DAILY]
 
string HOUR_HEADER = 'hour'
 
string DAY_HEADER = 'day'
 
string MONTH_HEADER = 'month'
 
string YEAR_HEADER = 'year'
 

Member Function Documentation

def rhessysworkflows.rhessys.RHESSysOutput.readColumnFromFile (   cls,
  f,
  column_name,
  sep = " ",
  logger = None,
  startHour = 1 
)

Reads the specified column from the text file.

The file must have a header. Reads dates/datetime from file by searching for headers with names of 'hour', 'day', 'month', 'year'

Arguments: f – file object The text file to read from column_name – The name of the column to return sep – The field separator (defaults to " ") startHour – Hour to use for daily data

Returns tuple (list<datetime.datetime>, list<float>). Returns tuple of empty lists if the column had no data, or if the column was not found

def rhessysworkflows.rhessys.RHESSysOutput.readColumnFromFile (   cls,
  f,
  column_name,
  sep = " ",
  logger = None,
  startHour = 1 
)

Reads the specified column from the text file.

The file must have a header. Reads dates/datetime from file by searching for headers with names of 'hour', 'day', 'month', 'year'

Arguments: f – file object The text file to read from column_name – The name of the column to return sep – The field separator (defaults to " ") startHour – Hour to use for daily data

Returns tuple (list<datetime.datetime>, list<float>). Returns tuple of empty lists if the column had no data, or if the column was not found

def rhessysworkflows.rhessys.RHESSysOutput.readColumnsFromFile (   cls,
  f,
  column_names,
  sep = ' ',
  logger = None,
  readHour = True 
)

Reads the specified columns from the text file.

The file must have a header. Reads dates/datetime from file by searching for headers with names of 'hour', 'day', 'month', 'year'

Arguments: f – file object The text file to read from column_names – A list of column names to return sep – The field separator (defaults to ' ') readHour – boolean Control whether the hour should be read from the file header

Returns Pandas DataFrame object indexed by date

Raises exception if data file does not include year, month, and day fields

def rhessysworkflows.rhessys.RHESSysOutput.readColumnsFromFile (   cls,
  f,
  column_names,
  sep = ' ',
  logger = None,
  readHour = True 
)

Reads the specified columns from the text file.

The file must have a header. Reads dates/datetime from file by searching for headers with names of 'hour', 'day', 'month', 'year'

Arguments: f – file object The text file to read from column_names – A list of column names to return sep – The field separator (defaults to ' ') readHour – boolean Control whether the hour should be read from the file header

Returns Pandas DataFrame object indexed by date

Raises exception if data file does not include year, month, and day fields

def rhessysworkflows.rhessys.RHESSysOutput.readColumnsFromPatchDailyFile (   cls,
  f,
  column_names,
  sep = " " 
)

Reads the specified columns of data from a RHESSys patch daily output file.

The file must have a header. Reads dates/datetime from file by searching for headers with names of 'hour', 'day', 'month', 'year'

Arguments: f – file object The text file to read from column_names – List of the names of the columns to return sep – The field separator (defaults to " ")

Returns collection.OrderedDict<datetime.datetime, dict<string, list<float>>, where the value dict for each datetime key uses column_name as its key. Returns An empty dict if data for the specified columns were not found.

def rhessysworkflows.rhessys.RHESSysOutput.readColumnsFromPatchDailyFile (   cls,
  f,
  column_names,
  sep = " " 
)

Reads the specified columns of data from a RHESSys patch daily output file.

The file must have a header. Reads dates/datetime from file by searching for headers with names of 'hour', 'day', 'month', 'year'

Arguments: f – file object The text file to read from column_names – List of the names of the columns to return sep – The field separator (defaults to " ")

Returns collection.OrderedDict<datetime.datetime, dict<string, list<float>>, where the value dict for each datetime key uses column_name as its key. Returns An empty dict if data for the specified columns were not found.

def rhessysworkflows.rhessys.RHESSysOutput.readObservedDataFromFile (   cls,
  f,
  header = True,
  timeStep = TIME_STEP_DAILY,
  logger = None,
  readHour = True 
)

Reads the data from the observed data file.

Assumes that there is one data point per line. By default a daily timestep is assumed, but hourly is also supported; time step is used for calculating date for each datum.

Arguments: f – file object The text file to read from header – boolean Specifies whether a header is present in the file. If True, the first line of the file will read and used to determine start date of the timeseries. Date is assumed to be in the format: "YYYY M D H" timeStep – string One of RHESSysOutput.TIME_STEPS readHour – boolean Control whether the hour should be read from the file header

Returns tuple (list<datetime.datetime>, list<float>) Returns tuple (empty list, list<float>) if header is false Returns tuple of empty lists if there were no data.

def rhessysworkflows.rhessys.RHESSysOutput.readObservedDataFromFile (   cls,
  f,
  header = True,
  timeStep = TIME_STEP_DAILY,
  logger = None,
  readHour = True 
)

Reads the data from the observed data file.

Assumes that there is one data point per line. By default a daily timestep is assumed, but hourly is also supported; time step is used for calculating date for each datum.

Arguments: f – file object The text file to read from header – boolean Specifies whether a header is present in the file. If True, the first line of the file will read and used to determine start date of the timeseries. Date is assumed to be in the format: "YYYY M D H" timeStep – string One of RHESSysOutput.TIME_STEPS readHour – boolean Control whether the hour should be read from the file header

Returns tuple (list<datetime.datetime>, list<float>) Returns tuple (empty list, list<float>) if header is false Returns tuple of empty lists if there were no data.

Member Data Documentation

string rhessysworkflows.rhessys.RHESSysOutput.DAY_HEADER = 'day'
static
string rhessysworkflows.rhessys.RHESSysOutput.HOUR_HEADER = 'hour'
static
string rhessysworkflows.rhessys.RHESSysOutput.MONTH_HEADER = 'month'
static
int rhessysworkflows.rhessys.RHESSysOutput.TIME_STEP_DAILY = 2
static
int rhessysworkflows.rhessys.RHESSysOutput.TIME_STEP_HOURLY = 1
static
list rhessysworkflows.rhessys.RHESSysOutput.TIME_STEPS = [TIME_STEP_HOURLY, TIME_STEP_DAILY]
static
string rhessysworkflows.rhessys.RHESSysOutput.YEAR_HEADER = 'year'
static

The documentation for this class was generated from the following file: