Changeset 670 for trunk/python


Ignore:
Timestamp:
09/02/05 14:38:51 (19 years ago)
Author:
mar637
Message:

fixed typo in import rotate_xyphase (from release-2), added auto-quotient

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/scantable.py

    r626 r670  
    11951195        if allaxes is None: allaxes = rcParams['scantable.allaxes']
    11961196        varlist = vars()
    1197         from asap._asap import rotate_xyphase as _rotate_xyphase
     1197        from asap._asap import _rotate_xyphase
    11981198        _rotate_xyphase(self, angle, allaxes)
    11991199        self._add_history("rotate_xyphase", varlist)
     
    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.