RHESSysWorkflows  1.33
Namespaces | Variables
CreateWorldfile.py File Reference

Namespaces

 CreateWorldfile
 Create RHESSys worldfile.
 

Variables

tuple CreateWorldfile.parser = argparse.ArgumentParser(description='Create RHESSys worldfile using GRASS GIS data and grass2world utility')
 
string CreateWorldfile.help = 'The configuration file. Must define section "GRASS" and option "GISBASE"'
 
tuple CreateWorldfile.args = parser.parse_args()
 
tuple CreateWorldfile.cmdline = RHESSysMetadata.getCommandLine()
 
 CreateWorldfile.configFile = None
 
tuple CreateWorldfile.context = Context(args.projectDir, configFile)
 
tuple CreateWorldfile.grassMetadata = RHESSysMetadata.readGRASSEntries(context)
 
tuple CreateWorldfile.metadata = RHESSysMetadata.readRHESSysEntries(context)
 
list CreateWorldfile.rhessysDir = metadata['rhessys_dir']
 
tuple CreateWorldfile.paths = RHESSysPaths(args.projectDir, rhessysDir)
 
tuple CreateWorldfile.modulePath = context.config.get('GRASS', 'MODULE_PATH')
 
tuple CreateWorldfile.grassDbase = os.path.join(context.projectDir, metadata['grass_dbase'])
 
tuple CreateWorldfile.grassConfig = GRASSConfig(context, grassDbase, metadata['grass_location'], metadata['grass_mapset'])
 
tuple CreateWorldfile.grassLib = GRASSLib(grassConfig=grassConfig)
 
list CreateWorldfile.demRast = grassMetadata['dem_rast']
 Run grass2world Make sure mask and region are properly set. More...
 
tuple CreateWorldfile.result = grassLib.script.run_command('g.region', rast=demRast)
 
list CreateWorldfile.basinRast = grassMetadata['basin_rast']
 
tuple CreateWorldfile.templateFilename = os.path.basename( metadata['template'] )
 
tuple CreateWorldfile.templateFilepath = os.path.join( context.projectDir, metadata['template'] )
 
string CreateWorldfile.worldfileName = "%s_init"
 
tuple CreateWorldfile.worldfilePath = os.path.join(paths.RHESSYS_WORLD, worldfileName)
 
tuple CreateWorldfile.g2wPath = os.path.join(context.projectDir, metadata['g2w_bin'])
 
string CreateWorldfile.g2wCommand = "%s -t %s -w %s"
 
tuple CreateWorldfile.g2wEnv = dict(os.environ)
 
tuple CreateWorldfile.cmdArgs = g2wCommand.split()
 
tuple CreateWorldfile.process