Changeset 341


Ignore:
Timestamp:
02/01/05 13:15:16 (20 years ago)
Author:
kil064
Message:

handle user specified unit (reader/constructor) at python level now not C++

Location:
trunk/python
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapreader.py

    r339 r341  
    1919    """
    2020
    21     def __init__(self, filename,unit=None, theif=None, thebeam=None):
     21    def __init__(self, filename, unit=None, theif=None, thebeam=None):
     22        self.unit = unit
    2223        """
    2324        Parameters:
     
    3132            r = reader('/tmp/2001-09-01_0332_P363.rpf', theif=2)
    3233        """
    33         if unit is None:
    34             unit = ""
    3534        if theif is None:
    3635            theif = -1
    3736        if thebeam is None:
    3837            thebeam = -1
    39         sdreader.__init__(self, filename, unit, theif, thebeam)
     38        sdreader.__init__(self, filename, theif, thebeam)
    4039
    4140    def read(self,integrations=None):
     
    5958        sdreader.read(self,integrations)
    6059        tbl = sdreader.getdata(self)
     60        if self.unit is not None:
     61            tbl.set_fluxunit(self.unit)
    6162        return scantable(tbl)
    6263
  • trunk/python/scantable.py

    r340 r341  
    3333            sdtable.__init__(self, filename)           
    3434            if unit is not None:
    35                 print 'Setting brightness unit to ', unit
    3635                sdtable.set_fluxunit(unit)                       
    3736        else:
     
    4645                    sdtable.__init__(self, filename)
    4746                    if unit is not None:
    48                         print 'Setting brightness unit to ', unit
    4947                        self.set_fluxunit(unit)                       
    5048                else:
Note: See TracChangeset for help on using the changeset viewer.