本文整理匯總了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']