NRAO Home > CASA > CASA Toolkit Reference Manual
imager.advisechansel - Function

2.3.1 Advise on spw and chan selection optimal for the image frequency range wanted


Description

Basically tells you what channels of which spectral window need to be selected for your image spectral parameters. The freqstep is used to calulate the extra padding needed for data selection at the begining and end of the range. The freqframe parameter is the frame in which the frequency range is being given. It will be converted to the frame of the data with time to locate which channel match. A record will be returned with an element for each ms used in selectvis. Each element of the record will have the spwids and channel start and nchan for each spwid. if the parameter msname is used then the MSs associated associated with this tool (that have been either ’open’ed or ’selectvis’ed) are ignored In this mode it is a helper function to the general world ...no need to open or selectvis. You need to specify the field_id for which this calculation is being done for in the helper mode. If you have already set MS’s and selected data and msname=”” then the calulation is done for the field(s) selected in selectvis.

If the parameter getfreqrange=True then the reverse is requested. You set spwselection to be the range of data selection you want to use and you’ll get the range of frequency covered in the frame you set.

Arguments





Inputs

freqstart

Begining of frequency range in Hz

allowed:

double

Default:

1.0e6

freqend

End of frequency range in Hz

allowed:

double

Default:

1.1e6

freqstep

spectral channel resolution of intended image in Hz

allowed:

double

Default:

100.0

freqframe

frame in which frequency is being expressed in other parameters

allowed:

string

Default:

LSRK

msname

name of an ms, if empty string it will use the ms’s used in selectvis

allowed:

string

Default:

fieldid

fieldid to use when msname is not empty otherwise ignored and field selected in selectvis is used

allowed:

int

Default:

0

getfreqrange

if set then freqrange is returned in the frame requested for the data selected

allowed:

bool

Default:

false

spwselection

if getfreqrange=True then this is needed to find the range of frequency in the frame requested

allowed:

string

Default:

Returns
record

Example

 
In this example, we are interested in an image cube which span 20.0682GHz to 20.1982 in LSRK  which will have a channel resolution of 3.9MHz. The field we are interested is field 4 of each of the ms.  
 
 
#######  
im.selectvis(vis=’test1.ms’, field=’4’, spw=’*’)  
im.selectvis(vis=’test2.ms’, field=’4’, spw=’*’)  
selinfo=im.advisechansel(freqstart=2.00682e10, freqend=2.01982e10, freqstep=3.9e3, freqframe="LSRK")  
####The output "selfinfo" will be a record which will look like thus  
{’ms_0’: {’nchan’: array([109,  23], dtype=int32),  
          ’spw’: array([4, 5], dtype=int32),  
          ’start’: array([19,  0], dtype=int32)},  
 ’ms_1’: {’nchan’: array([109,  23], dtype=int32),  
          ’spw’: array([4, 5], dtype=int32),  
          ’start’: array([19,  0], dtype=int32)}}  
###  
Thus from the first ms a spw selection like  ’4:19~127, 5:0~22’  is all that is needed.  
Similarly from the second ms.  
 
###if you need this info without needing to change the state of the imager tool  
then you can it as follows  
 
im.advisechansel(freqstart=2.00682e10, freqend=2.01982e10, freqstep=3.9e3, freqframe="LSRK", msname="test1.ms", fieldid=4)  
 
 
####now if you want to see what frequency range is covered, in the frame  
####defined by freqframe, in spwselection you want to use  
im.selectvis(vis=’test3.ms’, spw=’0:20~210’)  
im.advisechansel(getfreqrange=True, freqframe="LSRK")  
### the output will be something  
 {’freqend’: 346020345384.64178, ’freqstart’: 345683852920.1723}  
 
###and if you just want to use it as a helper function without touching the state  
###of imager  
 
im.advisechansel(msname=’test3.ms’, getfreqrange=True, spwselection=’0:20~210’)  
 
 

__________________________________________________________________


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