Changeset 2375 for trunk/python
- Timestamp:
- 12/19/11 19:40:37 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asapgrid.py
r2373 r2375 42 42 self.outfile = self.gridder._save( outfile ) 43 43 44 def plot( self, plotchan=-1, plotpol=-1 ):44 def plot( self, plotchan=-1, plotpol=-1, plotobs=False, plotgrid=False ): 45 45 import time 46 46 t0=time.time() … … 49 49 rcParams['scantable.storage'] = 'disk' 50 50 plotter = _SDGridPlotter( self.infile, self.outfile, self.ifno ) 51 plotter.plot( chan=plotchan, pol=plotpol )51 plotter.plot( chan=plotchan, pol=plotpol, plotobs=plotobs, plotgrid=plotgrid ) 52 52 # back to original setup 53 53 rcParams['scantable.storage'] = storg … … 123 123 #print 'cellx,celly=',self.cellx,self.celly 124 124 125 def plot( self, chan=-1, pol=-1 ):125 def plot( self, chan=-1, pol=-1, plotobs=False, plotgrid=False ): 126 126 if pol < 0: 127 127 opt = 'averaged over pol' … … 137 137 pl.clf() 138 138 # plot grid position 139 x = numpy.arange(self.blc[0],self.trc[0]+0.5*self.cellx,self.cellx,dtype=float) 140 #print 'len(x)=',len(x) 141 #print 'x=',x 142 ybase = numpy.ones(self.nx,dtype=float)*self.blc[1] 143 #print 'len(ybase)=',len(ybase) 144 incr = self.celly 145 for iy in xrange(self.ny): 146 y = ybase + iy * incr 147 #print y 148 pl.plot(x,y,',',color='blue') 139 if plotgrid: 140 x = numpy.arange(self.blc[0],self.trc[0]+0.5*self.cellx,self.cellx,dtype=float) 141 #print 'len(x)=',len(x) 142 #print 'x=',x 143 ybase = numpy.ones(self.nx,dtype=float)*self.blc[1] 144 #print 'len(ybase)=',len(ybase) 145 incr = self.celly 146 for iy in xrange(self.ny): 147 y = ybase + iy * incr 148 #print y 149 pl.plot(x,y,',',color='blue') 149 150 # plot observed position 150 irow = 0 151 while ( irow < self.nrow ): 152 chunk = self.getPointingChunk( irow ) 153 #print chunk 154 pl.plot(chunk[0],chunk[1],',',color='green') 155 irow += chunk.shape[1] 156 #print irow 151 if plotobs: 152 irow = 0 153 while ( irow < self.nrow ): 154 chunk = self.getPointingChunk( irow ) 155 #print chunk 156 pl.plot(chunk[0],chunk[1],',',color='green') 157 irow += chunk.shape[1] 158 #print irow 157 159 # show image 158 160 extent=[self.blc[0]-0.5*self.cellx,
Note:
See TracChangeset
for help on using the changeset viewer.