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

1.3.1 Select a subset of the measurement set.


Description

This function will select a subset of the current measurement set based on the range of values for each field in the input record. The range function will return a record that can be altered and used as the argument for this function. A successful selection returns True. Allowable fields are tabulated in table~1.6 (in the general description of this tool). Unrecognized fields are ignored.

You need to call selectinit before calling this function. If you haven’t then selectinit will be called for you with default arguments.

Repeated use of this function, with different arguments, will further refine the selection, resulting in a successively smaller selected measurement set. If the selected measurement set does not contain any rows then this function will return False and send a warning message in the logger. Otherwise this function will return True. To undo all the selections you need to use the selectinit function (with reset=True).

Arguments





Inputs

items

record with fields contain ranges and enumerations

allowed:

record

Default:

Returns
bool

Example

 
 
      ms.open("3C273XC1.MS")  
      ms.selectinit(datadescid=0)  
      ms.select({’antenna1’:[1,3,5],’uvdist’:[1200.,1900.]})  
      ms.select({’time’:[4121629420.,4121638290.]})  
      start = qa.getvalue(qa.convert(qa.quantity(’1989/06/27/01:03:40’),’s’))  
      stop = qa.getvalue(qa.convert(qa.quantity(’1989/06/27/03:31:30’),’s’))  
      rec = {}  
      rec[’time’] = [start, stop]  
      ms.select(items=rec)  
 
    This example selects all the data from the measurement set where  
    the value in the DATA\_DESC\_ID column is zero. This  
    corresponds to a particular spectral window and polarization  
    setup. It then selects all the data where the first antenna in the  
    interferometer is number one, three or five and where the uv  
    distance is between 1200 and 1900 meters.  Finally it selects all  
    the data which was observed between 4121629420 seconds and  
    4121638290 seconds (since zero hours on the day where the modified  
    Julian day is zero). Since this time in seconds is quite obscure I  
    have also illustrated how to use the quanta tool to convert a  
    date/time string into seconds which can then be used to perform  
    the same time selection.  
 
    The selections are cumulative so that at the end of this example  
    only data in the specified time range, with the specified,  
    interferometers, uv distances, spectral window and polarization  
    setup are selected.  

__________________________________________________________________


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