當前位置: 首頁>>代碼示例>>Python>>正文


Python WRCCUtils.set_start_end_window方法代碼示例

本文整理匯總了Python中WRCCUtils.set_start_end_window方法的典型用法代碼示例。如果您正苦於以下問題:Python WRCCUtils.set_start_end_window方法的具體用法?Python WRCCUtils.set_start_end_window怎麽用?Python WRCCUtils.set_start_end_window使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WRCCUtils的用法示例。


在下文中一共展示了WRCCUtils.set_start_end_window方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: set_initial

# 需要導入模塊: import WRCCUtils [as 別名]
# 或者: from WRCCUtils import set_start_end_window [as 別名]

#.........這裏部分代碼省略.........
        if app_name == 'seasonal_summary':
            initial['min_year'] = Get('min_year',sd[0:4])
            initial['max_year'] = Get('max_year', ed[0:4])
            initial['end_month']  = Get('end_month', '1')
            initial['end_day']  = Get('end_day', '31')
        if app_name in ['intraannual']:
            if initial['start_year'].lower() != 'por':
                initial['min_year'] = initial['start_year']
            else:
                initial['min_year'] = Get('min_year',sd[0:4])
            if initial['end_year'].lower() != 'por':
                initial['max_year'] = initial['end_year']
            else:
                initial['max_year'] = Get('max_year', ed[0:4])
            #Plotting vars
            initial['show_climatology'] = Get('show_climatology','F')
            initial['show_percentile_5'] = Get('show_percentile_5','F')
            initial['show_percentile_10'] = Get('show_percentile_10','F')
            initial['show_percentile_25'] = Get('show_percentile_25','F')
            initial['target_year'] = Get('target_year_figure', None)
            if initial['target_year'] is None:
                initial['target_year'] = Get('target_year_form',initial['min_year'])
            if initial['element'] in ['pcpn','snow','evap','pet']:
                initial['calculation'] = Get('calculation','cumulative')
            else:
                initial['calculation'] = Get('calculation','values')
    else:
        initial['start_date']  = Get('start_date', WRCCUtils.format_date_string(fourtnight,'-'))
        initial['end_date']  = Get('end_date', WRCCUtils.format_date_string(yesterday,'-'))
    #data windows and flags
    sw = '01-01'; ew = '01-31'
    if 'start_date' in initial.keys() and 'end_date' in initial.keys():
        if initial['start_date'] and initial['end_date']:
            sw, ew = WRCCUtils.set_start_end_window(initial['start_date'],initial['end_date'])
    if app_name in ['single_lister', 'multi_lister','map_overlay']:
        initial['start_window'] = Get('start_window', sw)
        initial['end_window'] = Get('end_window',ew)
        initial['temporal_resolution'] = Get('temporal_resolution','dly')
        initial['show_flags'] = Get('show_flags', 'F')
        initial['show_observation_time'] = Get('show_observation_time', 'F')
    if app_name in ['station_finder']:
        initial['start_window'] = Get('start_window', sw)
        initial['end_window'] = Get('end_window',ew)
    #data summaries
    if app_name in  ['monthly_spatial_summary','temporal_summary', 'seasonal_summary']:
        initial['data_summary'] = Get('data_summary', 'temporal_summary')
    elif app_name in ['spatial_summary','multi_lister','map_overlay']:
        initial['data_summary'] = Get('data_summary', 'spatial_summary')
    else:
        initial['data_summary'] = Get('data_summary', 'none')

    if app_name in ['temporal_summary', 'monthly_spatial_summary','seasonal_summary', 'sf_download']:
        if 'element' in initial.keys() and initial['element'] in ['pcpn','snow','evap','pet']:
            initial['temporal_summary'] = Get('temporal_summary', 'sum')
        else:
            initial['temporal_summary'] = Get('temporal_summary', 'mean')
    else:
        initial['temporal_summary'] = Get('temporal_summary', 'mean')
    if app_name in ['single_lister', 'multi_lister','spatial_summary','sf_download','map_overlay']:
        initial['spatial_summary'] = Get('spatial_summary', 'mean')

    #download options
    if app_name in ['single_lister','multi_lister']:
        initial['data_format'] = Get('data_format', 'html')
    else:
        initial['data_format'] = Get('data_format', 'xl')
開發者ID:,項目名稱:,代碼行數:70,代碼來源:


注:本文中的WRCCUtils.set_start_end_window方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。