Changeset 340


Ignore:
Timestamp:
01/31/05 21:28:33 (19 years ago)
Author:
kil064
Message:

add unit arg to constructor to take advantage of new reader feature

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/scantable.py

    r334 r340  
    99    """
    1010   
    11     def __init__(self, filename):
     11    def __init__(self, filename, unit=None):
    1212        """
    1313        Create a scantable from a saved one or make a reference
     
    2121                         [advanced] a reference to an existing
    2222                         scantable
     23           unit:         brightness unit; must be consistent with K or Jy.
     24                         Over-rides the default selected by the reader
     25                         (input rpfits/sdfits/ms) or replaces the value
     26                         in existing scantables
    2327        """
    2428        self._vb = rcParams['verbose']
     
    2832        if isinstance(filename,sdtable):
    2933            sdtable.__init__(self, filename)           
     34            if unit is not None:
     35                print 'Setting brightness unit to ', unit
     36                sdtable.set_fluxunit(unit)                       
    3037        else:
    3138            try:
     
    3845                if stat.S_ISREG(st(filename+'/table.info')[stat.ST_MODE]):
    3946                    sdtable.__init__(self, filename)
     47                    if unit is not None:
     48                        print 'Setting brightness unit to ', unit
     49                        self.set_fluxunit(unit)                       
    4050                else:
    4151                    print 'The given file is not a valid asap table'
     
    4555
    4656                from asap._asap import sdreader
    47                 r = sdreader(filename,-1,-1)
     57                ifSel = -1
     58                beamSel = -1
     59                if unit is None:
     60                    unit = ""
     61                r = sdreader(filename,unit,ifSel,beamSel)
    4862                print 'Importing data...'
    4963                r.read([-1])
Note: See TracChangeset for help on using the changeset viewer.