Changeset 2375 for trunk/python


Ignore:
Timestamp:
12/19/11 19:40:37 (12 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS-2816

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No?

Module(s): Module Names change impacts.

Description: Describe your changes here...

Several bug fixes and updates

  • fixed misunderstanding of array shape when getting data
  • load flag data as Int (originally uChar/uInt) at the beginning of gridding
  • do not plot observed position and grid position by default
  • use Array (instead of Vector/Matrix/Cube?) as much as possible


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapgrid.py

    r2373 r2375  
    4242        self.outfile = self.gridder._save( outfile )
    4343
    44     def plot( self, plotchan=-1, plotpol=-1 ):
     44    def plot( self, plotchan=-1, plotpol=-1, plotobs=False, plotgrid=False ):
    4545        import time
    4646        t0=time.time()
     
    4949        rcParams['scantable.storage'] = 'disk'
    5050        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 )
    5252        # back to original setup
    5353        rcParams['scantable.storage'] = storg
     
    123123        #print 'cellx,celly=',self.cellx,self.celly
    124124
    125     def plot( self, chan=-1, pol=-1 ):
     125    def plot( self, chan=-1, pol=-1, plotobs=False, plotgrid=False ):
    126126        if pol < 0:
    127127            opt = 'averaged over pol'
     
    137137        pl.clf()
    138138        # 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')
    149150        # 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
    157159        # show image
    158160        extent=[self.blc[0]-0.5*self.cellx,
Note: See TracChangeset for help on using the changeset viewer.