Changeset 296 for trunk/python


Ignore:
Timestamp:
01/25/05 14:58:20 (20 years ago)
Author:
kil064
Message:

add arg. 'tsys' to simple_math and scale (optioanl application to Tsys)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapmath.py

    r273 r296  
    5757    return scantable(_quot(source, reference, preserve))
    5858
    59 def simple_math(left, right, op='add'):
     59def simple_math(left, right, op='add', tsys=True):
    6060    """
    6161    Apply simple mathematical binary operations to two
     
    6666        right:         the 'right' scan
    6767        op:            the operation: 'add' (default), 'sub', 'mul', 'div'
     68        tsys:          if True (default) then apply the operation to Tsys
     69                       as well as the data
    6870    """
    6971    if not isinstance(left,scantable) and not isinstance(right,scantable):
     
    7173        return
    7274    from asap._asap import b_operate as _bop
    73     return scantable(_bop(left, right, op))
    74 
    75 def scale(scan, factor, insitu=None, allaxes=None):
     75    return scantable(_bop(left, right, op, tsys))
     76
     77def scale(scan, factor, insitu=None, allaxes=None, tsys=True):
    7678    """
    7779    Return a scan where all spectra are scaled by the give 'factor'
     
    8587                     apply only to the selected (beam/pol/if)spectra only.
    8688                     The default is taken from .asaprc (True)
     89        tsys:        if True (default) then apply the operation to Tsys
     90                     as well as the data
    8791    """
    8892    if allaxes is None: allaxes = rcParams['scantable.allaxes']
     
    9094    if not insitu:
    9195        from asap._asap import scale as _scale
    92         return scantable(_scale(scan, factor, allaxes))
     96        return scantable(_scale(scan, factor, allaxes, tsys))
    9397    else:
    9498        from asap._asap import scale_insitu as _scale
    95         _scale(scan, factor, allaxes)
     99        _scale(scan, factor, allaxes, tsys)
    96100        return
    97101       
Note: See TracChangeset for help on using the changeset viewer.