本文整理汇总了Python中WhfLog.set方法的典型用法代码示例。如果您正苦于以下问题:Python WhfLog.set方法的具体用法?Python WhfLog.set怎么用?Python WhfLog.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WhfLog
的用法示例。
在下文中一共展示了WhfLog.set方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: parmRead
# 需要导入模块: import WhfLog [as 别名]
# 或者: from WhfLog import set [as 别名]
def parmRead(fname, fileType, realtime):
"""Read in the main config file, return needed parameters
Parameters
----------
fname: str
name of parameter file to read in
fileType: str
'RAP', 'HRRR', 'MRMS', 'GFS'
realtime: boolean
True if realtime, False for archive mode
Returns
-------
Parms
values as pulled from the file
"""
parser = SafeConfigParser()
parser.read(fname)
label = 'Regrid' + fileType
if (realtime):
WhfLog.init(parser, label, False)
else:
WhfLog.set(label)
dataDir = parser.get('data_dir', fileType + '_data')
maxFcstHour = int(parser.get('fcsthr_max', fileType + '_fcsthr_max'))
hoursBack = int(parser.get('triggering', fileType + '_hours_back'))
stateFile = parser.get('triggering', fileType + '_regrid_state_file')
parms = Parms(dataDir, maxFcstHour, hoursBack, stateFile)
return parms
示例2: parmRead
# 需要导入模块: import WhfLog [as 别名]
# 或者: from WhfLog import set [as 别名]
def parmRead(fname, realtime):
""" Read in a param file
Parameters
---------
fname : str
Name of the file to read
Returns
-------
Parms
The parameters that were read in
"""
parser = SafeConfigParser()
parser.read(fname)
forcing_config_label = "AnalysisAssimLayeringDriver"
if (realtime):
WhfLog.init(parser, 'AaLayer', False)
else:
WhfLog.set('AaLayer')
hrrrDir = parser.get('downscaling', 'HRRR_finished_output_dir')
hrrr0hrDir = parser.get('downscaling', 'HRRR_finished_output_dir_0hr') # placeholder
mrmsDir = parser.get('regridding', 'MRMS_finished_output_dir') # maybe incorrect
rapDir = parser.get('downscaling', 'RAP_finished_output_dir')
rap0hrDir = parser.get('downscaling', 'RAP_finished_output_dir_0hr') # placeholder
layerDir = parser.get('layering', 'analysis_assimilation_output')
maxFcstHour = 3
hoursBack = 5 # 3 hours back at 0, -1, and -2 (-2 -3 = -5)
veryLateMinutes= int(parser.get('triggering', 'analysis_assim_very_late_minutes'))
stateFile = parser.get('triggering', 'analysis_assim_layering_state_file')
parms = Parms(hrrrDir, hrrr0hrDir, rapDir, rap0hrDir, mrmsDir, layerDir,
maxFcstHour, hoursBack, veryLateMinutes, stateFile)
return parms
示例3: parmRead
# 需要导入模块: import WhfLog [as 别名]
# 或者: from WhfLog import set [as 别名]
def parmRead(fname, realtime):
""" Read in a param file
Parameters
---------
fname : str
Name of the file to read
realtime: boolean
True if realtime, False for archive mode
Returns
-------
Parms
The parameters that were read in
"""
parser = SafeConfigParser()
parser.read(fname)
if (realtime):
WhfLog.init(parser, 'ShortLayer', False)
else:
WhfLog.set('ShortLayer')
hrrrDir = parser.get('downscaling', 'HRRR_finished_output_dir')
rapDir = parser.get('downscaling', 'RAP_finished_output_dir')
layerDir = parser.get('layering', 'short_range_output')
maxFcstHour = int(parser.get('fcsthr_max', 'HRRR_fcsthr_max'))
# go with HRRR
hoursBack = int(parser.get('triggering', 'HRRR_hours_back'))
maxWaitMinutes=int(parser.get('triggering',
'short_range_fcst_max_wait_minutes'))
veryLateMinutes=int(parser.get('triggering',
'short_range_fcst_very_late_minutes'))
stateFile = parser.get('triggering', 'short_range_layering_state_file')
parms = Parms(hrrrDir, rapDir, layerDir, maxFcstHour, hoursBack,
maxWaitMinutes, veryLateMinutes, stateFile)
return parms