Changeset 188 for trunk/MESOSCALE/PLOT/PYTHON
- Timestamp:
- Jul 3, 2011, 2:51:54 PM (14 years ago)
- Location:
- trunk/MESOSCALE/PLOT/PYTHON
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MESOSCALE/PLOT/PYTHON/mylib/myplot.py
r187 r188 165 165 u = smooth(u,csmooth) 166 166 v = smooth(v,csmooth) 167 widthvec = 0.00 5 #0.003167 widthvec = 0.003 #0.005 #0.003 168 168 q = plt.quiver( x[::stride,::stride],\ 169 169 y[::stride,::stride],\ -
trunk/MESOSCALE/PLOT/PYTHON/scripts/winds.py
r187 r188 16 16 numplot=4,\ 17 17 var=None,\ 18 colorb=None): 18 colorb=None): 19 19 20 20 ################################# … … 47 47 ## pb avec les autres (de trace derriere la sphere ?) 48 48 49 #################################################################### 50 #### For mesoscale results plot the underlying topography by default 51 if typefile in ['mesoapi','meso']: 52 if var == None: back="mola" #var = 'HGT' 49 ############################################ 50 #### Choose underlying topography by default 51 if not back: 52 if not var: back = "mola" ## if no var: draw mola 53 elif typefile in ['mesoapi','meso'] \ 54 and proj not in ['merc','lcc']: back = "molabw" ## if var but meso: draw molabw 55 else: pass ## else: draw None 53 56 54 57 #################################################### … … 100 103 if var: 101 104 basename = basename + "_" + var 102 basename = basename + "_z" + str(nvert) 105 if typefile is 'meso': stralt = "_lvl" + str(nvert) 106 elif typefile is 'mesoapi': 107 zelevel = int(nc.variables['vert'][nvert]) 108 if 'altitude_abg' in nc.dimensions: stralt = "_"+str(zelevel)+"m-ALS" 109 elif 'bottom_top' in nc.dimensions: stralt = "_"+str(zelevel)+"m-AMR" 110 elif 'pressure' in nc.dimensions: stralt = "_"+str(zelevel)+"Pa" 111 else: stralt = "" 112 basename = basename + stralt 103 113 104 114 ################################## … … 158 168 elif numplot == 1: 159 169 found_lct = True 160 ### If only one local time is requested (numplot < 0)170 ### If only one local time is requested (numplot < 0) 161 171 elif numplot <= 0: 162 #print (ltst+i)%24, numplot, (ltst+i)%24+numplot163 172 if (ltst+i)%24 + numplot != 0: continue 164 173 else: found_lct = True … … 185 194 key = False 186 195 if metwind: [vecx,vecy] = m.rotate_vector(vecx, vecy, lon2d, lat2d) 196 if var == None and back == "vishires": colorvec = 'w' 197 else: colorvec = 'k' 187 198 vectorfield(vecx, vecy,\ 188 199 x, y, stride=stride, csmooth=stride,\ 189 scale=15., factor= 200., color='k', key=key)190 200 scale=15., factor=300., color=colorvec, key=key) 201 #200. ## or csmooth=2 191 202 192 203 ### Next subplot … … 226 237 from api_wrapper import api_onelevel 227 238 parser = OptionParser() 228 parser.add_option('-f', action='store', dest='namefile', type="string", default=None, help=' name of WRF file [NEEDED]')229 parser.add_option('-l', action='store', dest='nvert', type="float", default=0, help='vertical level (def=0) ')239 parser.add_option('-f', action='store', dest='namefile', type="string", default=None, help='[NEEDED] name of WRF file') 240 parser.add_option('-l', action='store', dest='nvert', type="float", default=0, help='vertical level (def=0)(-i 2: p,mbar)(-i 3,4: z,km)') 230 241 parser.add_option('-p', action='store', dest='proj', type="string", default=None, help='projection') 231 242 parser.add_option('-b', action='store', dest='back', type="string", default=None, help='background') … … 234 245 parser.add_option('-v', action='store', dest='var', type="string", default=None, help='variable contoured') 235 246 parser.add_option('-n', action='store', dest='numplot', type="int", default=4, help='number of plots (def=1)(<0: 1 plot of LT -*numplot*)') 236 parser.add_option('-i', action='store', dest='interp', type="int", default=None, help='interpolation method ( done at level *nvert* km)')247 parser.add_option('-i', action='store', dest='interp', type="int", default=None, help='interpolation method (2: press, 3: z-amr, 4:z-als)') 237 248 parser.add_option('-c', action='store', dest='colorb', type="string", default=None, help='colorbar') 238 249 (opt,args) = parser.parse_args() … … 244 255 zefile = opt.namefile 245 256 zelevel = opt.nvert 257 stralt = None 246 258 if opt.interp is not None: 247 259 if opt.nvert is 0 and opt.interp is 4: zelevel = 0.010 … … 254 266 interp_method = opt.interp, \ 255 267 onelevel = zelevel ) 256 zelevel = 0 257 258 winds (zefile,int(zelevel),proj=opt.proj,back=opt.back,target=opt.target,stride=opt.stride,var=opt.var,numplot=opt.numplot,colorb=opt.colorb) 268 zelevel = 0 ## so that zelevel could play again the role of nvert 269 270 winds (zefile,int(zelevel),\ 271 proj=opt.proj,back=opt.back,target=opt.target,stride=opt.stride,var=opt.var,numplot=opt.numplot,colorb=opt.colorb)
Note: See TracChangeset
for help on using the changeset viewer.