Changeset 666


Ignore:
Timestamp:
08/18/05 15:32:37 (19 years ago)
Author:
mar637
Message:

added auto_quotient

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Release-2-fixes/python/scantable.py

    r626 r666  
    12551255            return
    12561256
    1257 
     1257    def auto_quotient(self, mode='suffix', preserve=True):
     1258        """
     1259        This function allows to build quotients automatically.
     1260        It assumes the observation to have the same numer of
     1261        "ons" and "offs"
     1262        It will support "closest off in time" in the future
     1263        Parameters:
     1264            mode:           the on/off detection mode; 'suffix' (default)
     1265                            'suffix' identifies 'off' scans by the
     1266                            trailing '_R' (Mopra/Parkes) or
     1267                            '_e'/'_w' (Tid)
     1268            preserve:       you can preserve (default) the continuum or
     1269                            remove it.  The equations used are
     1270                            preserve: Output = Toff * (on/off) - Toff
     1271                            remove:   Output = Tref * (on/off) - Ton
     1272        """
     1273        modes = ["suffix","time"]
     1274        print mode
     1275        if not mode in modes:
     1276            print "please provide valid mode. Valid modes are %s" % (modes)
     1277            return None
     1278        from asap._asap import quotient as _quot
     1279        if mode == "suffix":
     1280            srcs = self.get_scan("*[^_ewR]")
     1281            refs = self.get_scan("*[_ewR]")
     1282            return scantable(_quot(srcs,refs, preserve))       
     1283        else:
     1284            print "not yet implemented"
     1285            return None
     1286       
    12581287    def quotient(self, other, isreference=True, preserve=True):
    12591288        """
Note: See TracChangeset for help on using the changeset viewer.