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


next up previous contents index
Next: autoflag.setnewtimemed - Function Up: autoflag - Tool Previous: autoflag - Constructor


autoflag.settimemed - Function



Package synthesis
Module autoflag
Tool autoflag


Sets up the time-median flagging method


Synopsis
settimemed(thr, hw, rowthr, rowhw, norow, column, expr, fignore)


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:

mcbt = median{dcbt', where | t' - t| $\displaystyle \leq$ $\displaystyle \delta$}

(where $ \delta$ 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:

Mbt = median{| dcbt - mcbt|, for all c}

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

$\displaystyle \tilde{M}_{bt}^{}$ = median{Mbt', where | t' - t| $\displaystyle \leq$ $\displaystyle \tilde{\delta}$}

(where $ \tilde{\delta}$ is given by the rowhw parameter.) All points where

| dcbt - mcbt| > $\displaystyle \theta$$\displaystyle \tilde{M}_{bt}^{}$

are then flagged. The threshold level $ \theta$ 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:

$\displaystyle \hat{M}_{b}^{}$ = median{| Mbt - $\displaystyle \tilde{M}_{bt}^{}$|, for all t}

and flags rows where | Mbt - $ \tilde{M}_{bt}^{}$| > $ \hat{\theta}$$ \hat{M}_{b}^{}$, where $ \hat{\theta}$ 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

thr Flagging threshold
Allowed: numeric (real)
Default: 5
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: numeric (real)
Default: 10
rowhw Half-window for the sliding median of the MAD
Allowed: Int
Default: 10
norow Disable row flagging
Allowed: Boolean
Default: F
column Which column to base flagging on
Allowed: "DATA", "MODEL" or "CORR"
Default: "DATA"
expr Expression to use
Allowed: see text
Default: "ABS I"
fignore Ignore existing flags
Allowed: Boolean
Default: F


Example
- af:=autoflag('3C273XC1.MS')
- af.setdata()
- af.settimemed(thr=5,hw=5,expr="- ABS RR LL")





next up previous contents index
Next: autoflag.setnewtimemed - Function Up: autoflag - Tool Previous: autoflag - Constructor   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-10-15