Changeset 982 for trunk/UTIL
- Timestamp:
- Jun 7, 2013, 3:23:01 PM (12 years ago)
- Location:
- trunk/UTIL/PYTHON/planetoplot_v2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/planetoplot_v2/examples/vector.py
r923 r982 9 9 u.z = "50000" 10 10 u.filename = "vector" 11 u.get() 12 u.defineplot() 13 #u.p[0].proj = "ortho" 14 #u.p[0].blat = -45. 15 u.makeplot() 11 12 # stride both x and y 13 # this impacts field + vector 14 u.stridex = 3 15 u.stridey = 3 16 u.getplot() 17 u.stridex = 1 # (reinitialise) 18 u.stridey = 1 # (reinitialise) 19 20 # stride vectors only 21 # not field (here topography) 22 u.stridevecx = 3 23 u.stridevecy = 3 24 u.getplot() 25 16 26 17 27 -
trunk/UTIL/PYTHON/planetoplot_v2/pp.py
r981 r982 92 92 parser.add_option('-M','--vmax',action='append',dest='vmax',type="float",default=None,help='[2D] float: maximum value for displayed field') 93 93 parser.add_option('-W','--wscale',action='append',dest='wscale',type="float",default=None,help='[2D] float: set size of reference wind vector') 94 parser.add_option('--stridevecx',action='store',dest='stridevecx',type="int",default=1,help="Define an abscissa stride on vectors only -- not on field") 95 parser.add_option('--stridevecy',action='store',dest='stridevecy',type="int",default=1,help="Define an ordinate stride on vectors only -- not on field") 96 ########################### 94 97 (opt,args) = parser.parse_args() 95 98 # remains F G R … … 133 136 user.stridez = opt.stridez 134 137 user.stridet = opt.stridet 138 user.stridevecx = opt.stridevecx 139 user.stridevecy = opt.stridevecy 135 140 # define field 136 141 user.define() -
trunk/UTIL/PYTHON/planetoplot_v2/ppclass.py
r981 r982 135 135 stridex=1,stridey=1,\ 136 136 stridez=1,stridet=1,\ 137 stridevecx=1,\ 138 stridevecy=1,\ 137 139 compute="mean",\ 138 140 verbose=False,\ … … 182 184 self.stridex = stridex ; self.stridey = stridey 183 185 self.stridez = stridez ; self.stridet = stridet 186 self.stridevecx = stridevecx 187 self.stridevecy = stridevecy 184 188 self.compute = compute 185 189 self.verbose = verbose … … 799 803 if self.vmin is not None: plobj.vmin = self.vmin 800 804 if self.vmax is not None: plobj.vmax = self.vmax 805 plobj.stridevecx = self.stridevecx 806 plobj.stridevecy = self.stridevecy 801 807 # finally append plot object 802 808 self.p.append(plobj) -
trunk/UTIL/PYTHON/planetoplot_v2/ppplot.py
r981 r982 513 513 showcb=True,\ 514 514 wscale=None,\ 515 stridevecx=1,\ 516 stridevecy=1,\ 515 517 colorvec="black"): 516 518 ## get initialization from parent class … … 531 533 self.showcb = showcb 532 534 self.wscale = wscale 535 self.stridevecx = stridevecx 536 self.stridevecy = stridevecy 533 537 534 538 # define_from_var … … 729 733 ############################################################################################ 730 734 ### not expecting NaN in self.addvecx and self.addvecy. masked arrays is just enough. 731 stride = 3732 stride = 1 ## no need to stride. done with data. except if you want to stride wind and not field TBD.733 735 if self.addvecx is not None and self.addvecy is not None: 736 # vectors on map projection or simple 2D mapping 734 737 if self.mapmode: [vecx,vecy] = m.rotate_vector(self.addvecx,self.addvecy,self.absc,self.ordi) # for metwinds only ? 735 738 else: vecx,vecy = self.addvecx,self.addvecy ; x,y = np.meshgrid(x,y) … … 738 741 # make vector field 739 742 if self.mapmode: 740 q = m.quiver( x[::s tride,::stride],y[::stride,::stride],\741 vecx[::s tride,::stride],vecy[::stride,::stride],\743 q = m.quiver( x[::self.stridevecy,::self.stridevecx],y[::self.stridevecy,::self.stridevecx],\ 744 vecx[::self.stridevecy,::self.stridevecx],vecy[::self.stridevecy,::self.stridevecx],\ 742 745 angles='xy',color=self.colorvec,pivot='tail',\ 743 746 scale=self.wscale*reducevec,width=widthvec ) 744 747 else: 745 q = mpl.quiver( x[::s tride,::stride],y[::stride,::stride],\746 vecx[::s tride,::stride],vecy[::stride,::stride],\748 q = mpl.quiver( x[::self.stridevecy,::self.stridevecx],y[::self.stridevecy,::self.stridevecx],\ 749 vecx[::self.stridevecy,::self.stridevecx],vecy[::self.stridevecy,::self.stridevecx],\ 747 750 angles='xy',color=self.colorvec,pivot='tail',\ 748 751 scale=self.wscale*reducevec,width=widthvec )
Note: See TracChangeset
for help on using the changeset viewer.