Changeset 932 for trunk/UTIL
- Timestamp:
- Apr 16, 2013, 3:06:48 PM (12 years ago)
- Location:
- trunk/UTIL/PYTHON/planetoplot_v2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/planetoplot_v2/ppclass.py
r931 r932 508 508 mz = findmethod(sz) ; mt = findmethod(st) 509 509 # get number of plots to be done 510 if mx == "fixed": self.nplotx = sx.size/2511 else: self.nplotx = 1512 if my == "fixed": self.nploty = sy.size/2513 else: self.nploty = 1514 if mz == "fixed": self.nplotz = sz.size/2515 else: self.nplotz = 1516 if mt == "fixed": self.nplott = st.size/2517 else: self.nplott = 1510 if mx in ["fixed","comp"]: self.nplotx = sx.size/2 511 else: self.nplotx = 1 512 if my in ["fixed","comp"]: self.nploty = sy.size/2 513 else: self.nploty = 1 514 if mz in ["fixed","comp"]: self.nplotz = sz.size/2 515 else: self.nplotz = 1 516 if mt in ["fixed","comp"]: self.nplott = st.size/2 517 else: self.nplott = 1 518 518 if self.verbose: print "**** OK. Plots over x,y,z,t -->",self.nplotx,self.nploty,self.nplotz,self.nplott 519 519 # create the list of onerequest() objects … … 1362 1362 else: 1363 1363 print "!! ERROR !! field would have more than four dimensions ?" ; exit() 1364 # dirty hack (AS) ref1_dirty_hack 1365 # waiting for more fundamental modifications. case when self.index_y is a bool array. 1366 # ... be careful if no point... 1367 if type(self.index_x[0]) == np.bool_: nx = np.sum(self.index_x) ## gives the size of the True part! 1368 if type(self.index_y[0]) == np.bool_: ny = np.sum(self.index_y) ## gives the size of the True part! 1364 1369 # NB: ... always 4D array but possibly with "size 1" dimensions 1365 1370 # ... if one dimension is missing because 1D 2D or 3D requests, make it appear again 1366 try: 1367 self.field = np.reshape(self.field,(nt,nz,ny,nx)) 1368 except: 1369 # dirty hack (AS) ref1_dirty_hack 1370 # waiting for more fundamental modifications. case when self.index_y is a bool array. 1371 # ... be careful if no point... 1372 nx = np.sum(self.index_x) ## gives the size of the True part! 1373 ny = np.sum(self.index_y) 1374 self.field = np.reshape(self.field,(nt,nz,ny,nx)) 1371 self.field = np.reshape(self.field,(nt,nz,ny,nx)) 1375 1372 if self.verbose: print "**** OK. I got %7.1e values. This took me %6.4f seconds" % (nx*ny*nz*nt,timelib.time() - time0) 1376 1373 if self.verbose: print "**** OK. I got var "+self.var+" with shape",self.field.shape -
trunk/UTIL/PYTHON/planetoplot_v2/ppplot.py
r930 r932 602 602 # (this actually serves for the default setting just above) 603 603 if self.proj == "spstere" and self.blat > 0: self.blat = -self.blat 604 # labels 605 mertab = np.r_[-360.:360.:15.] 606 partab = np.r_[-90.:90.:5.] 604 607 # ... unsupported projections 605 608 else: … … 614 617 # draw meridians and parallels 615 618 ft = int(mpl.rcParams['font.size']*3./4.) 616 m.drawmeridians(mertab,labels=merlab,color='grey',linewidth=0.75,fontsize=ft,fmt=format) 617 m.drawparallels(partab,labels=parlab,color='grey',linewidth=0.75,fontsize=ft,fmt=format) 619 zelatmax = 85. 620 m.drawmeridians(mertab,labels=merlab,color='grey',linewidth=0.75,fontsize=ft,fmt=format,latmax=zelatmax) 621 m.drawparallels(partab,labels=parlab,color='grey',linewidth=0.75,fontsize=ft,fmt=format,latmax=zelatmax) 618 622 # define background (see set_back.txt) 619 623 if self.back is not None: … … 653 657 stride = 3 654 658 if self.addvecx is not None and self.addvecy is not None and self.mapmode: 655 ## for metwinds only ???659 ### for metwinds only ??? 656 660 [vecx,vecy] = m.rotate_vector(self.addvecx,self.addvecy,self.absc,self.ordi) 661 #vecx,vecy = self.addvecx,self.addvecy 657 662 # reference vector is scaled 658 663 zescale = ppcompute.mean(np.sqrt(self.addvecx*self.addvecx+self.addvecy*self.addvecy))
Note: See TracChangeset
for help on using the changeset viewer.