NRAO Home > CASA > CASA Toolkit Reference Manual

5.1.3 sd.selector - Tool

Data selection tool for single-dish data
Description

The selector is a data selection object that affects a scantable object via set_selection function. Selection by the following attributes are available:

Note that the selection by an integer is 0-based (scan, beam, cycle, IF, polarization, and row).

In addition, the selector provides interface for more flexible data selection using TaQL.

The selector also support sorting data. The selector sorts data based on values of columns specified by the user.

Summary of the current selection is stored in the object as a string. Thus, you can see that summary by using print (see example below).

The constructor takes some arguments to set selection criteria. So, the user can set selection either using constructor options and available setter functions.

Source types should be given as an integer or an enumerations that are properly defined for source type. That enumeration can be accessed via sd.srctype. The list of enumerations defined (following sd.srctype.) are as follows:

enum intdescription



pson 0 on-source scan of position switched data
psoff 1 off-source scan of position switched data
nod 2 nod scan
fson 3 on-source scan of frequency switched data
fsoff 4 reference scan of frequency switched data
sky 6 sky scan for calibration
hot 7 hot load scan for calibration
warm 8 warm load scan for calibration
cold 9 cold load scan for calibration
poncal 10on-source calibration scan of position switched data
poffcal 11off-source calibration scan of position switched data
nodcal 12nod calibration scan
foncal 13on-source calibration scan of frequency switched data
foffcal 14reference calibration scan of frequency switched data
fslo 20lower frequency throw of symmetric freuqnecy switching
flooff 21off-source lower frequency throw of symmetric frequency switching
flosky 26sky lower frequency throw of symmetric frequency switching
flohot 27hot load lower frequency throw of symmetric frequency switching
flowarm28warm load lower frequency throw of symmetric frequency switching
flocold 29cold load lower frequency throw of symmetric frequency switching
fshi 30higher frequency throw of symmetric freuqnecy switching
fhioff 31off-source higher frequency throw of symmetric frequency switching
fhisky 36sky higher frequency throw of symmetric frequency switching
fhihot 37hot load higher frequency throw of symmetric frequency switching
fhiwarm38warm load higher frequency throw of symmetric frequency switching
fhicold 39cold load higher frequency throw of symmetric frequency switching
sig 90signal scan
ref 91reference scan
cal 92calibration scan
notype 99no type

Arguments





Inputs

beams

Beam number selection

allowed:

integer, integer array

Default:

None (no selection)

cycles

Cycle number selection

allowed:

integer, integer array

Default:

None (no selection)

ifs

IF number selection

allowed:

integer, integer array

Default:

None (no selection)

name

Source name selection. Allows regular expression.

allowed:

string

Default:

None (no selection)

pols

Polarization number selection

allowed:

integer, integer array, string, string array

Default:

None (no selection)

query

TaQL selection query

allowed:

string

Default:

None (no selection)

scans

Scan number selection

allowed:

integer, integer array

Default:

None (no selection)

types

Source type selection

allowed:

integer, integer array

Default:

None (no selection)

rows

Row number selection

allowed:

integer, integer array

Default:

None (no selection)





Example

     # create a selector object  
     sel=sd.selector()  
     # These are equivalent if data is ’linear’  
     sel.set_polarisations(["XX","Re(XY)"])  
     sel.set_polarisations([0,2])  
     # reset the polarisation selection  
     sel.set_polarisations()  
     # these are equivalent  
     sel2=sd.selector(ifs=[0,1])  
     sel2=sd.selector()  
     sel2.set_ifs([0,1])  
     # check current selection  
     print sel  
     IFNO: [0,1]  
     # apply selection on scantable  
     s=sd.scantable(’OrionS_rawACSmod_cal’,average=False)  
     s.set_selection(sel)

Methods

get_beams Return a list of current beam selection
get_cycles Return a list of current cycle selection
get_ifs Return a list of current IF selection
get_name Return a selection string for source name (not yet implemented)
get_order Return a list of columns used for sorting
get_pols Return a list of current polarization selection
get_poltypes Return a list of polarization types for current polarization selection
get_query Return current selection string for TaQL selection
get_rows Return a list of current row number selection
get_scans Return a list of current scan number selection
get_types Return a list of current source type selection
is_empty Check if any selection has been set
reset Unset all selections
set_beams Set a sequence of beam numbers
set_cycles Set a sequence of cycle numbers
set_ifs Set a sequence of IF numbers
set_name Set a selection based on a source name
set_order Set column names that is used for sorting data
set_polarisationsSet a sequence of polarization numbers or strings
set_polarizationsSet a sequence of polarization numbers or strings
set_pols Set a sequence of polarization numbers or strings
set_querySet a selection string based on TaQL
set_rows Set a sequence of row numbers
set_scansSet a sequence of scan numbers
set_tsys Set range of system temperature
set_typesSet a sequence of source types

    sd.selector.get_beams - Function
    sd.selector.get_cycles - Function
    sd.selector.get_ifs - Function
    sd.selector.get_name - Function
    sd.selector.get_order - Function
    sd.selector.get_pols - Function
    sd.selector.get_poltypes - Function
    sd.selector.get_query - Function
    sd.selector.get_rows - Function
    sd.selector.get_scans - Function
    sd.selector.get_types - Function
    sd.selector.is_empty - Function
    sd.selector.reset - Function
    sd.selector.set_beams - Function
    sd.selector.set_cycles - Function
    sd.selector.set_ifs - Function
    sd.selector.set_name - Function
    sd.selector.set_order - Function
    sd.selector.set_polarisations - Function
    sd.selector.set_polarizations - Function
    sd.selector.set_pols - Function
    sd.selector.set_query - Function
    sd.selector.set_rows - Function
    sd.selector.set_scans - Function
    sd.selector.set_tsys - Function
    sd.selector.set_types - Function


More information about CASA may be found at the CASA web page

Copyright 2016 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