|
|||
NRAO Home > CASA > CASA Toolkit Reference Manual |
|
imager.selectvis - Function
2.3.1 Select visibilities for subsequent processing
Description
This setup tool function selects which data are to be used subsequently. After
invocation of selectvis, only the selected data are operated on. Thus, for
example, in imaging, only the selected data are gridded into an image, and in
plotting, only the selected data are plotted.
Data can be selected by field and spectral window ids. Note that all data thus selected are passed to imaging, and may or may not be imaged, depending on how the image was constructed using defineimage. For example, in mosaicing, use fieldid in defineimage to control what pointing is used to define the field center, and use fieldid in selectvis to control what pointings are used in the imaging.
For spectral processing, it is possible to make cubes out multi-spectral window selections but the selection and combination can be a bit confusing (any hint at how to make it clearer is welcome).
If the default values are not used, then data to be used can be selected channel wise. The
- nchan
- is the number of data channels selected. It defaults to -1 (interpreted as all channels).
- start
- is the first channel from input dataset that is to be used. It defaults to 0 (i.e. first channel).
- step
- gives the increment between selected input channels. It defaults to 1 channel. A value of n means that n-1 data channels will not not be used.
By choosing the parameters for selectvis and defineimage correctly, one may obtain various mappings of visibility channels to image channels. For example, to average 512 visibility channels into 64 image channels (producing image channels consisting of 8 visibility channels):
im.defineimage(mode=’channel’, spw=0, nchan=64, start=1, step=8); im.selectvis(spw=0, nchan=512, start=1, step=1) im.clean(.....);
This averages the spectral channels during the gridding process. If one wanted to only include every 8th channel in the deconvolution, one would do:
im.selectvis(nchan=64, start=1, step=8) im.defineimage(mode=’channel’, nchan=64, start=1, step=8); im.clean(....);
For velocity and opticalvelocity modes, the mstart and mstep are the start and step velocities as strings.
im.defineimage(mode=’velocity’, nchan=64, start=’20 km/s’, step=’-100m/s’); im.selectvis(spwid=[-1]); ###selecting all data spectral windows im.clean(...);
If the image and data selections differ, then averaging is done during the gridding and degridding process in the image deconvolution.
im.defineimage(mode=’channel’, nchan=64, start=1, step=8); im.selectvis(nchan=512, start=1, step=1) im.clean()
Note: The channels numbers used in defineimage and selectvis refers to the same channel. So if a channel is not selected in selectvis but is selected in defineimage, then blank channels image are made. The example below will result in the having the first 6 (0-5) channels in the image to be blank.
im.selectvis(nchan=50, start=6, step=1) #selected chan 6-55 im.defineimage(mode=’channel’, nchan=50, start=0, step=1);
# will try to image channel 1-50. But as previously only channel 6-55 # was selected only channel 6-50 will have data; images of channels # 1-5 are blank im.clean(....)
For multi-spectral window cube imaging the selection of the data can be done as follows
im.selectvis(nchan=[50,60], start=[0,0], step=[1,1], spw=[0,1]) im.defineimage(mode=’channel’, nchan=110, start=0, step=1, spw=[0,1]);
The above means that you would make a data selection of 50 channels (starting from 0 steping 1) from the first spectral window and 60 channels (starting from 1 steping 1). The defineimage defines the image to be a cube of 110 channels. The caveat is the step size in the frequency direction is the step size of the first spectral window. If the step size of channels of the two spectral windows are different then one is better off defining the image cube in velocities (e.g. as below).
im.selectvis(nchan=[50,60], start=[0,0], step=[1,1], spw=[1,2]) im.defineimage(mode=’velocity’, nchan=200, mstart=’20km/s’, mstep=’-100m/s’);
Arguments
Inputs |
| ||
vis |
| Measurementset for which this selection applies; an
empty string ”” implies that it is to be applied in ms
used in open
| |
| allowed: | string |
|
| Default: |
| |
nchan |
| Number of channels to select
| |
| allowed: | intArray |
|
| Default: | -1 |
|
start |
| Start channels (0-relative)
| |
| allowed: | intArray |
|
| Default: | 0 | |
step |
| Step in channel number
| |
| allowed: | intArray |
|
| Default: | 1 |
|
spw |
| Spectral Window Ids (0 relative) to select; -1 interpreted
as all | |
| allowed: | any |
|
| Default: | variant -1 |
|
field |
| Field Ids (0 relative) or Field names (msselection syntax
and wilcards are used) to select
| |
| allowed: | any |
|
| Default: | variant -1 |
|
baseline |
| Antenna Ids (0 relative) or Antenna names (msselection
syntax and wilcards are used) to select
| |
| allowed: | any |
|
| Default: | variant -1 | |
time |
| Limit data selected to be within a given time range. The
syntax is defined in the msselection link
| |
| allowed: | any |
|
| Default: | variant
|
|
scan |
| Limit data selected on scan numbers. The syntax is
defined in the msselection link
| |
| allowed: | any |
|
| Default: | variant
|
|
intent |
| Limit data selected on observation intent. The syntax is
defined in the msselection link
| |
| allowed: | string |
|
| Default: |
|
|
observation |
| Limit data using observation IDs. The syntax is defined
in the msselection link
| |
| allowed: | any |
|
| Default: | variant
|
|
uvrange |
| Limit data selected on uv distance. The syntax is defined
in the msselection link
| |
| allowed: | any |
|
| Default: | variant
|
|
taql |
| For the TAQL experts, flexible data selection using the
TAQL syntax
| |
| allowed: | string |
|
| Default: |
|
|
usescratch |
| If True: imager will use CORRECTED_DATA column
and will make scratch columns and store Model
visibilities after deconvolution
| |
| allowed: | bool |
|
| Default: | false |
|
datainmemory |
| If True: imager will load the selected ms memory; useful
if imaging a few channels that fit in memory
| |
| allowed: | bool |
|
| Default: | false |
|
writeaccess |
| If False: imager will open the ms in readmode; useful for
multiple process access to the MS
| |
| allowed: | bool |
|
| Default: | true |
|
bool
Example
im.open(’3C273XC1.MS’);
im.selectvis(nchan=512,start=1,step=1, taql=’SCAN_NUMBER > 10 && FIELD_ID==2’)
Time range selection
im.selectvis(field=range(0,10), time=’> 2000/09/21/12:00:00’)
select some antennas, for all fields that begins with {\tt ’ngc’}
im.selectvis(field=’ngc*’, baseline=[0, 10, 20])
And for those that the standard parameters are not flexible enough
there is the taql parameter. This for people who knows the different
columns of the MeasurementSet
im.selectvis(taql="ANTENNA1==0 && ANTENNA2==3")
Imager allows the user to make an image from multiple ms, without the
need to concatenate them. To do this then the im.open method should
{\bf not} be used at all but multiple calls of selectvis with the
parameter vis pointing to each ms should be used. The other
parameters can be used to make selection on each ms
im.selectvis(vis=’myms1.ms’, field=0, spw=[0,1], nchan=[40, 50], start=[5,10])
im.selectvis(vis=’myms2.ms’, field=10, spw=[2], nchan=[40], start=[5])
im.selectvis(vis=’myms3.ms’, field=range(0,10), time=’> 2002/10/15/20:30:45’)
__________________________________________________________________
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