|
|||
NRAO Home > CASA > CASA Cookbook and User Reference Manual |
|
3.4.2.7 Tfcrop
# elevation/tfcrop/rflag/extend/unflag/summary
# )
...
ntime = ’scan’ # Time-range to use for each chunk (in seconds
# or minutes)
combinescans = False # Accumulate data across scans.
datacolumn = ’DATA’ # Data column on which to operate
# (data,corrected,model,residual)
timecutoff = 4.0 # Flagging thresholds in units of deviation
# from the fit
freqcutoff = 3.0 # Flagging thresholds in units of deviation
# from the fit
timefit = ’line’ # Fitting function for the time direction
# (poly/line)
freqfit = ’poly’ # Fitting function for the frequency direction
# (poly/line)
maxnpieces = 7 # Number of pieces in the polynomial-fits (for
# ’freqfit’ or ’timefit’ = ’poly’)
flagdimension = ’freqtime’ # Dimensions along which to calculate fits
# (freq/time/freqtime/timefreq)
usewindowstats = ’none’ # Calculate additional flags using sliding
# window statistics (none,sum,std,both)
halfwin = 1 # Half-width of sliding window to use with
# ’usewindowstats’ (1,2,3).
TFCrop is an autoflag algorithm that detects outliers on the 2D time-frequency plane, and can operate on un-calibrated data (non bandpass-corrected). The original implementation of this algorithm is described in NCRA Technical Report 202 (Oct 2003).
The algorithm iterates through the data in chunks of time. For each chunk, the result of user-specified visibility-expressions are organized as 2D time-frequency planes, one for each baseline and correlation-expression result, and the following steps are performed.
- Calculate a bandshape template : Average the data across time, to construct an average
bandpass. Construct an estimate of a clean bandpass (without RFI) via a robust piece-wise
polynomial fit to the average bandpass shape.
Note : A robust fit is computed in upto 5 iterations. It begins with a straight line fit across the full range, and gradually increases to ’maxnpieces’ number of pieces with third-order polynomials in each piece. At each iteration, the stddev between the data and the fit is computed, values beyond N-stddev are flagged, and the fit and stddev are re-calculated with the remaining points. This stddev calculation is adaptive, and converges to a value that reflects only the data and no RFI. At each iteration, the same relative threshold is applied to detect flags, and this results in a varying set of flagging thresholds, that allows deep flagging only when the fit represents the true data best. Iterations stop when the stddev changes by less than 10%, or when 5 iterations are completed.
The resulting clean bandpass is a fit across the base of RFI spikes.
- Divide out this clean bandpass function from all timesteps in the current chunk. Now, any data points that deviate from a mean of 1 can be considered RFI. This step helps to separate narrow-band RFI spikes from a smooth but varying bandpass, in situations where a simple range-based clipping will flag good sections of the bandpass.
- Perform iterative flagging (robust flagging) of points deviating from a value of 1.
Flagging is done in upto 5 iterations. In each iteration, for every timestep, calculate the stddev of the bandpass-flattened data, flag all points further than N times stddev from the fit, and recalculate the stddev. At each iteration, the same relative threshold is applied to detect flags. Optionally, use sliding-window based statistics to calculate additional flags.
- Repeat steps 1 and 3, but in the other direction (i.e. average the data across frequency, calculate a piece-wise polynomial fit to the average time-series, and find flags based on deviations w.r.to this fit.)
The default parameters of the tfcrop implementation are optimized for strong narrow-band RFI. With broad-band RFI, the piece-wise polynomial can sometimes model it as part of the band-shape, and therefore not detect it as RFI. In this case, reducing the maximum number of pieces in the polynomial can help. This algorithm usually has trouble with noisy RFI that is also extended in time of frequency, and additional statistics-based flagging is recommended (via the ’usewindowstats’ parameter). It is often required to set up parameters separately for each spectral-window.
If frequency ranges of known astronomical spectral lines are known a-priori , they can be protected from automatic flagging by de-selecting those frequency-ranges via the ’spw’ data-selection parameter.
For a detailed description of the tfcrop parameters and some examples, we refer to the inline help of tflagdata and to http://www.aoc.nrao.edu/\~rurvashi/FlaggerDocs/FlaggerDocs.html.
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