Changeset 195 for trunk/MESOSCALE/PLOT/PYTHON
- Timestamp:
- Jul 5, 2011, 12:08:27 AM (14 years ago)
- Location:
- trunk/MESOSCALE/PLOT/PYTHON
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MESOSCALE/PLOT/PYTHON/mylib/api_g95.sh
r194 r195 9 9 \rm loge 10 10 f2py -c -m api ../../../LMD_MM_MARS/SRC/POSTPROC/api.F90 --fcompiler=g95 -L$NETCDF/lib -lnetcdf -lm -I$NETCDF/include --f90flags="-Wall -Wno=112,141,137,155 -fno-second-underscore -ffree-form" > logc 2> loge 11 f2py -c -m timestuff time.F --fcompiler=g95 11 f2py -c -m timestuff time.F --fcompiler=g95 >> logc 2>> loge -
trunk/MESOSCALE/PLOT/PYTHON/mylib/api_pgf90.sh
r194 r195 13 13 \rm loge 14 14 f2py -c -m api ../../../LMD_MM_MARS/SRC/POSTPROC/api.F90 --fcompiler=pg -L$NETCDF/lib -lnetcdf -lm -I$NETCDF/include --f90flags="-Mfree" > logc 2> loge 15 f2py -c -m timestuff time.F --fcompiler=pg 15 f2py -c -m timestuff time.F --fcompiler=pg >> logc 2>> loge -
trunk/MESOSCALE/PLOT/PYTHON/mylib/myplot.py
r194 r195 39 39 # return 40 40 41 def getlschar ( namefile ): 42 #### strangely enough this does not work for api or ncrcat results! 43 from netCDF4 import Dataset 44 from timestuff import sol2ls 45 nc = Dataset(namefile) 46 if 'Times' in nc.variables: 47 zetime = nc.variables['Times'][0] 48 zetimestart = getattr(nc, 'START_DATE') 49 zeday = int(zetime[8]+zetime[9]) - int(zetimestart[8]+zetimestart[9]) 50 if zeday < 0: lschar="" ## might have crossed a month... fix soon 51 else: lschar="_Ls"+str( int( sol2ls ( getattr( nc, 'JULDAY' ) + zeday ) ) ) 52 else: 53 lschar="" 54 return lschar 55 41 56 def api_onelevel ( path_to_input = None, \ 42 57 input_name = 'wrfout_d0?_????-??-??_??:00:00', \ -
trunk/MESOSCALE/PLOT/PYTHON/scripts/winds.py
r194 r195 17 17 var=None,\ 18 18 colorb=None,\ 19 winds=True): 19 winds=True,\ 20 addchar=None): 20 21 21 22 #################################################################################################################### … … 29 30 from matplotlib.pyplot import contourf, subplot, figure, rcParams, savefig, colorbar 30 31 from matplotlib.cm import get_cmap 31 from timestuff import sol2ls32 32 import numpy as np 33 33 … … 75 75 else: [wlon,wlat] = simplinterv(lon2d,lat2d) 76 76 77 ################## #######78 ### Get local time and Ls77 ################## 78 ### Get local time 79 79 if typefile in ['mesoapi','meso']: 80 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 soon85 else: lschar="_Ls"+str( int( sol2ls ( getattr( nc, 'JULDAY' ) + zeday ) ) )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 86 elif typefile in ['gcm']: 87 87 ltst = 0 88 lschar = ""89 88 90 89 ############################################################################## … … 227 226 228 227 ### Next subplot 229 ptitle( basename + "_LT"+str((ltst+i)%24) + lschar ) 228 plottitle = basename + "_LT"+str((ltst+i)%24) 229 if addchar: plottitle = plottitle + addchar 230 ptitle( plottitle ) 230 231 sub += 1 231 232 … … 261 262 from optparse import OptionParser ### to be replaced by argparse 262 263 from api_wrapper import api_onelevel 264 from netCDF4 import Dataset 265 from myplot import getlschar 263 266 264 267 ############################# … … 284 287 zelevel = opt.nvert 285 288 stralt = None 289 lschar = getlschar ( zefile ) ## getlschar from wrfout (or simply return "" if another file) 286 290 287 291 ##################################################### … … 308 312 ### Main call 309 313 name = winds (zefile,int(zelevel),\ 310 proj=opt.proj,back=opt.back,target=opt.target,stride=opt.stride,var=opt.var,numplot=opt.numplot,colorb=opt.colorb,winds=opt.winds) 314 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) 311 316 312 317 #########################################################
Note: See TracChangeset
for help on using the changeset viewer.