NRAO Home > CASA > CASA Toolkit Reference Manual
ms.selectinit - Function

1.3.1 Initialize the selection of an ms


Description

A measurement set can contain data with a variety of different shapes (as described in the overall description to this tool). To allow functions to return data in fixed shape arrays you need to select, using this function, rows that contain the same data shape. You do not need to use this function if all the data in your measurement set has only one shape.

The DATA_DESC_ID column in the measurement set contains a value that maps to a particular row in the POLARIZATION and SPECTRAL_WINDOW subtables. Hence all rows with the same value in the DATA_DESC_ID column must have the same data shape. To select all the data where the DATA_DESC_ID value is N you call this function with the datadescid argument set to N.

It is possible to have a measurement set with differing values in the DATA_DESC_ID column but where all the data is a fixed shape. For example this will occur if the reference frequency changes but the number of spectral channels is fixed. In cases like this all the data can be selected, using this function with an argument of zero. If the data shape does change and you call this function with an datadescid set to zero the return value will be False. In all other cases it will be True.

To return to the completely unselected measurement set, set the reset argument to True. This will allow you to access the full range of rows in the measurement set, rather than just the selected measurement set.

The datadescid must always be a non-negative integer.

Arguments





Inputs

datadescid

Data description id

allowed:

int

Default:

0

reset

Reset to unselected state

allowed:

bool

Default:

false

Returns
bool

Example

 
 
      ms.open("3C273XC1.MS")  
      ms.selectinit(datadescid=0)  
      print ms.range(["uvdist"])  
      ms.selectinit(reset=True)  
      print ms.range("uvdist")  
 
 
    In this example we display the range of uv distances for the data  
    in the specified measurement set. The first print statement will  
    only use data where the DATA\_DESC\_ID column is 0. This will  
    correspond to a specific spectral window and polarization  
    setup. The second print statement will print the range of uv  
    distances for all the data in the measurement set (which is the  
    same in this case).  
 

__________________________________________________________________


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