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.attach - Function Up: autoflag - Tool Previous: autoflag.setuvbin - Function

Subsections



autoflag.setselect - Function



Package synthesis
Module autoflag
Tool autoflag


Sets up the Selector flagging method


Synopsis
setselect(spwid, field, fq, chan, corr, ant, baseline, timerng, autocorr, timeslot, dtime, clip, flagrange, quack, unflag)


Description

The select method allows you to directly flag or unflag a subset of your data. Subsets can be specified via any combination of field, spectral window, frequency or channel number, correlations (i.e. polarizations), antennas, baselines, time ranges. The method will flag/unflag a whole subset, or, optionally, only autocorrelations, or only specific time slots within the subset. Select also includes the option to flag VLA quacks (specified by scan interval and scan start time).

The spwid, field, fq, chan, corr, ant, baseline, timerng parameters select a subset of the measurement set, on a logical-AND basis.

  • An empty array ([]) or a boolean F (which is the default for any parameter), means ``do not select on this''.

  • fq specifies ranges of frequencies. You can use strings with units (i.e. "800MHz"), or floats, in which case MHz is assumed.

  • chan specifies ranges of channel numbers (1-based). Negative numbers can be used to specify channels starting from the end of the window, e.g., [-10,-1] means the last 10 channels.

  • Where ranges are specified, the method expects either a 2N vector:

    [S1, E1, S2, E2,..., SN, EN]

    or a (2,N) array of start/end points.

    For example, if you want to indicate 7 channels (1,2,3,4,5,6,7), either chan = [1,7] or chan = [[1,2],[2,3],...,[6,7]] does the work.

    NOTE: The usual means of indicating a range with the ":" delimiter does not apply for the channel subexpression. For example, the equivalent to [1:3] to select channels 1 through 3 would be [1,3].

  • Antennas can be specified by name or 1-based number (which is sometimes the same thing). Names must correspond to the ANTENNA subtable of the measurement set.

  • Baselines may be specified either as an array of strings, using antenna names or numbers delimited by ``-'' (e.g. "1-2 4-7", or "RT1-RTA"), or as a (2,N) array of antenna numbers (e.g. [[1, 2],[4, 7]]).
The autocorr, timeslot+dtime, clip, flagrange and quack parameters specify what to flag (or unflag) within the selected subset, on a logical-OR basis. If none are specified, then the entire subset is flagged (or unflagged).

Clipping.

The clip and flagrange parameters enable flagging based on the value of an expression. Clip implies flagging of all values outside a specific range, flagrange implies flagging within a specific range. Like other flagging methods, you can specify values via expressions. Two types of expressions are recognized: correlation-derived expresisons (see the general autoflag module description for details), and UVW expressions (see below). To use a single expression and range, set clip or flagrange to a record as folows:

- af:=autoflag('3C273XC1.MS')
- af.setdata();
- af.setselect(clip=[expr='+ ABS XX YY',min=1e-6,max=.5]) 
# Above the feeds are assumed to be linear; use RR and LL for circular. 
- af.run();

The expr field specifies the expression to clip on, and min and max specify the range. Either the min or max field may be omitted, in which case $ \pm$$ \infty$ is assumed. To flag several ranges and/or expressions, set clip or flagrange to a record of records:

- af:=autoflag('3C273XC1.MS')
- af.setdata();
- cliprec:=[=]
- cliprec[1] := [expr='+ ABS XX YY',min=1e-6,max=.5]
- cliprec[3] := [expr='- ABS XX YY',max=.5]
- cliprec[2] := [expr="UVD",min=1]
- af.setselect(clip=cliprec)

A shorthand way is also available: use expression as the field name, and set the field to (a) a record of min, max, (b) a 2-element array of (min,max), or (c) a single scalar value (assumed to be max). Thus, the record above may be equivalently formed as:

- cliprec['+ ABS XX YY'] := [1e-6,.5]         # equivalent to [min=1e-6,max=.5]
- cliprec['- ABS XX YY'] := .5                # equivalent to [max=.5]
- cliprec['UVD']         := [min=1]            
- af.setselect(clip=cliprec)

When specifying several ranges for the same expression, you must naturally use the longhand form.

In addition to the regular correlation expressions, select also recognizes a few UVW-based expressions. The simplest ones are: U, V, W, ABS U, ABS V, ABS W. UVD stands for uv-distance, and corresponds to $ \sqrt{u^2+v^2}$. Two more expressions represent angles in the uv-plane:

UVA
stands for uv position angle, specified in degrees clockwise from the v axis.

HA
stands for hour angle (East-West array assumed). It is specified in degrees counterclockwise from the u axis, using the following definition: u = Bcos$ \alpha_{h}^{}$,    v = Bsin$ \alpha_{h}^{}$sin$ \delta$, where B is baseline, $ \alpha_{h}^{}$ is hour angle, and $ \delta$ is declination.

When using the UVA and HA expressions, you are actually defining sectors in the uv-plane, from min. to max. angle, e.g.:

- af.setselect(flagrange=[expr="uva",min=47,max=49])

...flags everything in the sector between 47 and 49 degrees, in terms of positional angle.

Quack

is a special option for VLA datasets, to flag the ``quacks'' at the beginning of each scan. It is specified by two numbers, [tsi,$ \tau$]. tsi is the scan interval, used to determine the beginning of a new scan. $ \tau$ is the number of seconds to flag at the start of a scan.



Arguments

spwid Spectral window numbers (1-based), or [] or F for all
Allowed: Array of ints
Default: F
field Field names or numbers (1-based), or [] or F for all
Allowed: Array of ints/strings
Default: F
fq Range(s) of frequencies, or [] or F for all
Allowed: 2N or (2,N) array of Strings w/units or floats
Default: F
chan Range(s) of channels (1-based), or [] or F for all
Allowed: 2N or (2,N) array of ints
Default: F
corr Correlations (by name, e.g. ``XX YY''), or [] or F for all
Allowed: array of strings
Default: F
ant Antennas (by name or number), or [] or F for all
Allowed: array of strings/ints
Default: F
baseline Baselines, or [] or F for all
Allowed: array of strings/ints
Default: F
timerng Time ranges, as MJDs or date strings, or [] or F for all
Allowed: array of strings/floats
Default: F
autocorr Flag autocorrelations
Allowed: Boolean
Default: F
timeslot Flag specific time slots. Specifies center time as MJDs or date strings
Allowed: array of strings/floats
Default: F
dtime Tolerance of timeslot parameter, in seconds
Allowed: numeric
Default: 10
clip Flag values outside a specific range
Allowed: Record, see above
Default: F
flagrange Flag values within a specific range
Allowed: Record, see above
Default: F
quack Flag VLA quacks - scan interval and quack length, in seconds
Allowed: 2-element numeric array
Default: F
unflag Clear flags instead of setting them
Allowed: Boolean
Default: F


Example
- af:=autoflag('3C273XC1.MS')
- af.setdata();
# flag all autocorrelations and VLA quacks
- af.setselect(autocorr=T,quack=[120,60]) 
# flag some frequencies on specific antennas, during a certain period of time
- af.setselect(ant=[1,2,4],timerng="1998/01/20/20:00 1998/01/20/22:00",
               fq=[807.51,807.56])
# flag RR and RL on a few bad time slots on a specific baseline
- af.setselect(corr="RR RL",baseline="3-7",
               timeslot="1998/01/20/20:00:30 1998/01/20/20:20:30")





next up previous contents index
Next: autoflag.attach - Function Up: autoflag - Tool Previous: autoflag.setuvbin - Function   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