本文整理汇总了Python中TauDEMUtils.TauDEMUtils类的典型用法代码示例。如果您正苦于以下问题:Python TauDEMUtils类的具体用法?Python TauDEMUtils怎么用?Python TauDEMUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TauDEMUtils类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: processAlgorithm
def processAlgorithm(self, progress):
commands = []
commands.append(os.path.join(TauDEMUtils.mpiexecPath(), 'mpiexec'))
processNum = ProcessingConfig.getSetting(TauDEMUtils.MPI_PROCESSES)
if processNum <= 0:
raise GeoAlgorithmExecutionException(
self.tr('Wrong number of MPI processes used. Please set '
'correct number before running TauDEM algorithms.'))
commands.append('-n')
commands.append(str(processNum))
commands.append(os.path.join(TauDEMUtils.taudemPath(), self.cmdName))
commands.append('-ad8')
commands.append(self.getParameterValue(self.D8_CONTRIB_AREA_GRID))
commands.append('-p')
commands.append(self.getParameterValue(self.D8_FLOW_DIR_GRID))
commands.append('-fel')
commands.append(self.getParameterValue(self.PIT_FILLED_GRID))
commands.append('-ssa')
commands.append(self.getParameterValue(self.ACCUM_STREAM_SOURCE_GRID))
commands.append('-o')
commands.append(self.getParameterValue(self.OUTLETS_SHAPE))
commands.append('-par')
commands.append(str(self.getParameterValue(self.MIN_TRESHOLD)))
commands.append(str(self.getParameterValue(self.MAX_THRESHOLD)))
commands.append(str(self.getParameterValue(self.TRESHOLD_NUM)))
commands.append(str(self.getParameterValue(self.STEPS)))
commands.append('-drp')
commands.append(self.getOutputValue(self.DROP_ANALYSIS_FILE))
TauDEMUtils.executeTauDEM(commands, progress)
示例2: processAlgorithm
def processAlgorithm(self, progress):
commands = []
commands.append(os.path.join(TauDEMUtils.mpiexecPath(), 'mpiexec'))
processNum = ProcessingConfig.getSetting(TauDEMUtils.MPI_PROCESSES)
if processNum <= 0:
raise GeoAlgorithmExecutionException(
self.tr('Wrong number of MPI processes used. Please set '
'correct number before running TauDEM algorithms.'))
commands.append('-n')
commands.append(str(processNum))
commands.append(os.path.join(TauDEMUtils.taudemPath(), self.cmdName))
commands.append('-p')
commands.append(self.getParameterValue(self.D8_FLOW_DIR_GRID))
param = self.getParameterValue(self.OUTLETS_SHAPE)
if param is not None:
commands.append('-o')
commands.append(param)
param = self.getParameterValue(self.MASK_GRID)
if param is not None:
commands.append('-mask')
commands.append(param)
commands.append('-thresh')
commands.append(self.getParameterValue(self.THRESHOLD))
commands.append('-plen')
commands.append(self.getOutputValue(self.LONGEST_LEN_GRID))
commands.append('-tlen')
commands.append(self.getOutputValue(self.TOTAL_LEN_GRID))
commands.append('-gord')
commands.append(self.getOutputValue(self.STRAHLER_GRID))
TauDEMUtils.executeTauDEM(commands, progress)
示例3: processAlgorithm
def processAlgorithm(self, progress):
commands = []
commands.append(os.path.join(TauDEMUtils.mpiexecPath(), 'mpiexec'))
processNum = ProcessingConfig.getSetting(TauDEMUtils.MPI_PROCESSES)
if processNum <= 0:
raise GeoAlgorithmExecutionException(
self.tr('Wrong number of MPI processes used. Please set '
'correct number before running TauDEM algorithms.'))
commands.append('-n')
commands.append(unicode(processNum))
commands.append(os.path.join(TauDEMUtils.taudemPath(), self.cmdName))
commands.append('-ang')
commands.append(self.getParameterValue(self.DINF_FLOW_DIR_GRID))
commands.append('-fel')
commands.append(self.getParameterValue(self.PIT_FILLED_GRID))
commands.append('-m')
commands.append(unicode(self.STAT_DICT[self.getParameterValue(
self.STAT_METHOD)]))
commands.append(unicode(self.DIST_DICT[self.getParameterValue(
self.DIST_METHOD)]))
commands.append('-thresh')
commands.append(unicode(self.getParameterValue(self.THRESHOLD)))
if not self.getParameterValue(self.EDGE_CONTAM):
commands.append('-nc')
commands.append('-du')
commands.append(self.getOutputValue(self.DIST_UP_GRID))
TauDEMUtils.executeTauDEM(commands, progress)
示例4: processAlgorithm
def processAlgorithm(self, progress):
commands = []
commands.append(os.path.join(TauDEMUtils.mpiexecPath(), 'mpiexec'))
processNum = ProcessingConfig.getSetting(TauDEMUtils.MPI_PROCESSES)
if processNum <= 0:
raise GeoAlgorithmExecutionException(
self.tr('Wrong number of MPI processes used. Please set '
'correct number before running TauDEM algorithms.'))
commands.append('-n')
commands.append(str(processNum))
commands.append(os.path.join(TauDEMUtils.taudemMultifilePath(), self.cmdName))
commands.append('-ang')
commands.append(self.getParameterValue(self.DINF_FLOW_DIR_GRID))
commands.append('-fel')
commands.append(self.getParameterValue(self.PIT_FILLED_GRID))
commands.append('-src')
commands.append(self.getParameterValue(self.STREAM_GRID))
wg = self.getParameterValue(self.WEIGHT_PATH_GRID)
if wg is not None:
commands.append('-wg')
commands.append(self.getParameterValue(self.WEIGHT_PATH_GRID))
commands.append('-m')
commands.append(str(self.STAT_DICT[self.getParameterValue(
self.STAT_METHOD)]))
commands.append(str(self.DIST_DICT[self.getParameterValue(
self.DIST_METHOD)]))
if not self.getParameterValue(self.EDGE_CONTAM):
commands.append('-nc')
commands.append('-dd')
commands.append(self.getOutputValue(self.DIST_DOWN_GRID))
TauDEMUtils.executeTauDEM(commands, progress)
示例5: processAlgorithm
def processAlgorithm(self, progress):
commands = []
commands.append(os.path.join(TauDEMUtils.mpiexecPath(), 'mpiexec'))
processNum = ProcessingConfig.getSetting(TauDEMUtils.MPI_PROCESSES)
if processNum <= 0:
raise GeoAlgorithmExecutionException('Wrong number of MPI \
processes used.\nPlease set correct number before running \
TauDEM algorithms.')
commands.append('-n')
commands.append(str(processNum))
commands.append(os.path.join(TauDEMUtils.taudemPath(), self.cmdName))
commands.append('-slp')
commands.append(self.getParameterValue(self.SLOPE_GRID))
commands.append('-sca')
commands.append(self.getParameterValue(self.AREA_GRID))
commands.append('-par')
commands.append(str(self.getParameterValue(self.SLOPE_EXPONENT)))
commands.append(str(self.getParameterValue(self.AREA_EXPONENT)))
commands.append('-sa')
commands.append(self.getOutputValue(self.SLOPE_AREA_GRID))
loglines = []
loglines.append('TauDEM execution command')
for line in commands:
loglines.append(line)
ProcessingLog.addToLog(ProcessingLog.LOG_INFO, loglines)
TauDEMUtils.executeTauDEM(commands, progress)
示例6: processAlgorithm
def processAlgorithm(self, progress):
commands = []
commands.append(os.path.join(TauDEMUtils.mpiexecPath(), 'mpiexec'))
processNum = ProcessingConfig.getSetting(TauDEMUtils.MPI_PROCESSES)
if processNum <= 0:
raise GeoAlgorithmExecutionException(
self.tr('Wrong number of MPI processes used. Please set '
'correct number before running TauDEM algorithms.'))
commands.append('-n')
commands.append(str(processNum))
commands.append(os.path.join(TauDEMUtils.taudemMultifilePath(), self.cmdName))
commands.append('-ang')
commands.append(self.getParameterValue(self.DINF_FLOW_DIR_GRID))
commands.append('-tsup')
commands.append(self.getParameterValue(self.SUPPLY_GRID))
commands.append('-tc')
commands.append(self.getParameterValue(self.CAPACITY_GRID))
param = self.getParameterValue(self.OUTLETS_SHAPE)
if param is not None:
commands.append('-o')
commands.append(param)
if not self.getParameterValue(self.EDGE_CONTAM):
commands.append('-nc')
commands.append('-tla')
commands.append(self.getOutputValue(self.TRANSP_LIM_ACCUM_GRID))
commands.append('-tdep')
commands.append(self.getOutputValue(self.DEPOSITION_GRID))
TauDEMUtils.executeTauDEM(commands, progress)
示例7: processAlgorithm
def processAlgorithm(self, progress):
commands = []
commands.append(os.path.join(TauDEMUtils.mpiexecPath(), 'mpiexec'))
processNum = int(ProcessingConfig.getSetting(TauDEMUtils.MPI_PROCESSES))
if processNum <= 0:
raise GeoAlgorithmExecutionException(
self.tr('Wrong number of MPI processes used. Please set '
'correct number before running TauDEM algorithms.'))
commands.append('-n')
commands.append(str(processNum))
commands.append(os.path.join(TauDEMUtils.taudemPath(), self.cmdName))
for param in self.parameters:
if param.value is None or param.value == '':
continue
if isinstance(param, ParameterNumber):
commands.append(param.name)
commands.append(str(param.value))
if isinstance(param, (ParameterRaster, ParameterVector)):
commands.append(param.name)
commands.append(param.value)
elif isinstance(param, ParameterBoolean):
if not param.value:
commands.append(param.name)
elif isinstance(param, ParameterString):
commands.append(param.name)
commands.append(str(param.value))
for out in self.outputs:
commands.append(out.name)
commands.append(out.value)
TauDEMUtils.executeTauDEM(commands, progress)
示例8: initializeSettings
def initializeSettings(self):
AlgorithmProvider.initializeSettings(self)
ProcessingConfig.addSetting(Setting(self.getDescription(),
TauDEMUtils.TAUDEM_FOLDER,
self.tr('TauDEM command line tools folder'),
TauDEMUtils.taudemPath()))
ProcessingConfig.addSetting(Setting(self.getDescription(),
TauDEMUtils.MPIEXEC_FOLDER,
self.tr('MPICH2/OpenMPI bin directory'),
TauDEMUtils.mpiexecPath()))
ProcessingConfig.addSetting(Setting(self.getDescription(),
TauDEMUtils.MPI_PROCESSES,
self.tr('Number of MPI parallel processes to use'), 2))
示例9: initializeSettings
def initializeSettings(self):
AlgorithmProvider.initializeSettings(self)
ProcessingConfig.addSetting(
Setting(
self.getDescription(),
TauDEMUtils.TAUDEM_FOLDER,
self.tr("TauDEM command line tools folder"),
TauDEMUtils.taudemPath(),
)
)
ProcessingConfig.addSetting(
Setting(
self.getDescription(),
TauDEMUtils.TAUDEM_MULTIFILE_FOLDER,
self.tr("TauDEM multifile command line tools folder"),
TauDEMUtils.taudemMultifilePath(),
)
)
ProcessingConfig.addSetting(
Setting(
self.getDescription(),
TauDEMUtils.TAUDEM_USE_SINGLEFILE,
self.tr("Enable singlefile TauDEM tools"),
True,
)
)
ProcessingConfig.addSetting(
Setting(
self.getDescription(), TauDEMUtils.TAUDEM_USE_MULTIFILE, self.tr("Enable multifile TauDEM tools"), False
)
)
ProcessingConfig.addSetting(
Setting(
self.getDescription(),
TauDEMUtils.MPIEXEC_FOLDER,
self.tr("MPICH2/OpenMPI bin directory"),
TauDEMUtils.mpiexecPath(),
)
)
ProcessingConfig.addSetting(
Setting(
self.getDescription(), TauDEMUtils.MPI_PROCESSES, self.tr("Number of MPI parallel processes to use"), 2
)
)
示例10: processAlgorithm
def processAlgorithm(self, progress):
commands = []
commands.append(os.path.join(TauDEMUtils.mpiexecPath(), "mpiexec"))
processNum = ProcessingConfig.getSetting(TauDEMUtils.MPI_PROCESSES)
if processNum <= 0:
raise GeoAlgorithmExecutionException(
"Wrong number of MPI \
processes used.\nPlease set correct number before running \
TauDEM algorithms."
)
commands.append("-n")
commands.append(str(processNum))
commands.append(os.path.join(TauDEMUtils.taudemPath(), self.cmdName))
commands.append("-p")
commands.append(self.getParameterValue(self.D8_FLOW_DIR_GRID))
param = self.getParameterValue(self.OUTLETS_SHAPE)
if param is not None:
commands.append("-o")
commands.append(param)
param = self.getParameterValue(self.MASK_GRID)
if param is not None:
commands.append("-mask")
commands.append(param)
commands.append("-thresh")
commands.append(self.getParameterValue(self.THRESHOLD))
commands.append("-plen")
commands.append(self.getOutputValue(self.LONGEST_LEN_GRID))
commands.append("-tlen")
commands.append(self.getOutputValue(self.TOTAL_LEN_GRID))
commands.append("-gord")
commands.append(self.getOutputValue(self.STRAHLER_GRID))
loglines = []
loglines.append("TauDEM execution command")
for line in commands:
loglines.append(line)
ProcessingLog.addToLog(ProcessingLog.LOG_INFO, loglines)
TauDEMUtils.executeTauDEM(commands, progress)
示例11: processAlgorithm
def processAlgorithm(self, progress):
commands = []
commands.append(os.path.join(TauDEMUtils.mpiexecPath(), 'mpiexec'))
processNum = ProcessingConfig.getSetting(TauDEMUtils.MPI_PROCESSES)
if processNum <= 0:
raise GeoAlgorithmExecutionException('Wrong number of MPI \
processes used.\nPlease set correct number before running \
TauDEM algorithms.')
commands.append('-n')
commands.append(str(processNum))
commands.append(os.path.join(TauDEMUtils.taudemPath(), self.cmdName))
commands.append('-ang')
commands.append(self.getParameterValue(self.DINF_FLOW_DIR_GRID))
commands.append('-tsup')
commands.append(self.getParameterValue(self.SUPPLY_GRID))
commands.append('-tc')
commands.append(self.getParameterValue(self.CAPACITY_GRID))
commands.append('-cs')
commands.append(self.getParameterValue(self.IN_CONCENTR_GRID))
param = self.getParameterValue(self.OUTLETS_SHAPE)
if param is not None:
commands.append('-o')
commands.append(param)
if str(self.getParameterValue(self.EDGE_CONTAM)).lower() == 'false':
commands.append('-nc')
commands.append('-tla')
commands.append(self.getOutputValue(self.TRANSP_LIM_ACCUM_GRID))
commands.append('-tdep')
commands.append(self.getOutputValue(self.DEPOSITION_GRID))
commands.append('-ctpt')
commands.append(self.getOutputValue(self.OUT_CONCENTR_GRID))
loglines = []
loglines.append('TauDEM execution command')
for line in commands:
loglines.append(line)
ProcessingLog.addToLog(ProcessingLog.LOG_INFO, loglines)
TauDEMUtils.executeTauDEM(commands, progress)
示例12: processAlgorithm
def processAlgorithm(self, progress):
commands = []
commands.append(os.path.join(TauDEMUtils.mpiexecPath(), 'mpiexec'))
processNum = int(ProcessingConfig.getSetting(TauDEMUtils.MPI_PROCESSES))
if processNum <= 0:
raise GeoAlgorithmExecutionException('Wrong number of MPI \
processes used.\nPlease set correct number before running \
TauDEM algorithms.'
)
commands.append('-n')
commands.append(str(processNum))
commands.append(os.path.join(TauDEMUtils.taudemPath(), self.cmdName))
for param in self.parameters:
if param.value is None or param.value == '':
continue
if isinstance(param, ParameterNumber):
commands.append(param.name)
commands.append(str(param.value))
if isinstance(param, (ParameterRaster, ParameterVector)):
commands.append(param.name)
commands.append(param.value)
elif isinstance(param, ParameterBoolean):
if param.value and str(param.value).lower() == 'false':
commands.append(param.name)
elif isinstance(param, ParameterString):
commands.append(param.name)
commands.append(str(param.value))
for out in self.outputs:
commands.append(out.name)
commands.append(out.value)
loglines = []
loglines.append('TauDEM execution command')
for line in commands:
loglines.append(line)
ProcessingLog.addToLog(ProcessingLog.LOG_INFO, loglines)
TauDEMUtils.executeTauDEM(commands, progress)
示例13: processAlgorithm
def processAlgorithm(self, progress):
commands = []
commands.append(os.path.join(TauDEMUtils.mpiexecPath(), 'mpiexec'))
processNum = ProcessingConfig.getSetting(TauDEMUtils.MPI_PROCESSES)
if processNum <= 0:
raise GeoAlgorithmExecutionException('Wrong number of MPI \
processes used.\nPlease set correct number before running \
TauDEM algorithms.')
commands.append('-n')
commands.append(str(processNum))
commands.append(os.path.join(TauDEMUtils.taudemPath(), self.cmdName))
commands.append('-ang')
commands.append(self.getParameterValue(self.DINF_FLOW_DIR_GRID))
commands.append('-fel')
commands.append(self.getParameterValue(self.PIT_FILLED_GRID))
commands.append('-src')
commands.append(self.getParameterValue(self.STREAM_GRID))
wg = self.getParameterValue(self.WEIGHT_PATH_GRID)
if wg is not None:
commands.append('-wg')
commands.append(self.getParameterValue(self.WEIGHT_PATH_GRID))
commands.append('-m')
commands.append(str(self.STAT_DICT[self.getParameterValue(
self.STAT_METHOD)]))
commands.append(str(self.DIST_DICT[self.getParameterValue(
self.DIST_METHOD)]))
if str(self.getParameterValue(self.EDGE_CONTAM)).lower() == 'false':
commands.append('-nc')
commands.append('-dd')
commands.append(self.getOutputValue(self.DIST_DOWN_GRID))
loglines = []
loglines.append('TauDEM execution command')
for line in commands:
loglines.append(line)
ProcessingLog.addToLog(ProcessingLog.LOG_INFO, loglines)
TauDEMUtils.executeTauDEM(commands, progress)
示例14: processAlgorithm
def processAlgorithm(self, progress):
commands = []
commands.append(os.path.join(TauDEMUtils.mpiexecPath(), 'mpiexec'))
processNum = ProcessingConfig.getSetting(TauDEMUtils.MPI_PROCESSES)
if processNum <= 0:
raise GeoAlgorithmExecutionException(
self.tr('Wrong number of MPI processes used. Please set '
'correct number before running TauDEM algorithms.'))
commands.append('-n')
commands.append(str(processNum))
commands.append(os.path.join(TauDEMUtils.taudemMultifilePath(), self.cmdName))
commands.append('-fel')
commands.append(self.getParameterValue(self.ELEVATION_GRID))
commands.append('-par')
commands.append(str(self.getParameterValue(self.CENTER_WEIGHT)))
commands.append(str(self.getParameterValue(self.SIDE_WEIGHT)))
commands.append(str(self.getParameterValue(self.DIAGONAL_WEIGHT)))
commands.append('-ss')
commands.append(self.getOutputValue(self.STREAM_SOURCE_GRID))
TauDEMUtils.executeTauDEM(commands, progress)
示例15: processAlgorithm
def processAlgorithm(self, progress):
commands = []
commands.append(os.path.join(TauDEMUtils.mpiexecPath(), 'mpiexec'))
processNum = ProcessingConfig.getSetting(TauDEMUtils.MPI_PROCESSES)
if processNum <= 0:
raise GeoAlgorithmExecutionException(
self.tr('Wrong number of MPI processes used. Please set '
'correct number before running TauDEM algorithms.'))
commands.append('-n')
commands.append(str(processNum))
commands.append(os.path.join(TauDEMUtils.taudemPath(), self.cmdName))
commands.append('-plen')
commands.append(self.getParameterValue(self.LENGTH_GRID))
commands.append('-ad8')
commands.append(self.getParameterValue(self.CONTRIB_AREA_GRID))
commands.append('-par')
commands.append(str(self.getParameterValue(self.THRESHOLD)))
commands.append(str(self.getParameterValue(self.EXPONENT)))
commands.append('-ss')
commands.append(self.getOutputValue(self.STREAM_SOURCE_GRID))
TauDEMUtils.executeTauDEM(commands, progress)