Changeset 197
- Timestamp:
- Jul 5, 2011, 8:56:29 AM (14 years ago)
- Location:
- trunk/MESOSCALE/PLOT/PYTHON
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MESOSCALE/PLOT/PYTHON/mylib/myplot.py
r195 r197 50 50 if zeday < 0: lschar="" ## might have crossed a month... fix soon 51 51 else: lschar="_Ls"+str( int( sol2ls ( getattr( nc, 'JULDAY' ) + zeday ) ) ) 52 ### 53 zetime2 = nc.variables['Times'][1] 54 one = int(zetime[11]+zetime[12]) + int(zetime[14]+zetime[15])/37. 55 next = int(zetime2[11]+zetime2[12]) + int(zetime2[14]+zetime2[15])/37. 56 zehour = one 57 zehourin = abs ( next - one ) 52 58 else: 53 59 lschar="" 54 return lschar 60 zehour = 0 61 zehourin = 1 62 return lschar, zehour, zehourin 55 63 56 64 def api_onelevel ( path_to_input = None, \ -
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.