casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables
Functions | Variables
asap.asapmath Namespace Reference

Functions

def average_time
def quotient
def dototalpower
def dosigref
def calps
def calnod
def calfs
def merge
def calibrate
def apexcal
def almacal
def splitant
def _array2dOp

Variables

tuple s
 s = scantab.get_scan('*_ps*') if s is None: msg = "The input data appear to contain no position-switch mode data." raise TypeError(msg)
tuple sel
string msg
tuple ssub
tuple ssubon
tuple ssuboff
tuple cals
tuple sig
tuple ref
tuple ress
dictionary precal
list postcal
list keys
list types
tuple ifnos
tuple polnos
list ll
tuple p
tuple nr
list titles
list btics
 b
string title
float ymin
float ymax
tuple nchan
tuple edge
tuple spmin
tuple spmax
tuple x
int scan1no
list scan2no
list pairScans
tuple resspec
tuple ss
list ll2
string key
tuple scal
 ssub = scantab.get_scan( scannos ) scal = scantable( stm.cwcal( ssub, calmode, antname ) )

Function Documentation

def asap.asapmath._array2dOp (   scan,
  value,
  mode = "ADD",
  tsys = False,
  insitu = None 
) [private]
This function is workaround on the basic operation of scantable
with 2 dimensional float list.

scan:    scantable operand
value:   float list operand
mode:    operation mode (ADD, SUB, MUL, DIV)
tsys:    if True, operate tsys as well
insitu:  if False, a new scantable is returned.
         Otherwise, the array operation is done in-sitsu.

Definition at line 1023 of file asapmath.py.

Referenced by asap.scantable.scantable.__op(), and asap.scantable.scantable.scale().

def asap.asapmath.almacal (   scantab,
  scannos = [],
  calmode = 'none',
  verify = False 
)
Calibrate ALMA data

Parameters:
    scantab:       scantable
    scannos:       list of scan number
    calmode:       calibration mode

    verify:        verify calibration

Definition at line 927 of file asapmath.py.

Referenced by asap.asapmath.calibrate().

def asap.asapmath.apexcal (   scantab,
  scannos = [],
  calmode = 'none',
  verify = False 
)
Calibrate APEX data

Parameters:
    scantab:       scantable
    scannos:       list of scan number
    calmode:       calibration mode

    verify:        verify calibration

Definition at line 903 of file asapmath.py.

Referenced by asap.asapmath.calibrate().

def asap.asapmath.average_time (   args,
  kwargs 
)
Return the (time) average of a scan or list of scans. [in channels only]
The cursor of the output scan is set to 0
Parameters:
    one scan or comma separated  scans or a list of scans
    mask:     an optional mask (only used for 'var' and 'tsys' weighting)
    scanav:   True averages each scan separately.
              False (default) averages all scans together,
    weight:   Weighting scheme.
                'none'     (mean no weight)
                'var'      (1/var(spec) weighted)
                'tsys'     (1/Tsys**2 weighted)
                'tint'     (integration time weighted)
                'tintsys'  (Tint/Tsys**2)
                'median'   ( median averaging)
    align:    align the spectra in velocity before averaging. It takes
              the time of the first spectrum in the first scantable
              as reference time.
    compel:   True forces to average overwrapped IFs.
Example:
    # return a time averaged scan from scana and scanb
    # without using a mask
    scanav = average_time(scana,scanb)
    # or equivalent
    # scanav = average_time([scana, scanb])
    # return the (time) averaged scan, i.e. the average of
    # all correlator cycles
    scanav = average_time(scan, scanav=True)

Definition at line 9 of file asapmath.py.

References tests.test_imcontsub.list, and asap.asapmath.merge().

Referenced by asap.sbseparator.sbseparator._preprocess_tables().

def asap.asapmath.calfs (   scantab,
  scannos = [],
  smooth = 1,
  tsysval = 0.0,
  tauval = 0.0,
  tcalval = 0.0,
  verify = False 
)
Calibrate GBT frequency switched data.
Adopted from GBTIDL getfs.
Currently calfs identify the scans as frequency switched data if source
type enum is fson and fsoff. The data must contains 'CAL' signal
on/off in each integration. To identify 'CAL' on state, the source type 
enum of foncal and foffcal need to be present.

Parameters:
    scantab:       scantable
    scannos:       list of scan numbers
    smooth:        optional box smoothing order for the reference
                   (default is 1 = no smoothing)
    tsysval:       optional user specified Tsys (default is 0.0,
                   use Tsys in the data)
    tauval:        optional user specified Tau
    verify:        Verify calibration if true

Definition at line 621 of file asapmath.py.

References tests.test_imcontsub.list, irc_cs_task_regression.max, and asap.asapplotter.new_asaplot().

Referenced by asap.asapmath.calibrate().

def asap.asapmath.calibrate (   scantab,
  scannos = [],
  calmode = 'none',
  verify = None 
)
Calibrate data.

Parameters:
    scantab:       scantable
    scannos:       list of scan number
    calmode:       calibration mode
    verify:        verify calibration

Definition at line 856 of file asapmath.py.

References asap.asapmath.almacal(), asap.asapmath.apexcal(), asap.asapmath.calfs(), asap.asapmath.calnod(), and asap.asapmath.calps().

def asap.asapmath.calnod (   scantab,
  scannos = [],
  smooth = 1,
  tsysval = 0.0,
  tauval = 0.0,
  tcalval = 0.0,
  verify = False 
)
Do full (but a pair of scans at time) processing of GBT Nod data
calibration.
Adopted from  GBTIDL's getnod
Parameters:
    scantab:     scantable
    scannos:     a pair of scan numbers, or the first scan number of the pair
    smooth:      box car smoothing order
    tsysval:     optional user specified Tsys value
    tauval:      optional user specified tau value (not implemented yet)
    tcalval:     optional user specified Tcal value
    verify:       Verify calibration if true

Definition at line 401 of file asapmath.py.

Referenced by asap.asapmath.calibrate().

def asap.asapmath.calps (   scantab,
  scannos,
  smooth = 1,
  tsysval = 0.0,
  tauval = 0.0,
  tcalval = 0.0,
  verify = False 
)
Calibrate GBT position switched data
Adopted from GBTIDL getps
Currently calps identify the scans as position switched data if source
type enum is pson or psoff. The data must contains 'CAL' signal
on/off in each integration. To identify 'CAL' on state, the source type 
enum of poncal and poffcal need to be present.

Parameters:
    scantab:       scantable
    scannos:       list of scan numbers
    smooth:        optional box smoothing order for the reference
                   (default is 1 = no smoothing)
    tsysval:       optional user specified Tsys (default is 0.0,
                   use Tsys in the data)
    tauval:        optional user specified Tau
    tcalval:       optional user specified Tcal (default is 0.0,
                   use Tcal value in the data)
    verify:        Verify calibration if true

Definition at line 159 of file asapmath.py.

Referenced by asap.asapmath.calibrate().

def asap.asapmath.dosigref (   sig,
  ref,
  smooth,
  tsysval = 0.0,
  tauval = 0.0 
)
Calculate a quotient (sig-ref/ref * Tsys)
Adopted from GBTIDL dosigref
Parameters:
    sig:         on source data
    ref:         reference data
    smooth:      width of box car smoothing for reference
    tsysval:     user specified Tsys (scalar only)
    tauval:      user specified Tau (required if tsysval is set)

Definition at line 139 of file asapmath.py.

def asap.asapmath.dototalpower (   calon,
  caloff,
  tcalval = 0.0 
)
Do calibration for CAL on,off signals.
Adopted from GBTIDL dototalpower
Parameters:
    calon:         the 'cal on' subintegration
    caloff:        the 'cal off' subintegration
    tcalval:       user supplied Tcal value

Definition at line 121 of file asapmath.py.

def asap.asapmath.merge (   args)
Merge a list of scanatables, or comma-sperated scantables into one
scnatble.
Parameters:
    A list [scan1, scan2] or scan1, scan2.
Example:
    myscans = [scan1, scan2]
    allscans = merge(myscans)
    # or equivalent
    sameallscans = merge(scan1, scan2)

Definition at line 824 of file asapmath.py.

Referenced by asap.asapmath.average_time().

def asap.asapmath.quotient (   source,
  reference,
  preserve = True 
)
Return the quotient of a 'source' (signal) scan and a 'reference' scan.
The reference can have just one scan, even if the signal has many. Otherwise
they must have the same number of scans.
The cursor of the output scan is set to 0
Parameters:
    source:        the 'on' scan
    reference:     the 'off' scan
    preserve:      you can preserve (default) the continuum or
                   remove it.  The equations used are
                   preserve:  Output = Toff * (on/off) - Toff
                   remove:    Output = Toff * (on/off) - Ton

Definition at line 98 of file asapmath.py.

Referenced by asap.scantable.scantable.mx_quotient().

def asap.asapmath.splitant (   filename,
  outprefix = '',
  overwrite = False 
)
Split Measurement set by antenna name, save data as a scantables,
and return a list of filename.
Notice this method can only be available from CASA.
Prameter
   filename:    the name of Measurement set to be read.
   outprefix:   the prefix of output scantable name.
                the names of output scantable will be
                outprefix.antenna1, outprefix.antenna2, ....
                If not specified, outprefix = filename is assumed.
   overwrite    If the file should be overwritten if it exists.
                The default False is to return with warning
                without writing the output. USE WITH CARE.

Definition at line 951 of file asapmath.py.

References asap.scantable.is_ms().


Variable Documentation

Definition at line 322 of file asapmath.py.

Definition at line 318 of file asapmath.py.

Definition at line 216 of file asapmath.py.

Definition at line 359 of file asapmath.py.

Definition at line 257 of file asapmath.py.

Definition at line 510 of file asapmath.py.

Definition at line 262 of file asapmath.py.

Definition at line 484 of file asapmath.py.

Definition at line 358 of file asapmath.py.

Definition at line 316 of file asapmath.py.

Definition at line 313 of file asapmath.py.

Definition at line 451 of file asapmath.py.

Definition at line 258 of file asapmath.py.

Definition at line 254 of file asapmath.py.

Definition at line 253 of file asapmath.py.

Definition at line 226 of file asapmath.py.

Definition at line 248 of file asapmath.py.

Definition at line 468 of file asapmath.py.

s = scantab.get_scan('*_ps*') if s is None: msg = "The input data appear to contain no position-switch mode data." raise TypeError(msg)

s = scantab.get_scan('*_nod*') if s is None: msg = "The input data appear to contain no Nod observing mode data." raise TypeError(msg)

Definition at line 186 of file asapmath.py.

ssub = scantab.get_scan( scannos ) scal = scantable( stm.cwcal( ssub, calmode, antname ) )

ssub = scantab.get_scan( scannos ) scal = scantable( stm.almacal( ssub, calmode ) )

Definition at line 923 of file asapmath.py.

Definition at line 446 of file asapmath.py.

Definition at line 450 of file asapmath.py.

Definition at line 188 of file asapmath.py.

Definition at line 221 of file asapmath.py.

Definition at line 362 of file asapmath.py.

Definition at line 361 of file asapmath.py.

Definition at line 480 of file asapmath.py.

Definition at line 197 of file asapmath.py.

Definition at line 210 of file asapmath.py.

Definition at line 205 of file asapmath.py.

Definition at line 353 of file asapmath.py.

Referenced by tw_plotmem.getmem(), and orion_regression.log_test_result().

Definition at line 317 of file asapmath.py.

Definition at line 256 of file asapmath.py.

Definition at line 389 of file asapmath.py.

Definition at line 357 of file asapmath.py.

Definition at line 356 of file asapmath.py.