NRAO Home > CASA > CASA Cookbook and User Reference Manual
8.2.1.3 sdbaseline
Keyword arguments:  
infile -- name of input SD dataset  
antenna -- antenna name or id (only effective for MS input).  
fluxunit -- units for line flux  
        options: ’K’,’Jy’,’’  
        default: ’’ (keep current fluxunit)  
        WARNING: For GBT data, see description below.  
    >>> fluxunit expandable parameter  
         telescopeparm -- the telescope characteristics  
                options: (str) name or (list) list of gain info  
                default: ’’ (none set)  
                example: if telescopeparm=’’, it tries to get the telescope  
                         name from the data.  
                         Full antenna parameters (diameter,ap.eff.) known  
                         to ASAP are  
                         ’ATPKSMB’, ’ATPKSHOH’, ’ATMOPRA’, ’DSS-43’,  
                         ’CEDUNA’,’HOBART’. For GBT, it fixes default fluxunit  
                         to ’K’ first then convert to a new fluxunit.  
                         telescopeparm=[104.9,0.43] diameter(m), ap.eff.  
                         telescopeparm=[0.743] gain in Jy/K  
                         telescopeparm=’FIX’ to change default fluxunit  
                         see description below  
specunit -- units for spectral axis  
        options: (str) ’channel’,’km/s’,’GHz’,’MHz’,’kHz’,’Hz’  
        default: ’’ (=current)  
        example: this will be the units for masklist  
frame -- frequency frame for spectral axis  
        options: (str) ’LSRK’,’REST’,’TOPO’,’LSRD’,’BARY’,  
                 ’GEO’,’GALACTO’,’LGROUP’,’CMB’  
        default: currently set frame in scantable  
        WARNING: frame=’REST’ not yet implemented  
doppler -- doppler mode  
        options: (str) ’RADIO’,’OPTICAL’,’Z’,’BETA’,’GAMMA’  
        default: currently set doppler in scantable  
scanlist -- list of scan numbers to process  
        default: [] (use all scans)  
        example: [21,22,23,24]  
        this selection is in addition to field, iflist, and pollist  
field -- selection string for selecting scans by name  
        default: ’’ (no name selection)  
        example: ’FLS3a*’  
        this selection is in addition to scanlist, iflist, and pollist  
iflist -- list of IF id numbers to select  
        default: [] (use all IFs)  
        example: [15]  
        this selection is in addition to scanlist, field, and pollist  
pollist -- list of polarization id numbers to select  
        default: [] (use all polarizations)  
        example: [1]  
        this selection is in addition to scanlist, field, and iflist  
tau -- atmospheric optical depth  
        default: 0.0 (no correction)  
masklist -- list or string of mask regions to INCLUDE in BASELINE fit  
            a string masklist allows per IF selection of channels.  
        default: [] (entire spectrum)  
        example: [[1000,3000],[5000,7000]]  
                 ’0:1000~3000;5000~7000, 1:200~350;450~600’  
                 when maskmode is ’auto’ or ’interact’, this mask  
                 will be applied first before fitting as base mask  
maskmode -- mode of setting additional channel masks  
        options: (str) ’auto’,’list’,’interact’  
        default: ’auto’  
        example: maskmode=’auto’ runs linefinder to detect line regions  
                 to be excluded from fitting. this mode requires three  
                 expandable parameters: thresh, avg_limit, and edge.  
                 USE WITH CARE! May need to tweak the expandable parameters.  
                 maskmode=’list’ uses the given masklist only: no additional  
                 masks applied.  
                 maskmode=’interact’ allows users to manually modify the  
                 mask regions by dragging mouse on the spectrum plotter GUI.  
                 use LEFT or RIGHT button to add or delete regions,  
                 respectively.  
 
    >>> maskmode expandable parameters  
         thresh -- S/N threshold for linefinder  
                 default: 5  
                 example: a single channel S/N ratio above which the channel is  
                          considered to be a detection  
         avg_limit -- channel averaging for broad lines  
                 default: 4  
                 example: a number of consecutive channels not greater than  
                          this parameter can be averaged to search for broad lines  
         edge -- channels to drop at beginning and end of spectrum  
                 default: 0  
                 example: [1000] drops 1000 channels at beginning AND end  
                          [1000,500] drops 1000 from beginning and 500 from end  
         Note: For bad baselines threshold should be increased,  
         and avg_limit decreased (or even switched off completely by  
         setting this parameter to 1) to avoid detecting baseline  
         undulations instead of real lines.  
blfunc -- baseline model function  
        options: (str) ’poly’,’cspline’,’sinusoid’  
        default: ’poly’  
        example: blfunc=’poly’ uses a single polynomial line of  
                 any order which should be given as an expandable  
                 parameter ’order’ to fit baseline.  
                 blfunc=’cspline’ uses a cubic spline function, a piecewise  
                 cubic polynomial having C2-continuity (i.e., the second  
                 derivative is continuous at the joining points).  
                 blfunc=’sinusoid’ uses a combination of sinusoidal curves.  
    >>> blfunc expandable parameters  
         order -- order of baseline polynomial  
                 options: (int) (<0 turns off baseline fitting)  
                 default: 5  
                 example: typically in range 2-9 (higher values  
                          seem to be needed for GBT)  
         npiece -- number of the element polynomials of cubic spline curve  
                 options: (int) (<0 turns off baseline fitting)  
                 default: 2  
         applyfft -- automatically set wave numbers of sinusoidal functions  
                 for fitting by applying some method like FFT.  
                 options: (bool) True, False  
                 default: True  
         fftmethod -- method to be used when applyfft=True. Now only  
                 ’fft’ is available and it is the default.  
         fftthresh -- threshold to select wave numbers to be used for  
                 sinusoidal fitting. both (float) and (str) accepted.  
                 given a float value, the unit is set to sigma.  
                 for string values, allowed formats include:  
                   ’xsigma’ or ’x’ (= x-sigma level. e.g., ’3sigma’), or  
                   ’topx’ (= the x strongest ones, e.g. ’top5’).  
                 default is 3.0 (unit: sigma).  
         addwn -- additional wave number(s) of sinusoids to be used  
                 for fitting.  
                 (list) and (int) are accepted to specify every  
                 wave numbers. also (str) can be used in case  
                 you need to specify wave numbers in a certain range,  
                 e.g., ’a-b’ (= a, a+1, a+2, ..., b-1, b),  
                       ’<a’  (= 0,1,...,a-2,a-1),  
                       ’>=a’ (= a, a+1, ... up to the maximum wave  
                              number corresponding to the Nyquist  
                              frequency for the case of FFT).  
                 default: []  
         rejwn -- wave number(s) of sinusoid NOT to be used for fitting.  
                 can be set just as addwn but has higher priority:  
                 wave numbers which are specified both in addwn  
                 and rejwn will NOT be used.  
                 default: []  
         clipthresh -- clipping threshold for iterative fitting  
                 default: 3  
         clipniter -- maximum iteration number  
                 default: 0 (no iteration, i.e., no clipping)  
verify -- verify the results of baseline fitting  
        options: (bool) True,False  
        default: False  
        NOTE: Currently available only when blfunc=’poly’  
        WARNING: Currently this just asks whether you accept  
                 the displayed fit and if not, continues  
                 without doing any baseline fit.  
verbose -- output fitting results to logger and a file as well  
        default: True  
        example: If False, the fitting results including coefficients,  
                 residual rms, etc., are not output to either the CASA  
                 logger or a text file (<outfile>_blparam.txt), while  
                 the processing speed gets faster by a factor of about 20  
                 percent  
showprogress -- show progress status for large data  
        default: True  
minnrow -- minimum number of input spectra to show progress status  
        default: 1000  
outfile -- Name of output file  
        default: ’’ (<infile>_bs)  
outform -- format of output file  
        options: ’ASCII’,’SDFITS’,’MS’,’ASAP’  
        default: ’ASAP’  
        example: the ASAP format is easiest for further sd  
                 processing; use MS for CASA imaging.  
                 If ASCII, then will append some stuff to  
                 the outfile name  
overwrite -- overwrite the output file if already exists  
        options: (bool) True,False  
        default: False  
        WARNING: if outform=’ASCII’, this parameter is ignored  
plotlevel -- control for plotting of results  
        options: (int) 0=none, 1=some, 2=more, <0=hardcopy  
        default: 0 (no plotting)  
        example: plotlevel<0 as abs(plotlevel), e.g.  
                 -1 => hardcopy of final plot (will be named  
                <outfile>_bspec.eps)  
        WARNING: be careful plotting in fsotf mode!  

DESCRIPTION:

Task sdbaseline performs baseline fitting/removal for single-dish spectra. The fit parameters, terms and rms of baseline are saved to an ASCII file, <outfile>_blparam.txt.

See the sdcal description for information on fluxunit conversion and the telescopeparm parameter. Also, see the sdcal description for note on GBT raw SDFITS format data.

By setting maskmode=’interact’, you can set/unset mask regions interactively using mouse buttons. Current mask regions will be shown with yellow shading. Baseline fit parameters and rms of fitted spectra are saved to an ASCII file, <outfile>_blparam.txt, when verbose=True.

The parameter masklist accepts per IF selection of mask regions. See § 2.3.3.1 for details. Note, the mask regions should be specified in unit of specunit in this task.

Available functions for baseline subtraction are polynomial, cubic spline, and sinusoid. Also, iterative n-σ clipping becomes available with cubic spline and sinusoid.


More information about CASA may be found at the CASA web page

Copyright © 2010 Associated Universities Inc., Washington, D.C.

This code is available under the terms of the GNU General Public Lincense


Home | Contact Us | Directories | Site Map | Help | Privacy Policy | Search