Changeset 610 for trunk/UTIL/PYTHON/planetoplot.py
- Timestamp:
- Mar 31, 2012, 7:33:41 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.