Changeset 207 for trunk/MESOSCALE_DEV/PLOT/PYTHON/scripts/winds.py
- Timestamp:
- Jul 12, 2011, 11:51:13 AM (13 years ago)
- Location:
- trunk/MESOSCALE_DEV
- Files:
-
- 1 added
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/MESOSCALE_DEV/PLOT/PYTHON/scripts/winds.py
r204 r207 71 71 if not var: back = "mola" ## if no var: draw mola 72 72 elif typefile in ['mesoapi','meso'] \ 73 and proj not in ['merc','lcc' ]:back = "molabw" ## if var but meso: draw molabw73 and proj not in ['merc','lcc','nsper','laea']: back = "molabw" ## if var but meso: draw molabw 74 74 else: pass ## else: draw None 75 75 … … 82 82 elif typefile in ['gcm']: 83 83 [lon2d,lat2d] = getcoord2d(nc,nlat="latitude",nlon="longitude",is1d=True) 84 if proj == "npstere": [wlon,wlat] = latinterv("North_Pole")85 elif proj == "lcc": [wlon,wlat] = wrfinterv(lon2d,lat2d)86 else: [wlon,wlat] = simplinterv(lon2d,lat2d)84 if proj == "npstere": [wlon,wlat] = latinterv("North_Pole") 85 elif proj in ["lcc","laea"]: [wlon,wlat] = wrfinterv(lon2d,lat2d) 86 else: [wlon,wlat] = simplinterv(lon2d,lat2d) 87 87 if zoom: 88 88 dlon = abs(wlon[1]-wlon[0])/2. … … 125 125 ### some already defined colormaps 126 126 if colorb is True: colorb = defcolorb(var) 127 else: 128 dimension = 0 127 129 128 130 ########################### … … 139 141 if var: basename = basename + var 140 142 ### 141 if typefile is 'meso': stralt = "_lvl" + str(nvert) 142 elif typefile is 'mesoapi': 143 zelevel = int(nc.variables['vert'][nvert]) 144 if 'altitude' in nc.dimensions: stralt = "_"+str(zelevel)+"m-AMR" 145 elif 'altitude_abg' in nc.dimensions: stralt = "_"+str(zelevel)+"m-ALS" 146 elif 'bottom_top' in nc.dimensions: stralt = "_"+str(zelevel)+"m" 147 elif 'pressure' in nc.dimensions: stralt = "_"+str(zelevel)+"Pa" 148 else: stralt = "" 143 if dimension == 4: 144 if typefile is 'meso': stralt = "_lvl" + str(nvert) 145 elif typefile is 'mesoapi': 146 zelevel = int(nc.variables['vert'][nvert]) 147 if 'altitude' in nc.dimensions: stralt = "_"+str(zelevel)+"m-AMR" 148 elif 'altitude_abg' in nc.dimensions: stralt = "_"+str(zelevel)+"m-ALS" 149 elif 'bottom_top' in nc.dimensions: stralt = "_"+str(zelevel)+"m" 150 elif 'pressure' in nc.dimensions: stralt = "_"+str(zelevel)+"Pa" 151 else: stralt = "" 152 else: 153 stralt = "" 149 154 ### 150 155 basename = basename + stralt … … 175 180 rcParams['font.size'] = int( rcParams['font.size'] * 1. / 2. ) 176 181 elif numplot == 9: 177 sub = 331 182 sub = 331 178 183 fig.subplots_adjust(wspace = 0.3, hspace = 0.3) 179 184 rcParams['font.size'] = int( rcParams['font.size'] * 1. / 2. ) … … 181 186 sub = 99999 182 187 else: 183 print "supported: 1,2,3,4,6,8 "188 print "supported: 1,2,3,4,6,8,9" 184 189 exit() 185 190 ### Prepare time loop … … 306 311 parser.add_option('-i', action='store', dest='interp', type="int", default=None, help='interpolation method (2: press, 3: z-amr, 4:z-als)') 307 312 parser.add_option('-c', action='store', dest='colorb', type="string", default=True, help='change colormap') 308 parser.add_option('-x', action='store_false', dest='winds', default=True, help=' flag:no wind vectors')313 parser.add_option('-x', action='store_false', dest='winds', default=True, help='no wind vectors') 309 314 parser.add_option('-m', action='store', dest='vmin', type="float", default=None, help='bounding minimum value for color plot') 310 315 parser.add_option('-M', action='store', dest='vmax', type="float", default=None, help='bounding maximum value for color plot') 311 316 parser.add_option('-T', action='store_true', dest='tile', default=False, help='draw a tiled plot (no blank zone)') 312 317 parser.add_option('-z', action='store', dest='zoom', type="float", default=None, help='zoom factor in %') 318 parser.add_option('-N', action='store_true', dest='nocall', default=False, help='do not recreate api file') 313 319 #parser.add_option('-V', action='store', dest='comb', type="float", default=None, help='a defined combination of variables') 314 320 (opt,args) = parser.parse_args() … … 339 345 fields = zefields, \ 340 346 interp_method = opt.interp, \ 341 onelevel = zelevel ) 347 onelevel = zelevel, \ 348 nocall = opt.nocall ) 349 print zefile 342 350 zelevel = 0 ## so that zelevel could play again the role of nvert 343 351
Note: See TracChangeset
for help on using the changeset viewer.