Ignore:
Timestamp:
07/02/13 10:38:18 (11 years ago)
Author:
Malte Marquarding
Message:

Issue #291: added scantable.set_sourcename to overwrite sourcename to allow freq_align to work. Exposed 'SOURCE' averaging to python api. Added some logging to freq_align refering to the sources it aligns to

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/scantable.py

    r2810 r2818  
    21122112    #
    21132113    @asaplog_post_dec
    2114     def average_time(self, mask=None, scanav=False, weight='tint', align=False):
     2114    def average_time(self, mask=None, scanav=False, weight='tint', align=False,
     2115                     avmode="NONE"):
    21152116        """\
    21162117        Return the (time) weighted average of a scan. Scans will be averaged
     
    21402141            align:    align the spectra in velocity before averaging. It takes
    21412142                      the time of the first spectrum as reference time.
     2143            avmode:   'SOURCE' - also select by source name -  or
     2144                      'NONE' (default). Not applicable for scanav=True or
     2145                      weight=median
    21422146
    21432147        Example::
     
    21502154        weight = weight or 'TINT'
    21512155        mask = mask or ()
    2152         scanav = (scanav and 'SCAN') or 'NONE'
     2156        scanav = (scanav and 'SCAN') or avmode.upper()
    21532157        scan = (self, )
    21542158
    21552159        if align:
    21562160            scan = (self.freq_align(insitu=False), )
     2161            asaplog.push("Note: Alignment is don on a source-by-source basis")
     2162            asaplog.push("Note: Averaging (by default) is not")
     2163            # we need to set it to SOURCE averaging here           
    21572164        s = None
    21582165        if weight.upper() == 'MEDIAN':
     
    42464253        self._add_history("set_sourcetype", varlist)
    42474254
     4255
     4256    def set_sourcename(self, name):
     4257        varlist = vars()
     4258        self._setsourcename(name)
     4259        self._add_history("set_sourcename", varlist)
     4260
    42484261    @asaplog_post_dec
    42494262    @preserve_selection
Note: See TracChangeset for help on using the changeset viewer.