autoflag.setsprej - Function

2.1.1 Sets up the spectral rejection flagging method
Description

The sprej method works by fitting a user-specified segment of the spectrum (presumably, the continuum) by a polynomial. It then flags entire rows based on the chi-square statistic of the fit, in a manner similar to timemed. Please refer to setimemed for detailed math, substituting χbt2 for Mbt. The value that is actually fitted is specified via the expr parameter (see the general ?? description for details).

The segement to be fitted can be specified as a range of channel indices (1-based) or frequencies. Frequencies may be given as string measures ("1.4GHz") or float values (units of MHz assumed). A vector of two values [C1,C2] specifies the segment from C1 to C2, inclusive. Several disjoint segments may be specified with a 2N vector or a (2,N) matrix.

For a measurement set containing multiple spectral windows, you can set the region argument to a record of records, with each sub-record containing spwid and fq and/or chan fields, specifying the segments of a specific spectral window. See examples below.

Arguments





Inputs

ndeg

Number of degrees for polynomial

allowed:

int

Default:

2

rowthr

Flagging threshold, in MADs of χ2

allowed:

double

Default:

5.0

rowhw

Half-window for the sliding median

allowed:

int

Default:

6

norow

Disable row flagging

allowed:

bool

Default:

false

spwid

Spectral window number (0-based), or -1 for all windows

allowed:

int

Default:

-1

chan

Range of channels (0-based). Either “fq” or “chan” must be specified, 2N or (2,N).

allowed:

intArray

Default:

-1 -1

region

A compound spectral segment specification (see example)

allowed:

any

Default:

record

column

Which column to base flagging on

allowed:

string

Default:

MODEL CORR” DATA

expr

Expression to use

allowed:

string

Default:

ABS I

fignore

Ignore existing flags

allowed:

bool

Default:

false

Returns
bool

Example

- af:=autoflag(’3C273XC1.MS’)  
- af.setdata()  
# use segments 807-807.5 and 809-809.5 MHz for fitting  
- af.setsprej(fq=[807,807.5,809,809.5))  
...  
# use channels 10-20 and 30-40  
- af.setsprej(chan=[[10,20],[30,40]])  
...  
# use different segements in different spectral windows  
- region := [=]  
- region[1] := [ spwid=1,fq="1.4GHz 1.401GHz" ]  
- region[2] := [ spwid=2,chan=[10,20] ]  
- region[3] := [ spwid=4,chan=[50,60] ]  
- af.setsprej(region=region)

Please send any comments or questions about CASA or AIPS++ to aips2-requests@nrao.edu

Copyright © 2008 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

Updated daily during alpha development.