Changeset 2227 in lmdz_wrf for trunk/tools
- Timestamp:
- Nov 12, 2018, 4:57:00 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/generic_tools.py
r2226 r2227 14045 14045 return within 14046 14046 14047 def time_slices(tv, tu, cal, per, amount ):14047 def time_slices(tv, tu, cal, per, amount, temp_desc): 14048 14048 """ Function to return temporal slices of a series of times for a given amount 14049 14049 of periods … … 14064 14064 yy1/mm1/dd1 [00,...,23]:00:00 - yym/mmm/ddm [00,...,23]:59:59 14065 14065 amount: amount of periods 14066 temp_desc: disctionary with the description of the time_steps (from 14067 `temporal_desc' function)) 14066 14068 """ 14067 14069 import datetime as dt … … 14203 14205 14204 14206 elif per == 'aggmonth': 14207 if temp_desc is None: 14208 print errormsg 14209 print ' ' + fname + ": For '" + per + "' temporal description is required" 14210 quit(-1) 14211 14205 14212 amount = 1 14206 14213 # Arranging accordingly beginning/ending statistics periods … … 14336 14343 amount = 1 14337 14344 14338 #tslc, Ntslc = time_slices(tv, tu, calend, per, amount) 14345 tdes = temporal_desc(tv, tu, calend) 14346 14347 tslc, Ntslc = time_slices(tv, tu, calend, per, amount) 14339 14348 14340 14349 #statn = 'mean' … … 14956 14965 temporal_desc[timesec]=tvsec 14957 14966 14958 printing_dictionary(temporal_desc)14967 #printing_dictionary(temporal_desc) 14959 14968 14960 14969 return temporal_desc 14961 14970 14962 14963 tv = []14964 values = []14965 totT = 24.*60.14966 dT = 20027.34514967 for it in range(0,30):14968 tv.append(29*24*60.+dT*it)14969 print 29*24*60.+dT*it14970 #values.append((it*3+itt)*1.)14971 values.append(it*1.)14972 14973 #print 'tv:', tv14974 #print 'values:', values14975 14976 vals = np.array(values)14977 itdim = 014978 tu = 'minutes since 1949-12-01 00:00:00'14979 per = 'day'14980 calend = 'standard'14981 amount = 114982 14983 temporal_desc(tv, tu, calend)14984 14985 14971 #quit() 14986 14972
Note: See TracChangeset
for help on using the changeset viewer.