nraonrao
 
NRAO Home > CASA > CasaRef
autoflag.settimemed - Function

2.1.1 Sets up the time-median flagging method
Description

The timemed method uses a median-in-time filter. It works by computing a sliding median of some value dcbt (where c is frequency channel, b is baseline, and t is time slot), as specified by the expr parameter (see the general autoflag module description for details of how expr determines d.) The sliding median is computed in time, on a per-channel, per-baseline basis:

mxcbt = median{dxcbt′, where |t′ - t| ≤ δ}

(where δ is given by the hw parameter.) Then, a median absolute deviation (MAD) of the data with respect to the median is computed on a per-row basis:

M xbt = median{|dxcbt- mxcbt|, for all c}

(For single-channel data, Mbt m0bt.) Mbt is then smoothed by applying a sliding median in time:

˜                  ′       ′      ˜
M xbt = median{M xbt, where |t- t| ≤ δ}

(where δ˜ is given by the rowhw parameter.) All points where

|dxcbt - mxcbt| > θM ˜ xbt

are then flagged. The threshold level θ is given by the thr parameter.

In addition, timemed can also flag entire rows based on their MAD. This is only performed for line data (specifically, when there are at least 10 channels per row), and may be explicitly disabled by specifying norow=T. To do this, it first computes a per-baseline MAD of the MAD:

Mˆxb = median{|M xbt- M˜xbt|, for all t}

and flags rows where |Mbt -M˜bt| > ˆθ Mˆb, where θˆ is given by the rowthr parameter.

Timemed will iterate over the measurement set – and compute mcbt – only once. Existing flags are taken into account at this time (unless fignore is specified). MADs are then computed and recomputed iteratively, dropping flagged points and rows, until convergence is achieved (i.e. no more flags are raised). Since mcbt is not recomputed as new flags are raised, running this method a second time may sometimes be of use.

Arguments





Inputs

thr

Flagging threshold

allowed:

double

Default:

5.0

hw

Half-window for the sliding median, if time slots is less than 4 times half window, ignoring this chunk

allowed:

int

Default:

10

rowthr

Row flagging threshold

allowed:

double

Default:

10.0

rowhw

Half-window for the sliding median of the MAD

allowed:

int

Default:

10

norow

Disable row flagging

allowed:

bool

Default:

false

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()  
- af.settimemed(thr=5,hw=5,expr="- ABS RR LL")

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.