Changeset 562 for trunk/UTIL
- Timestamp:
- Mar 6, 2012, 1:49:07 AM (13 years ago)
- Location:
- trunk/UTIL/PYTHON
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/myplot.py
r558 r562 684 684 dev = np.std(fieldcalc)*3.0 685 685 ### 686 if vmin is None: 687 zevmin = mean(fieldcalc) - dev 686 if vmin is None: zevmin = mean(fieldcalc) - dev 688 687 else: zevmin = vmin 689 688 ### … … 778 777 "W": "%.1f",\ 779 778 "WMAX_TH": "%.1f",\ 779 "WSTAR": "%.1f",\ 780 780 "QSURFICE": "%.0f",\ 781 781 "UM": "%.0f",\ … … 1080 1080 print "CHECK SHAPE: what_I_plot, x, y", what_I_plot.shape, x.shape, y.shape 1081 1081 if len(shape) == 1: 1082 if shape[0] != len(x): 1083 print "WARNING HERE !!!" 1084 x = y 1082 if shape[0] != len(x): print "WARNING: shape[0] != len(x). Correcting." ; what_I_plot = what_I_plot[0:len(x)] 1085 1083 elif len(shape) == 2: 1086 if shape[1] == len(y) and shape[0] == len(x) and shape[0] != shape[1]: 1087 what_I_plot = swapaxes(what_I_plot,0,1) 1088 print "INFO: swapaxes", what_I_plot.shape, shape 1084 if shape[1] == len(y) and shape[0] == len(x) and shape[0] != shape[1]: 1085 print "INFO: swapaxes: ",what_I_plot.shape,shape ; what_I_plot = swapaxes(what_I_plot,0,1) 1086 else: 1087 if shape[0] != len(y): print "WARNING: shape[0] != len(y). Correcting." ; what_I_plot = what_I_plot[0:len(y),:] 1088 elif shape[1] != len(x): print "WARNING: shape[1] != len(x). Correcting." ; what_I_plot = what_I_plot[:,0:len(x)] 1089 elif len(shape) == 3: 1090 if vertmode < 0: print "not supported. must check array dimensions at some point. not difficult to implement though." 1089 1091 return what_I_plot,x,y 1090 1092 -
trunk/UTIL/PYTHON/myscript.py
r518 r562 24 24 ### VERTICAL INTERPOLATION 25 25 parser.add_option('-l', '--level', action='store',dest='lvl', type="string", default="0", help='level / start,stop,step (-i 2: p,Pa)(-i 3,4: z,km) [0]') 26 parser.add_option('-i', '--interp', action='store',dest='itp', type="int", default=None, help='interpolation (2: p, 3: z-amr, 4:z-als )')26 parser.add_option('-i', '--interp', action='store',dest='itp', type="int", default=None, help='interpolation (2: p, 3: z-amr, 4:z-als, -1)') 27 27 parser.add_option('--intas', action='store',dest='intas', type="string", default=None, help='specify "mcs" or "tes" for gcm P interpolation grid') 28 28 parser.add_option('-N', '--no-api', action='store_true',dest='nocall', default=False, help='do not recreate api file') -
trunk/UTIL/PYTHON/planetoplot.py
r558 r562 196 196 ###### principle: calculate correct indices then repopulate slon and slat 197 197 if slon is not None or slat is not None: 198 if firstfile and save == 'png' and typefile == 'meso' : iwantawhereplot = nc #show a topo map with a cross on the chosen point199 else: iwantawhereplot = None #do not show anything, just select indices198 if firstfile and save == 'png' and typefile == 'meso' and "HGT" in varinfile: iwantawhereplot = nc #show a topo map with a cross on the chosen point 199 else: iwantawhereplot = None #do not show anything, just select indices 200 200 numlon = 1 ; numlat = 1 201 201 if slon is not None: numlon = slon.shape[0] … … 245 245 if vertmode is None: vertmode=0 246 246 if vertmode == 0: vert = np.arange(0,getattr(nc,vertdim),1) 247 elif vertmode == -1: vert = nc.variables["PHTOT"][0,:,0,0]/3.72 ; vert = np.array(vert[0:len(vert)-1]) #; print vert 247 248 else: vert = nc.variables["vert"][:] 248 249 #if firstfile: … … 398 399 if mapmode == 0: ### could this be moved inside imov loop ? 399 400 itime=indextime 400 if len(what_I_plot.shape) is 3: itime=[0]401 if len(what_I_plot.shape) is 3: itime=[0] 401 402 m = None ; x = None ; y = None 402 403 what_I_plot, x, y = define_axis(lon,lat,vert,time,indexlon,indexlat,indexvert,\ … … 431 432 elif len(what_I_plot.shape) == 1: 432 433 which = "unidim" 434 if what_I_plot.shape[-1] == 1: print "VALUE VALUE VALUE VALUE ::: ", what_I_plot[0] ; save = 'donothing' 433 435 ##### IMOV LOOP #### IMOV LOOP 434 436 while imov <= iend: … … 508 510 #200. ## or csmooth=stride 509 511 elif which == "contour": 510 zevminc, zevmaxc = calculate_bounds(what_I_plot_frame )512 zevminc, zevmaxc = calculate_bounds(what_I_plot_frame, vmin=min(what_I_plot_frame), vmax=max(what_I_plot_frame)) 511 513 zelevels = np.linspace(zevminc,zevmaxc,ticks/2) #20) 512 514 if var2 == 'HGT': zelevels = np.arange(-10000.,30000.,2000.) -
trunk/UTIL/PYTHON/pp.py
r507 r562 53 53 54 54 typefile = whatkindfile(Dataset(zefiles[0])) ; stralt = None 55 if typefile in ["meso" ,"mesoapi","mesoideal"]:55 if typefile in ["meso"]: 56 56 [lschar,zehour,zehourin] = getlschar ( zefiles[0] ) 57 57 if opt.var is None: opt.var = ["HGT"] ; opt.clb = "nobar" … … 90 90 ######################################################### 91 91 if opt.itp is not None: 92 if opt.itp > 0: 92 93 ##### 93 94 ##### MESOSCALE : written by AS 94 95 ##### 95 if typefile in ["meso" ,"mesoideal"]:96 if typefile in ["meso"]: 96 97 if zelevel == 0. and opt.itp == 4: zelevel = 0.010 97 98 ### winds or no winds
Note: See TracChangeset
for help on using the changeset viewer.