Changeset 197 for trunk/MESOSCALE/PLOT/PYTHON/scripts
- Timestamp:
- Jul 5, 2011, 8:56:29 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MESOSCALE/PLOT/PYTHON/scripts/winds.py
r195 r197 18 18 colorb=None,\ 19 19 winds=True,\ 20 addchar=None): 20 addchar=None, 21 interv=[0,1]): 21 22 22 23 #################################################################################################################### … … 75 76 else: [wlon,wlat] = simplinterv(lon2d,lat2d) 76 77 77 ################## 78 ### Get local time 79 if typefile in ['mesoapi','meso']: 80 ltst = int(getattr(nc, 'GMT') + 0.5*(wlon[0]+wlon[1])/15.) 81 #zetime = nc.variables['Times'][0] 82 #zetimestart = getattr(nc, 'START_DATE') 83 #zeday = int(zetime[8]+zetime[9]) - int(zetimestart[8]+zetimestart[9]) 84 #if zeday < 0: lschar="" ## might have crossed a month... fix soon 85 #else: lschar="_Ls"+str( int( sol2ls ( getattr( nc, 'JULDAY' ) + zeday ) ) ) 86 elif typefile in ['gcm']: 87 ltst = 0 78 ################### 79 #### Get local time 80 #if typefile in ['mesoapi','meso']: 81 # ltst = interv[0] 82 # #ltst = int(getattr(nc, 'GMT') + 0.5*(wlon[0]+wlon[1])/15.) 83 #elif typefile in ['gcm']: 84 # ltst = 0 88 85 89 86 ############################################################################## … … 185 182 for i in tabrange: 186 183 184 ### Which local time ? 185 ltst = ( interv[0] + 0.5*(wlon[0]+wlon[1])/15.) + i*interv[1] 186 ltst = int (ltst * 10) / 10. 187 ltst = ltst % 24 188 187 189 ### General plot settings 188 190 if numplot > 1: … … 193 195 ### If only one local time is requested (numplot < 0) 194 196 elif numplot <= 0: 195 if (ltst+i)%24+ numplot != 0: continue197 if ltst + numplot != 0: continue 196 198 else: found_lct = True 197 199 … … 226 228 227 229 ### Next subplot 228 plottitle = basename + "_LT"+str( (ltst+i)%24)230 plottitle = basename + "_LT"+str(ltst) 229 231 if addchar: plottitle = plottitle + addchar 230 232 ptitle( plottitle ) … … 287 289 zelevel = opt.nvert 288 290 stralt = None 289 lschar= getlschar ( zefile ) ## getlschar from wrfout (or simply return "" if another file)291 [lschar,zehour,zehourin] = getlschar ( zefile ) ## getlschar from wrfout (or simply return "" if another file) 290 292 291 293 ##################################################### … … 313 315 name = winds (zefile,int(zelevel),\ 314 316 proj=opt.proj,back=opt.back,target=opt.target,stride=opt.stride,var=opt.var,numplot=opt.numplot,colorb=opt.colorb,winds=opt.winds,\ 315 addchar=lschar )317 addchar=lschar,interv=[zehour,zehourin]) 316 318 317 319 #########################################################
Note: See TracChangeset
for help on using the changeset viewer.