RHESSysWorkflows  1.33
Namespaces | Variables
PatchToCumulativeMap.py File Reference

Namespaces

 PatchToCumulativeMap
 Tool for making cummulative maps of patch-scale RHESSys output variables.
 

Variables

tuple PatchToCumulativeMap.PATCH_DAILY_RE = re.compile('^(.+_patch.daily)$')
 
tuple PatchToCumulativeMap.VARIABLE_EXPR_RE = re.compile(r'\b([a-zA-z][a-zA-Z0-9_\.]+)\b')
 
string PatchToCumulativeMap.RECLASS_MAP_TMP = "patchtomovietmp_%d"
 
tuple PatchToCumulativeMap.parser = argparse.ArgumentParser(description='Generate cummulative map of patch-scale RHESSys output variables')
 
string PatchToCumulativeMap.help = 'The configuration file.'
 
tuple PatchToCumulativeMap.args = parser.parse_args()
 
 PatchToCumulativeMap.configFile = None
 
tuple PatchToCumulativeMap.context = Context(args.projectDir, configFile)
 
tuple PatchToCumulativeMap.metadata = RHESSysMetadata.readRHESSysEntries(context)
 
list PatchToCumulativeMap.patchDailyFilepaths = []
 
list PatchToCumulativeMap.outputFilePaths = []
 
tuple PatchToCumulativeMap.outputDir = os.path.abspath(args.outputDir)
 
string PatchToCumulativeMap.outputFile = "%s.png"
 
tuple PatchToCumulativeMap.cdfFilepath = os.path.join(outputDir, args.cdfOutputfile)
 
list PatchToCumulativeMap.variables = ['patchID']
 
tuple PatchToCumulativeMap.m = VARIABLE_EXPR_RE.findall(args.outputVariable)
 
 PatchToCumulativeMap.title = args.mapTitle
 
tuple PatchToCumulativeMap.tmpDir = tempfile.mkdtemp()
 
tuple PatchToCumulativeMap.reclassRule = os.path.join(tmpDir, 'reclass.rule')
 
tuple PatchToCumulativeMap.colorTable = os.path.join(tmpDir, 'color.rule')
 
tuple PatchToCumulativeMap.grassDbase = os.path.join(context.projectDir, metadata['grass_dbase'])
 
tuple PatchToCumulativeMap.grassConfig = GRASSConfig(context, grassDbase, metadata['grass_location'], metadata['grass_mapset'])
 
tuple PatchToCumulativeMap.grassLib = GRASSLib(grassConfig=grassConfig)
 
tuple PatchToCumulativeMap.result
 
list PatchToCumulativeMap.variablesList = []
 
tuple PatchToCumulativeMap.f = open(patchDailyFilepath)
 
tuple PatchToCumulativeMap.data = RHESSysOutput.readColumnsFromPatchDailyFile(f, variables)
 
 PatchToCumulativeMap.patchIDs = None
 
 PatchToCumulativeMap.variable = None
 
list PatchToCumulativeMap.dataForDate = data[key]
 
tuple PatchToCumulativeMap.expr = VARIABLE_EXPR_RE.sub(r'np.array(dataForDate["\1"])', args.outputVariable)
 
int PatchToCumulativeMap.max_val = 0
 
 PatchToCumulativeMap.max_idx = None
 
 PatchToCumulativeMap.max_patchID = None
 
list PatchToCumulativeMap.normalizedVariables = []
 
list PatchToCumulativeMap.outputFilePath = outputFilePaths[i]
 
tuple PatchToCumulativeMap.reclass = open(reclassRule, 'w')
 
tuple PatchToCumulativeMap.fig = plt.figure(figsize=(8, 6), dpi=80, tight_layout=True)
 
tuple PatchToCumulativeMap.ax = fig.add_subplot(111)
 
float PatchToCumulativeMap.min_val = 0.01
 
tuple PatchToCumulativeMap.x = np.linspace(min_val, max_val, num=len(variablesList[0]))
 
list PatchToCumulativeMap.data_plt = []
 
tuple PatchToCumulativeMap.tmp_ecdf = sm.distributions.ECDF(var)
 
string PatchToCumulativeMap.cdfFilepath_png = "%s.png"
 
string PatchToCumulativeMap.cdfFilepath_pdf = "%s.pdf"