Changeset 2387


Ignore:
Timestamp:
12/26/11 12:09:26 (13 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...

During plot, open input data only when it is necessary.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapgrid.py

    r2375 r2387  
    7979
    8080    def get( self ):
    81         self.tablein = scantable( self.infile, average=False )
    82         if self.ifno < 0:
    83             ifno = self.tablein.getif(0)
    84             print 'ifno=',ifno
    85         else:
    86             ifno = self.ifno
    87         sel = selector()
    88         sel.set_ifs( ifno )
    89         self.tablein.set_selection( sel )
    90         self.nchan = len(self.tablein._getspectrum(0))
    91         self.nrow = self.tablein.nrow()
    92         del sel
    93 
    9481        s = scantable( self.outfile, average=False )
     82        self.nchan = len(s._getspectrum(0))
    9583        nrow = s.nrow()
    9684        pols = numpy.ones( nrow, dtype=int )
     
    150138        # plot observed position
    151139        if plotobs:
     140            self.createTableIn()
    152141            irow = 0
    153142            while ( irow < self.nrow ):
     
    168157        pl.title( title )
    169158
     159    def createTableIn( self ):
     160        self.tablein = scantable( self.infile, average=False )
     161        if self.ifno < 0:
     162            ifno = self.tablein.getif(0)
     163            print 'ifno=',ifno
     164        else:
     165            ifno = self.ifno
     166        sel = selector()
     167        sel.set_ifs( ifno )
     168        self.tablein.set_selection( sel )
     169        self.nchan = len(self.tablein._getspectrum(0))
     170        self.nrow = self.tablein.nrow()
     171        del sel
     172       
     173
    170174    def getPointingChunk( self, irow ):
    171175        numchunk = 1000
Note: See TracChangeset for help on using the changeset viewer.