Changeset 1073 for trunk


Ignore:
Timestamp:
07/06/06 11:21:41 (18 years ago)
Author:
mar637
Message:

Ticket #48 - enable disk based scantable. added scan averaging to average_channel

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/scantable.py

    r1070 r1073  
    5252                    # crude check if asap table
    5353                    if os.path.exists(filename+'/table.info'):
    54                         Scantable.__init__(self, filename, "memory")
     54                        Scantable.__init__(self, filename, rcParams['scantable.storage']=='disk')
    5555                        if unit is not None:
    5656                            self.set_fluxunit(unit)
     
    790790        return s
    791791
    792     def average_channel(self, mode="MEDIAN", align=False):
     792    def average_channel(self, mode="MEDIAN", scanav=False, align=False):
    793793        """
    794794        Return the (median) average of a scan.
    795795        Note:
    796796            in channels only - align if necessary
    797             the mdeian Tsys is computed.
     797            the median Tsys is computed.
    798798        Parameters:
    799799            one scan or comma separated  scans
    800800            mode:     type of average, default "MEDIAN"
     801            scanav:   True averages each scan separately
     802                      False (default) averages all scans together,
    801803            align:    align the spectra in velocity before averaging. It takes
    802804                      the time of the first spectrum as reference time.
    803805        Example:
    804             # mdeian average the scan
     806            # median average the scan
    805807            newscan = scan.average_channel()
    806808        """
    807809        varlist = vars()
    808810        if mode is None: mode = 'MEDIAN'
     811        scanav = "NONE"
     812        if scanav: scanav = "SCAN"
    809813        scan = self
    810814        try:
    811815          if align:
    812816              scan = self.freq_align(insitu=False)
    813           s = scantable(self._math._averagechannel(scan, mode))
     817          s = scantable(self._math._averagechannel(scan, mode, scanav))
    814818        except RuntimeError,msg:
    815819            if rcParams['verbose']:
     
    15231527        if average:
    15241528            asaplog.push('Auto averaging integrations')
     1529        stype = int(rcParams['scantable.storage'] == 'disk')
    15251530        for name in fullnames:
    1526             r = stfiller()
     1531            tbl = Scantable(stype)
     1532            print stype
     1533            r = stfiller(tbl)
    15271534            msg = "Importing %s..." % (name)
    15281535            asaplog.push(msg,False)
     
    15301537            r._open(name,-1,-1)
    15311538            r._read()
    1532             tbl = r._getdata()
     1539            #tbl = r._getdata()
    15331540            if average:
    15341541                tbl = self._math._average((tbl,),(),'NONE','SCAN')
Note: See TracChangeset for help on using the changeset viewer.