Changeset 610 for trunk/UTIL
- Timestamp:
- Mar 31, 2012, 7:33:41 PM (13 years ago)
- Location:
- trunk/UTIL/PYTHON
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/myplot.py
r587 r610 288 288 subv = 2 289 289 subh = 2 290 fig.subplots_adjust(wspace = 0. 3, hspace = 0.3)290 fig.subplots_adjust(wspace = 0.4, hspace = 0.3) 291 291 rcParams['font.size'] = int( rcParams['font.size'] * 2. / 3. ) 292 292 elif numplot <= 6: -
trunk/UTIL/PYTHON/myscript.py
r569 r610 38 38 parser.add_option('--xlabel', action='store',dest='xlab', type="string", default=None, help='customize the x-axis label') 39 39 parser.add_option('--ylabel', action='store',dest='ylab', type="string", default=None, help='customize the y-axis label') 40 parser.add_option('--labels', action='store',dest='labels', type="string", default=None, help='customize 1D curve labels. Str ing separated by commas. [None]')40 parser.add_option('--labels', action='store',dest='labels', type="string", default=None, help='customize 1D curve labels. Str comma-separated. [None]') 41 41 42 42 ### SPECIFIC FOR MAPPING [MAPMODE 1] -
trunk/UTIL/PYTHON/planetoplot.py
r608 r610 173 173 ########################################################## 174 174 if typefile in ["gcm","earthgcm","ecmwf"]: 175 if slon is not None: sslon = slon ## a fix of the sslon not initialized. but what is the use of sslon?176 if slat is not None: sslat = slat ## a fix of the sslat not initialized. but what is the use of sslat?175 if slon is not None: sslon = slon 176 if slat is not None: sslat = slat 177 177 ### LAT 178 178 if "latitude" in nc.variables: lat = nc.variables["latitude"][:] … … 208 208 else: iwantawhereplot = None #do not show anything, just select indices 209 209 numlon = 1 ; numlat = 1 210 if slon is not None: numlon = slon.shape[ 0]211 if slat is not None: numlat = slat.shape[ 0]210 if slon is not None: numlon = slon.shape[1] 211 if slat is not None: numlat = slat.shape[1] 212 212 indices = np.ones([numlon,numlat,2]) ; vlon = None ; vlat = None 213 213 for iii in range(numlon): 214 214 for jjj in range(numlat): 215 if slon is not None: vlon = slon[ iii][0] ### note: slon[:][0] does not work216 if slat is not None: vlat = slat[ jjj][0] ### note: slon[:][0] does not work215 if slon is not None: vlon = slon[0][iii] ### note: slon[:][0] does not work 216 if slat is not None: vlat = slat[0][jjj] ### note: slon[:][0] does not work 217 217 indices[iii,jjj,:] = bidimfind(lon2d,lat2d,vlon,vlat,file=iwantawhereplot) 218 218 lonp,latp = ( lon2d[indices[iii,jjj,0],indices[iii,jjj,1]] , lat2d[indices[iii,jjj,0],indices[iii,jjj,1]] ) … … 220 220 for iii in range(numlon): 221 221 for jjj in range(numlat): 222 if slon is not None: sslon[ iii][0] = indices[iii,0,1] ; sslon[iii][1] = indices[iii,0,1]#...this is idx223 if slat is not None: sslat[ jjj][0] = indices[0,jjj,0] ; sslat[jjj][1] = indices[0,jjj,0]#...this is idy222 if slon is not None: sslon[0][iii] = indices[iii,0,1] #...this is idx 223 if slat is not None: sslat[0][jjj] = indices[0,jjj,0] #...this is idy 224 224 lonp,latp = ( lon2d[indices[0,0,0],indices[0,0,1]] , lat2d[indices[0,0,0],indices[0,0,1]] ) 225 225 ###### … … 262 262 if vertmode == 0: vert = np.arange(0,getattr(nc,vertdim),1) 263 263 elif vertmode == -1: vert = nc.variables["PHTOT"][0,:,0,0]/3.72 ; vert = np.array(vert[0:len(vert)-1]) #; print vert 264 else: vert = nc.variables["vert"][:] 264 elif vertmode == 1 or vertmode == 2: vert = nc.variables["vert"][:] ## pressure in Pa 265 else: vert = nc.variables["vert"][:]/1000. ## altitude in km 265 266 #if firstfile: 266 267 # lat0 = lat -
trunk/UTIL/PYTHON/pp.py
r578 r610 79 79 zelevel = float(inputnvert[0]) 80 80 ze_interp_levels = [-9999.] 81 elif np.array(inputnvert).size ==2:81 elif np.array(inputnvert).size > 2: 82 82 zelevel = -99. 83 ze_interp_levels = np.linspace(float(inputnvert[0]),float(inputnvert[1]),20) 84 else: 85 zelevel = -99. 86 ze_interp_levels = np.linspace(float(inputnvert[0]),float(inputnvert[1]),float(inputnvert[2])) 83 start = float(inputnvert[0]) 84 stop = float(inputnvert[1]) 85 if np.array(inputnvert).size == 2: numsample = 20 86 else: numsample = float(inputnvert[2]) 87 if stop > start: 88 ## altitude coordinates 89 ze_interp_levels = np.linspace(start,stop,numsample) 90 else: 91 ## pressure coordinates 92 ze_interp_levels = np.logspace(np.log10(start),np.log10(stop),numsample) 87 93 88 94 #########################################################
Note: See TracChangeset
for help on using the changeset viewer.