当前位置: 首页>>代码示例>>Python>>正文


Python WhfLog.set方法代码示例

本文整理汇总了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
开发者ID:NCAR,项目名称:wrf_hydro_forcing,代码行数:36,代码来源:Regrid_Driver.py

示例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
开发者ID:NCAR,项目名称:wrf_hydro_forcing,代码行数:41,代码来源:AnalysisAssimLayeringDriver.py

示例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
开发者ID:NCAR,项目名称:wrf_hydro_forcing,代码行数:40,代码来源:ShortRangeLayeringDriver.py


注:本文中的WhfLog.set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。