Changeset 1074


Ignore:
Timestamp:
07/06/06 11:22:45 (18 years ago)
Author:
mar637
Message:

Ticket #50 - arbitrary quotient

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapmath.py

    r1059 r1074  
    7575    return s
    7676
    77 # def quotient(source, reference, preserve=True):
    78 #     """
    79 #     Return the quotient of a 'source' (signal) scan and a 'reference' scan.
    80 #     The reference can have just one row, even if the signal has many. Otherwise
    81 #     they must have the same number of rows.
    82 #     The cursor of the output scan is set to 0
    83 #     Parameters:
    84 #         source:        the 'on' scan
    85 #         reference:     the 'off' scan
    86 #         preserve:      you can preserve (default) the continuum or
    87 #                        remove it.  The equations used are
    88 #                        preserve:  Output = Toff * (on/off) - Toff
    89 #                        remove:    Output = Toff * (on/off) - Ton
    90 #     """
    91 #     varlist = vars()
    92 #     from asap._asap import quotient as _quot
    93 #     s = scantable(_quot(source, reference, preserve))
    94 #     s._add_history("quotient",varlist)
    95 #     print_log()
    96 #     return s
     77def quotient(source, reference, preserve=True):
     78    """
     79    Return the quotient of a 'source' (signal) scan and a 'reference' scan.
     80    The reference can have just one scan, even if the signal has many. Otherwise
     81    they must have the same number of scans.
     82    The cursor of the output scan is set to 0
     83    Parameters:
     84        source:        the 'on' scan
     85        reference:     the 'off' scan
     86        preserve:      you can preserve (default) the continuum or
     87                       remove it.  The equations used are
     88                       preserve:  Output = Toff * (on/off) - Toff
     89                       remove:    Output = Toff * (on/off) - Ton
     90    """
     91    varlist = vars()
     92    from asap._asap import stmath
     93    stm = stmath()
     94    stm._setinsitu(False)
     95    s = scantable(stm._quotient(source, reference, preserve))
     96    s._add_history("quotient",varlist)
     97    print_log()
     98    return s
    9799
    98100def simple_math(left, right, op='add', tsys=True):
     
    150152    print_log()
    151153    return s
     154
Note: See TracChangeset for help on using the changeset viewer.