Changeset 895


Ignore:
Timestamp:
03/08/06 14:29:58 (18 years ago)
Author:
mar637
Message:

added asapreader to asap2

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/__init__.py

    r880 r895  
    6868    'scantable.autoaverage'      : [True, _validate_bool],
    6969    'scantable.freqframe' : ['LSRK', str],  #default frequency frame
    70     'scantable.allaxes'   : [True, _validate_bool],  # apply action to all axes
    7170    'scantable.plotter'   : [True, _validate_bool], # use internal plotter
    7271    'scantable.verbosesummary'   : [False, _validate_bool]
     
    119118# scantable.set_freqfrmae is called
    120119scantable.freqframe        : LSRK
    121 
    122 # apply action to all axes not just the cursor location
    123 scantable.allaxes          : True
    124 
    125 # use internal plotter
    126 scantable.plotter          : True
    127120
    128121# Control the level of information printed by summary
     
    250243
    251244from asapfitter import *
    252 #from asapreader import reader
     245from asapreader import reader
    253246
    254247from asapmath import *
  • trunk/python/asapreader.py

    r719 r895  
    1 from asap._asap import sdreader
     1from asap._asap import stfiller
    22from asap import print_log
    33
    4 class reader(sdreader):
     4class reader(stfiller):
    55    """
    66    This class allows the user to import single dish files
     
    4646        from os.path import expandvars
    4747        filename = expandvars(filename)
    48         sdreader.__init__(self, filename, theif, thebeam)
     48        stfiller.__init__(self, filename, theif, thebeam)
    4949        print_log()
    5050
    51     def read(self,integrations=None):
     51    def read(self):
    5252        """
    5353        Reads in an returns a specified sequence of integrations.
    5454        If no list is given all integrations a read in.
    55         Parameters:
    56             integrations:    a 'range' of integration numbers, e.g.
    57                              range(100) or [0,1,2,3,4,10,11,100]
    58                              If not given (default) all integrations
    59                              are read in
    60         Example:
    61             r.read([0,1,2,3,4])    # reads in the first 5 integatrions
    62                                    # NOT scans
    63             r.read(range(100))     # read in the first 100 integrations
    6455        """
    6556        from asap import scantable
     
    6859            integrations = [-1]
    6960        asaplog.push("Reading integrations from disk...")
    70         sdreader._read(self,integrations)
    71         tbl = sdreader._getdata(self)
    72         sdreader._reset(self) # reset to the beginning of the file
     61        stfiller._read(self)
     62        tbl = stfiller._getdata(self)
    7363        if self.unit is not None:
    7464            tbl.set_fluxunit(self.unit)
    7565        print_log()
    7666        return scantable(tbl)
     67
     68    def close(self):
     69        """
     70        Close the reader.
     71        """
     72        self._close()
    7773
    7874    def summary(self, name=None):
     
    8581             r.summary()
    8682        """
    87         sdreader._reset(self)
    88         sdreader._read(self,[-1])
     83        stfiller._read(self)
    8984        from asap import scantable
    90         tbl = scantable(sdreader._getdata(self))
    91         sdreader._reset(self)
     85        tbl = scantable(stfiller._getdata(self))
    9286        tbl.summary(name)
     87        del tbl
    9388        return
  • trunk/src/STFiller.cpp

    r878 r895  
    328328    throw(AipsError("Reading error occured, data possibly corrupted."));
    329329  }
    330 
    331330  return status;
    332331}
  • trunk/src/python_STFiller.cpp

    r872 r895  
    4343        .def("_open", &STFillerWrapper::open)
    4444        .def("_read", &STFillerWrapper::read)
     45        .def("_close", &STFillerWrapper::close)
    4546        .def("_getdata", &STFillerWrapper::getScantable)
    4647      ;
Note: See TracChangeset for help on using the changeset viewer.