|
|||
NRAO Home > CASA > CASA Toolkit Reference Manual |
|
simulator.open - Function
2.4.1 Construct a simulator tool and create a new MeasurementSet
Description
A simulator tool can either operate on an existing MeasurementSet, predicting
and/or corrupting data on the existing uvw coordinates
– to do that open the MS with sm.openfromms(msname).
or it can be used to create a new MeasurementSet from descriptions of the array configuration and the observational parameters
– to create a new MS, use this method sm.open(msname).
You will also need to run setconfig, setfield, setspw, setspwindow, setfeed, and settimes.
Creating the actual (empty) MS is accomplished with sm.observe. Data can be subsequently sm.predict-ed and sm.corrupt-ed.
NOTE: sm.predict assumes the model image units are Jy/pixel, and in fact will overwrite the brightness units of the image itself!
Arguments
Inputs |
| ||
ms |
| MeasurementSet to be created
| |
| allowed: | string |
|
| Default: |
|
|
bool
Example
In this example, we read in the antenna coordinates from an ASCII file,
and simulate a single-pointing VLA observation with a calibrator.
Note that no primary beam attenuation will be applied (see sm.setvp).
tabname = ’VLAC.LOCAL.TAB’
asciifile = ’VLAC.LOCAL.STN’
mytab=table.create()
mytab.fromascii(tabname, asciifile);
xx=[]; yy:=[]; zz:=[]; diam:=[];
xx = mytab.getcol(’X’);
yy = mytab.getcol(’Y’);
zz = mytab.getcol(’Z’);
diam = mytab.getcol(’DIAM’);
#
sm.open(’NEW1.ms’)
# do configuration
posvla = me.observatory(’vla’); # me.observatory(’ALMA’) also works!
sm.setconfig(telescopename=’VLA’, x=xx, y=yy, z=zz, dishdiameter=diam,
mount=’alt-az’, antname=’VLA’,
coordsystem=’local’, referencelocation=posvla);
# Initialize the spectral windows
sm.setspwindow(spwname=’CBand’, freq=’5GHz’,
deltafreq=’50MHz’,
freqresolution=’50MHz’,
nchannels=1,
stokes=’RR RL LR LL’);
sm.setspwindow(spwname=’LBand’, freq=’1.420GHz’,
deltafreq=’3.2MHz’,
freqresolution=’3.2MHz’,
nchannels=32,
stokes=’RR LL’);
# Initialize the source and calibrater
sm.setfield(sourcename=’My cal’,
sourcedirection=[’J2000’,’00h0m0.0’,’+45.0.0.000’],
calcode=’A’);
sm.setfield(sourcename=’My source’,
sourcedirection=[’J2000’,’01h0m0.0’,’+47.0.0.000’]);
sm.setlimits(shadowlimit=0.001, elevationlimit=’8.0deg’);
sm.setauto(autocorrwt=0.0);
sm.settimes(integrationtime=’10s’, usehourangle=F,
referencetime=me.epoch(’utc’, ’today’));
sm.observe(’My cal’, ’LBand’, starttime=’0s’, stoptime=’300s’);
sm.observe(’My source’, ’LBand’, starttime=’310s’, stoptime=’720s’);
sm.observe(’My cal’, ’CBand’, starttime=’720s’, stoptime=’1020s’);
sm.observe(’My source’, ’CBand’, starttime=’1030s’, stoptime=’1500s’);
sm.setdata(spwid=1, fieldid=1);
sm.predict(imagename=’M31.MOD’);
sm.setdata(spwid=2, fieldid=2);
sm.predict(imagename=’BigLBand.MOD’);
sm.close();
__________________________________________________________________
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