Changeset 359 for trunk/python


Ignore:
Timestamp:
02/03/05 15:45:54 (20 years ago)
Author:
kil064
Message:

change interface to convert_flux

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapmath.py

    r319 r359  
    127127        return
    128128       
    129 def convert_flux(scan, area, eta=1.0, insitu=None, allaxes=None):
     129def convert_flux(scan, jyperk=None, eta=None, d=None, insitu=None, allaxes=None):
    130130    """
    131131    Return a scan where all spectra are converted to either Jansky or Kelvin
    132         depending upon the flux units of the scan table.
    133     Parameters:
    134         scan:        a scantable
    135         area:        the illuminated area of the telescope (m**2)
    136         eta:         The efficiency of the telescope (default 1.0)       
     132        depending upon the flux units of the scan table.  By default the
     133        function tries to look the values up internally. If it can't find
     134        them (or if you want to over-ride), you must specify EITHER jyperk
     135        OR eta (and D which it will try to look up also if you don't
     136        set it).  jyperk takes precedence if you set both.
     137    Parameters:
     138        scan:        a scantable
     139        jyperk:      the Jy / K conversion factor
     140        eta:         the aperture efficiency 
     141        d:           the geomtric diameter (metres)
    137142        insitu:      if False a new scantable is returned.
    138143                     Otherwise, the scaling is done in-situ
     
    144149    if allaxes is None: allaxes = rcParams['scantable.allaxes']
    145150    if insitu is None: insitu = rcParams['insitu']
     151    if jyperk is None: jyperk = -1.0
     152    if d is None: d = -1.0
     153    if eta is None: eta = -1.0
    146154    if not insitu:
    147155        from asap._asap import convertflux as _convert
    148         return scantable(_convert(scan, area, eta, allaxes))
     156        return scantable(_convert(scan, d, eta, jyperk, allaxes))
    149157    else:
    150158        from asap._asap import convertflux_insitu as _convert
    151         _convert(scan, area, eta, allaxes)
     159        _convert(scan, d, eta, jyperk, allaxes)
    152160        return
    153161
Note: See TracChangeset for help on using the changeset viewer.