RHESSysWorkflows  1.33
Functions | Variables
RHESSysPlotMassbalance Namespace Reference

Tool for comparing mass balance for observed and basin-scale RHESSys output. More...

Functions

def plotTable (args, col_names, obs, data, ax)
 
def plotGraph
 

Variables

string OBS_HEADER_STREAMFLOW = 'streamflow_mm'
 
string OBS_HEADER_PRECIP = 'precip_mm'
 
string PLOT_TYPE_STD = 'standard'
 
string PLOT_TYPE_LOGY = 'logy'
 
string PLOT_TYPE_CDF = 'cdf'
 
string PLOT_TYPE_TABLE = 'table'
 
list PLOT_TYPES = [PLOT_TYPE_STD, PLOT_TYPE_LOGY, PLOT_TYPE_CDF, PLOT_TYPE_TABLE]
 
 PLOT_DEFAULT = PLOT_TYPE_STD
 
tuple parser = argparse.ArgumentParser(description='Plot CDF of N datasets vs. observed data')
 
string help = 'Base name of file to output figure to. Only specify base name of file, not extension (PDF and PNG files will be produced)'
 
tuple args = parser.parse_args()
 
tuple obs = pd.read_csv(args.obs, index_col=0, parse_dates=True)
 
list cols = ['streamflow', 'evap', 'trans', 'precip']
 
 obs_align = None
 
int max_x = 0
 
tuple mod_file = open(args.data, 'r')
 
tuple mod_df
 
tuple tmp_max_x = max(mod_align['streamflow'].max(), obs_align[OBS_HEADER_STREAMFLOW].max())
 
tuple min_x = max(min_x, mod_align['streamflow'].min())
 
tuple fig = plt.figure(figsize=(args.figureX, args.figureY), dpi=80, tight_layout=True)
 
tuple ax_std = fig.add_subplot(221)
 
tuple ax_log = fig.add_subplot(222)
 
tuple ax_cdf = fig.add_subplot(223)
 
tuple ax_tab = fig.add_subplot(224)
 
tuple data_plt
 
list col_names = ['Observed', 'Modeled']
 
list legend_items = ['Observed', 'Modeled']
 
string outname = "%s_color"
 
string plot_filename_png = "%s.png"
 
string plot_filename_pdf = "%s.pdf"
 

Detailed Description

Tool for comparing mass balance for observed and basin-scale RHESSys output.

This software is provided free of charge under the New BSD License. Please see the following license information:

Copyright (c) 2014, University of North Carolina at Chapel Hill All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Author
Brian Miles brian.nosp@m._mil.nosp@m.es@un.nosp@m.c.ed.nosp@m.u

Function Documentation

def RHESSysPlotMassbalance.plotGraph (   args,
  plottype,
  obs,
  data,
  columns,
  min_x,
  max_x,
  ax,
  secondary = None,
  plotColor = True 
)
def RHESSysPlotMassbalance.plotTable (   args,
  col_names,
  obs,
  data,
  ax 
)

Variable Documentation

tuple RHESSysPlotMassbalance.args = parser.parse_args()
tuple RHESSysPlotMassbalance.ax_cdf = fig.add_subplot(223)
tuple RHESSysPlotMassbalance.ax_log = fig.add_subplot(222)
tuple RHESSysPlotMassbalance.ax_std = fig.add_subplot(221)
tuple RHESSysPlotMassbalance.ax_tab = fig.add_subplot(224)
list RHESSysPlotMassbalance.col_names = ['Observed', 'Modeled']
list RHESSysPlotMassbalance.cols = ['streamflow', 'evap', 'trans', 'precip']
tuple RHESSysPlotMassbalance.data_plt
Initial value:
1 = plotGraph(args, PLOT_TYPE_STD, obs_align, mod_align, ['streamflow'],
2  min_x, max_x, ax_std, secondary='precip', plotColor=args.color)
def plotGraph
Definition: RHESSysPlotMassbalance.py:98
tuple RHESSysPlotMassbalance.fig = plt.figure(figsize=(args.figureX, args.figureY), dpi=80, tight_layout=True)
string RHESSysPlotMassbalance.help = 'Base name of file to output figure to. Only specify base name of file, not extension (PDF and PNG files will be produced)'
list RHESSysPlotMassbalance.legend_items = ['Observed', 'Modeled']
int RHESSysPlotMassbalance.max_x = 0
tuple RHESSysPlotMassbalance.min_x = max(min_x, mod_align['streamflow'].min())
tuple RHESSysPlotMassbalance.mod_df
Initial value:
1 = RHESSysOutput.readColumnsFromFile(mod_file, cols,
2  readHour=False)
tuple RHESSysPlotMassbalance.mod_file = open(args.data, 'r')
tuple RHESSysPlotMassbalance.obs = pd.read_csv(args.obs, index_col=0, parse_dates=True)
RHESSysPlotMassbalance.obs_align = None
string RHESSysPlotMassbalance.OBS_HEADER_PRECIP = 'precip_mm'
string RHESSysPlotMassbalance.OBS_HEADER_STREAMFLOW = 'streamflow_mm'
string RHESSysPlotMassbalance.outname = "%s_color"
tuple RHESSysPlotMassbalance.parser = argparse.ArgumentParser(description='Plot CDF of N datasets vs. observed data')
RHESSysPlotMassbalance.PLOT_DEFAULT = PLOT_TYPE_STD
string RHESSysPlotMassbalance.plot_filename_pdf = "%s.pdf"
string RHESSysPlotMassbalance.plot_filename_png = "%s.png"
string RHESSysPlotMassbalance.PLOT_TYPE_CDF = 'cdf'
string RHESSysPlotMassbalance.PLOT_TYPE_LOGY = 'logy'
string RHESSysPlotMassbalance.PLOT_TYPE_STD = 'standard'
string RHESSysPlotMassbalance.PLOT_TYPE_TABLE = 'table'
list RHESSysPlotMassbalance.PLOT_TYPES = [PLOT_TYPE_STD, PLOT_TYPE_LOGY, PLOT_TYPE_CDF, PLOT_TYPE_TABLE]
tuple RHESSysPlotMassbalance.tmp_max_x = max(mod_align['streamflow'].max(), obs_align[OBS_HEADER_STREAMFLOW].max())