Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents index
Next: imager.setimage - Function Up: imager - Tool Previous: imager.setbeam - Function


imager.setdata - Function



Package synthesis
Module imager
Tool imager


Set the data parameters selection for subsequent processing


Synopsis
setdata(msname, mode, nchan, start, step, spwid, fieldid, msselect, async)


Description
This setup tool function selects which data are to be used subsequently. After invocation of setdata, 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 the imaging, and may or may not be imaged, depending on how the image was constructed using setimage. For example, in mosaicing, use fieldid in setimage to control what pointing is used to define the field center, and use fieldid in setdata 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 is terse till a better selection scheme is devised.

The selection is controlled by the mode argument:

none
Selection ignores channel parameters but selects all channels from spectral window ids and field ids selected.
channel
Selection in channels using the nchan, start and step arguments

For channel mode, the other fields have the following meaning:

nchan
is the number of output channels selected. It defaults to 1 (i.e., the first channel).
start
is the first channel from input dataset that is to be used. It defaults to 1 (i.e. first channel).
step
gives the increment between selected input channels.

The channels are centered on velocities: start, start+step, start+2*step, etc.

By choosing the parameters for setdata and setimage 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):

imgr.setimage(mode='channel', nchan=64, start=1, step=8);
imgr.setdata(mode='channel', nchan=512, start=1, step=1)
imgr.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:

imgr.setdata(mode='channel', nchan=64, start=1, step=8)
imgr.setimage(mode='channel', nchan=64, start=1, step=8);
imgr.clean(....);

For velocity and opticalvelocity modes, the mstart and mstep are the start and step velocities as strings.

imgr.setimage(mode='velocity', nchan=64, mstart='20km/s', mstep='-100m/s');
imgr.setdata(mode='velocity', nchan=64, mstart='20km/s', mstep='-100m/s');
imgr.clean();

If the image and data selections differ, then averaging is done during the gridding and degridding process in the image deconvolution.

imgr.setimage(mode='channel', nchan=64, start=1, step=8);
imgr.setdata(mode='channel', nchan=512, start=1, step=1)
imgr.clean()

Note: The channels numbers used in setimage and setdata refers to the same channel. So if a channel is not selected in setdata but is selected in setimage, then blank channels image are made. The example below will result in the having the first 5 channels in the image to be blank.

imgr.setdata(mode='channel', nchan=50, start=6, step=1) #selected chan 6-55
imgr.setimage(mode='channel', nchan=50, start=1, 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 
imgr.clean()

For multi-spectral window cube imaging the selection of the data can be done as follows

imgr.setdata(mode='channel', nchan=[50,60], start=[1,1], step=[1,1],
             spwid=[1,2]) 
imgr.setimage(mode='channel', nchan=110, start=1, step=1, spwid=[1,2]);

The above means that you would make a data selection of 50 channels (starting from 1 steping 1) from the first spectral window and 60 channels (starting from 1 steping 1). The setimage 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).

imgr.setdata(mode='channel', nchan=[50,60], start=[1,1], step=[1,1],
             spwid=[1,2]) 
imgr.setimage(mode='velocity', nchan=200, mstart='20km/s',
             mstep='-100m/s');

Multi ms processing. One can use many ms's to make an image. Setdata is used to select the ms and make the selections. Please note that the imager tool has to be constructed empty to be able to do a multi ms processing.



Arguments

msname in ms to be used for this selection ONLY when no ms is used at contruction
Allowed: String
Default: ''
mode in Type of selection
Allowed: 'none'| 'channel'
nchan in Number of channels to select
Allowed: Vector of Ints
Default: 1
start in Start channels (1-relative)
Allowed: Vector of Ints
Default: 1
step in Step in channel number
Allowed: Vector of Int
Default: 1
spwid in Spectral Window Ids (1 relative) to select
Allowed: Vector of Ints
Default: 1
fieldid in Field Ids (1 relative) to select
Allowed: Vector of Ints
Default: 1
msselect in TQL select string applied as a logical "and" with the other selections
Allowed: String
async in Run asynchronously in the background?
Allowed: Bool
Default: !dowait


Example

A selection that picks the first 512 channels of spectral window 1 and data after the 10th scan.

imgr:=imager('3C273XC1.MS');
imgr.setdata(mode='channel', spwid=1, nchan=512,start=1,step=1, 
             msselect='SCAN_NUMBER > 10')

Example of how to use imager on multiple ms to make an image to make a 2 fields mosaic:



Example
include 'imager.g'
im:=imager();
im.setdata(mode="none" ,  spwid=[1, 2] ,
        fieldid=1, msname='FIELD_1.ms);

im.setdata(mode="none" ,  spwid=[1, 2] ,
        fieldid=1, msname='FIELD_2.ms);

mydir:=dm.direction('J2000','9h10m15.0', '-5d44m5.2')

im.setimage(nx=300, ny=300, cellx='2.0arcsec',
        celly='2.0arcsec' , stokes="I" , doshift=T,
        phasecenter=mydir, spwid=[1:2], fieldid=1);
im.weight('natural')
im.setvp(dovp=T)
im.setoptions(ftmachine='mosaic')
im.make('testB');
im.clean(algorithm='mfclark', niter=2000, gain=0.2, model='testB')
im.done()





next up previous contents index
Next: imager.setimage - Function Up: imager - Tool Previous: imager.setbeam - Function   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15