本文整理汇总了Python中WhfLog.setData方法的典型用法代码示例。如果您正苦于以下问题:Python WhfLog.setData方法的具体用法?Python WhfLog.setData怎么用?Python WhfLog.setData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WhfLog
的用法示例。
在下文中一共展示了WhfLog.setData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _passthroughRap
# 需要导入模块: import WhfLog [as 别名]
# 或者: from WhfLog import setData [as 别名]
def _passthroughRap(self, parms):
""" Perform pass through of RAP data as if it were layered
NOTE: Add some error status catching for return
Parameters
----------
parms : Parms
parameters
"""
# lots of hardwires here
ymdh = self._issue.strftime("%Y%m%d%H")
path = ymdh + "/"
fname = self._valid.strftime("%Y%m%d%H%M") + ".LDASIN_DOMAIN1.nc"
fnameOut = self._valid.strftime("%Y%m%d%H%M") + ".LDASIN_DOMAIN1"
path += fname
WhfLog.setData('RAP')
WhfLog.info("LAYERING (Passthrough) %s ", path)
# if not there, create the directory to put the file into
fullPath = parms._layerDir + "/"
fullPath += ymdh
if not os.path.exists(fullPath):
os.makedirs(fullPath)
if not os.path.isdir(fullPath):
WhfLog.error("%s is not a directory", fullPath)
else:
# create copy command and do it
cmd = "cp " + parms._rapDir
cmd += "/" + path
cmd += " " + fullPath
cmd += "/"
cmd += fnameOut
WhfLog.info(cmd)
os.system(cmd)
WhfLog.info("LAYERING (Passthrough) %s complete", path)
WhfLog.setData('RAP/HRRR')
示例2: forceLayer
# 需要导入模块: import WhfLog [as 别名]
# 或者: from WhfLog import setData [as 别名]
def forceLayer(self, parms, config, itime):
""" Perform layering if state is partially ready enough
Parameters
----------
parms : Parms
Parameters
itime : datetime
Returns
-------
bool
True if layering was done, or had previously been done
"""
if (self._layered):
return True
self.setAvailability(parms, itime)
if (self._rap0 and self._rap3):
if (self._hrrr0 and self._hrrr3):
self._layered = True
if (self._mrms == True):
WhfLog.setData('RAP/HRRR/MRMS')
layer(parms, itime, self._step, "RAP_HRRR_MRMS", config)
else:
WhfLog.setData('RAP/HRRR')
layer(parms, itime, self._step, "RAP_HRRR", config)
WhfLog.setData('RAP/HRRR/MRMS')
else:
self._layered = True
WhfLog.setData('RAP')
layer(parms, itime, self._step, "RAP", config)
WhfLog.setData('RAP/HRRR/MRMS')
else:
self._layered = True
WhfLog.warning("WARNING, no layering of %s, step=-%d",
itime.strftime("%Y%m%d%h"), self._step)
return True
示例3: layerIfReady
# 需要导入模块: import WhfLog [as 别名]
# 或者: from WhfLog import setData [as 别名]
def layerIfReady(self, parms, config, itime):
""" Perform layering if state is fully ready
Parameters
----------
parms : Parms
Parameters
itime : datetime
Returns
-------
bool
True if layering was done, or had previously been done
"""
if (self._layered):
return True
self.setAvailability(parms, itime)
if (self._hrrr0 and self._rap0 and
self._hrrr3 and self._rap3 and self._mrms):
self._layered = True
WhfLog.setData('RAP/HRRR/MRMS')
layer(parms, itime, self._step, "RAP_HRRR_MRMS", config)
return True
return False