- Timestamp:
- Mar 12, 2019, 2:56:41 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/generic_tools.py
r2401 r2403 14825 14825 availper = ['year', 'season', 'month', 'day', 'hour', 'minute', 'aggseason', \ 14826 14826 'aggmonth', 'aggday', 'agghour'] 14827 availagg = ['season', 'month', 'day', 'hour', 'minute'] 14827 14828 14828 14829 if not searchInlist(availper, per): … … 15068 15069 Lper=len(per) 15069 15070 pern = per[3:Lper+1] 15071 if pern == 'season': 15072 aggvals = np.arange(4) 15073 elif pern == 'month': 15074 aggvals = np.arange(12)+1 15075 elif pern == 'day': 15076 aggvals = np.arange(365)+1 15077 elif pern == 'hour': 15078 aggvals = np.arange(24) 15079 elif pern == 'minute': 15080 aggvals = np.arange(60) 15081 else: 15082 print errormsg 15083 print ' ' + fname + ": aggregation over '" + pern+ "' not ready !!" 15084 print ' avaialble ones:', availagg 15085 quit(-1) 15086 15070 15087 vtemp_desc = temp_desc[pern] 15071 15088 vvtdesc = list(vtemp_desc.keys()) … … 15073 15090 15074 15091 Nslices = len(vtemp_desc) 15092 Naggv = aggvals.shape[0] 15075 15093 slices = [] 15076 for islc in range(Nslices): 15077 vvtemp_desc = vtemp_desc[vvtdesc[islc]] 15078 Ltt = len(vvtemp_desc) 15079 slices.append(vvtemp_desc) 15080 15094 for iagg in range(Naggv): 15095 iaggv = aggvals[iagg] 15096 found = False 15097 for islc in range(Nslices): 15098 if vvtdesc[islc] == iaggv: 15099 vvtemp_desc = vtemp_desc[vvtdesc[islc]] 15100 slices.append(vvtemp_desc) 15101 found = True 15102 break 15103 if not found: slices.append(None) 15104 Nslices = Naggv + 0 15081 15105 else: 15082 15106 Nslices = len(stmatdates.keys())
Note: See TracChangeset
for help on using the changeset viewer.