本文整理汇总了Python中WRCCUtils.compute_mon_day方法的典型用法代码示例。如果您正苦于以下问题:Python WRCCUtils.compute_mon_day方法的具体用法?Python WRCCUtils.compute_mon_day怎么用?Python WRCCUtils.compute_mon_day使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WRCCUtils
的用法示例。
在下文中一共展示了WRCCUtils.compute_mon_day方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: sods
# 需要导入模块: import WRCCUtils [as 别名]
# 或者: from WRCCUtils import compute_mon_day [as 别名]
#.........这里部分代码省略.........
context['skip_max_above'] = 'NO DAYS SKIPPED'
context['skip_min_below'] = 'NO DAYS SKIPPED'
context['trunc_high'] = 'NONE'
context['trunc_low'] = 'NONE'
if form2.cleaned_data['skip_days']:
skip_max_above = form2.cleaned_data['skip_days_with_max_above']
skip_min_below = form2.cleaned_data['skip_days_with_min_below']
app_args['skip_max_above'] = skip_max_above
app_args['skip_min_below'] = skip_min_below
context['skip_max_above'] = skip_max_above
context['skip_min_below'] = skip_min_below
if form2.cleaned_data['truncate']:
trunc_high = form2.cleaned_data['truncation_upper_limit']
trunc_low = form2.cleaned_data['truncation_lower_limit']
app_args['trunc_high'] = trunc_high
app_args['trunc_low'] = trunc_low
context['trunc_high'] = trunc_high
context['trunc_low'] = trunc_low
context['base_temp'] = base_temp
context['output_type'] = output_type
context['max_miss'] = max_miss
if form2.cleaned_data['output_type'] == 'm':
context['monthly'] = 'yes'
else:
context['daily'] = 'yes'
results = run_data_app(**app_args)
elif app_name == 'Sodpad':
app_args = {'app_name':app_name,'data':data,'dates':dates,'elements':elements,\
'station_ids':station_ids,'station_names':station_names}
results = run_data_app(**app_args)
mon_dict = {}
day_dict = {}
for doy in range(366):
mon, day = WRCCUtils.compute_mon_day(doy+1)
mon_dict[doy] = mon
day_dict[doy] = day
context['mon'] = mon_dict
context['day'] = day_dict
context['durations'] ={ 1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,10:10,11:12,12:14,13:15,14:16,15:18,16:20,17:22,18:24,19:25,20:26,21:28,22:30}
elif app_name == 'Sodsumm':
el_type = form2.cleaned_data['element']
app_args = {'app_name':app_name,'data':data,'dates':dates,'elements':elements,\
'ids':station_ids,'station_names':station_names,'el_type':el_type, 'max_missing_days':form2.cleaned_data['max_missing_days']}
results = run_data_app(**app_args)
context['max_missing_days'] = form2.cleaned_data['max_missing_days']
if el_type == 'temp':
table_list = ['temp']
elif el_type == 'prsn':
table_list = ['prsn']
elif el_type == 'both':
table_list = ['temp', 'prsn']
elif el_type == 'hc':
table_list = ['hdd', 'cdd']
elif el_type == 'g':
table_list = ['gdd', 'corn']
elif el_type == 'all':
table_list = ['temp', 'prsn', 'hdd', 'cdd', 'gdd', 'corn']
context['headers'] = set_sodsumm_headers(table_list)
elif app_name == 'Sodpct':
el_type = form2.cleaned_data['element']
if abs(form2.cleaned_data['threshold'] + 9999) < 0.05:
threshold = None
else:
threshold = form2.cleaned_data['threshold']
ia = form2.cleaned_data['individual_averages']
number_days_ahead = form2.cleaned_data['number_days_ahead']