Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1488
News FAQ
Search Home


next up previous contents index
Next: ms.uvlsf - Function Up: ms - Tool Previous: ms.clearbuffer - Function


ms.continuumsub - Function



Package general
Module ms
Tool ms


Continuum fitting and subtraction in uv plane


Synopsis
continuumsub(fldid, spwid, chans, solint, fitorder, mode)


Arguments

fldid in Desired fields to fit
    Allowed: Vector of integers
    Default: no default
spwid in Desired spectral windows to fit
    Allowed: Vector of integers
    Default: all
chans in Range of channels to fit
    Allowed: Vector of integers
    Default: all
solint in Averaging time (s)
    Allowed: Float
    Default: 0.0 (scans)
fitorder in Polynomial order for fit
    Allowed: Integer
    Default: 0
mode in Desired use of fit model (see below)
    Allowed: String
    Default: 'subtract'



Description
This function does exactly the same as uvlsf, and will replace that function in future when it proves to be sufficiently bug free. Continuumsub is written in C++ as opposed to glish and is faster by a factor 3-10 (depends on size of dataset and solution interval). This function provides a means of continuum determination and subtraction by fitting a polynomial of desired order to a subset of channels in each time-averaged uv spectrum. The fit is used to model the continuum in all channels (not just those used in the fit), for subtraction, if desired. Use the chans parameter to limit the range of channels used to estimate the continuum (avoid channels containing spectral lines). The default solution interval (0.0s) will average the data over scans (per-baseline) before doing the fit. The mode parameter indicates how the continuum model (the result of the fit) should be used: 'subtract' will store the continuum model in the MODEL_DATA column and subtract it from the CORRECTED_DATA column; 'replace' will replace the CORRECTED_DATA column with the continuum model (useful if you want to image the continuum model result); and 'model' will only store the continuum model in the MODEL_DATA column (the CORRECTED_DATA is unaffected).

It is important to start the ms tool with readonly=F so that changes to the dataset will be allowed (see example below).

For now, the only way to recover the un-subtracted CORRECTED_DATA column is to use calibrater.correct() again.

Note that the MODEL_DATA and CORRECTED_DATA columns must be present for continuumsub to work correctly. The function will warn the user if they are not present, and abort. To add these scratch columns (for now), done the ms tool, then start a calibrater or an imager tool, which will add the scratch columns. Then restart the ms tool, and try continuumsub again.

Options for shifting known bright sources to the phase center and for editing based on the rms fit will be added in the near future.



Example
      include 'ms.g'
      myms := ms('ngc5921.ms',readonly=F);    # writable!
      myms.continuumsub(fldid=3,spwid=1,chans=[5:9,50:59],
                 solint=0.0,fitorder=1,mode='sub');
      myms.done();
This example will fit a line to channels 5-9 and 50-59 in spectral window 1 in each scan-averaged spectrum for field 3, and store the result in the MODEL_DATA column and subtract it from the CORRECTED_DATA column.





next up previous contents index
Next: ms.uvlsf - Function Up: ms - Tool Previous: ms.clearbuffer - Function   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-08-01