- Timestamp:
- Mar 11, 2019, 4:20:14 PM (6 years ago)
- Location:
- trunk/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/drawing_tools.py
r2374 r2392 2393 2393 Srefdate = txtunits[Ntxtunits - 2] 2394 2394 2395 # Looking for too short date 2396 if len(Srefdate) == 8: 2397 # Assuming Y-m[1 digit]-d[1 digit] 2398 if Srefdate.count('-') == 2: 2399 vals=Srefdate.split('-') 2400 Srefdate='' 2401 Srefdate = vals[0] + '-' + vals[1].zfill(2) + '-' + vals[2].zfill(2) 2402 elif Srefdate.count('/') == 2: 2403 vals=Srefdate.split('/') 2404 Srefdate='' 2405 Srefdate = vals[0] + '/' + vals[1].zfill(2) + '/' + vals[2].zfill(2) 2406 else: 2407 print errormsg 2408 print ' ' + fname + ": I do not know how to deal with this '"+ Srefdate+\ 2409 "' date !!" 2410 quit(-1) 2411 2395 2412 if not trefT == -1: 2396 2413 # print ' ' + fname + ': refdate with time!' -
trunk/tools/nc_var_tools.py
r2384 r2392 26115 26115 26116 26116 Lperiodn = {'year': 'yearly', 'month': 'monthly', 'day': 'daily', \ 26117 'LTday': 'local-time daily', 'hour': 'hourly', 'minute': 'minutely'} 26117 'LTday': 'local-time daily', 'hour': 'hourly', 'minute': 'minutely', \ 26118 'aggseason': 'seasonal aggregation'} 26118 26119 Lstatn = {'min': 'minimum', 'max': 'maximum', 'mean': 'mean', \ 26119 26120 'mean2': 'quadratic mean', 'std': 'standard deviation', \ … … 26453 26454 tvals = ovar[tuple(timeslc)] 26454 26455 else: 26455 newshape = list( vals.shape)26456 aggslc = tslc [islc]26456 newshape = list(ovar.shape) 26457 aggslc = tslcs[islc] 26457 26458 NNtslc = len(aggslc) 26458 26459 newshape[itdim] = NNtslc 26459 tvals = np.zeros(tuple(newshape), dtype= vals.dtype)26460 origshape = list( vals.shape)26461 iishape = list( vals.shape)26460 tvals = np.zeros(tuple(newshape), dtype=ovar.dtype) 26461 origshape = list(ovar.shape) 26462 iishape = list(ovar.shape) 26462 26463 for iislc in range(NNtslc): 26463 26464 origshape[itdim] = aggslc[iislc] 26464 26465 iishape[itdim] = iislc 26465 tvals[tuple(iishape)] = vals[tuple(origshape)]26466 tvals[tuple(iishape)] = ovar[tuple(origshape)] 26466 26467 26467 26468 if statn == 'min':
Note: See TracChangeset
for help on using the changeset viewer.