simulator

class simulator[source]

Tool for simulation

simulator provides a unified interface for simulation of telescope processing. It can create a MeasurementSet from scratch or read in an existing MeasurementSet, it can predict synthesis data onto the (u,v) coordinates or single dish data onto (ra,dec) points, and it can corrupt this data through Gaussian errors, an atmospheric model, or through specific errors residing in (anti-) calibration tables.

In the observing phase, simulator creates a MeasurementSet and calculates uvw values. You first make a simulator tool, with the name of the MeasurementSet that you wish to construct. Next you use the various set* methods to set up the observing (antenna locations, sources, spectral windows, etc.). Then you call the observe method for each observing scan you wish to make, or observemany to create several scans. You specify the source name, spectral window name, and observing times. After this, you have a MeasurementSet that is complete but visibilities=0.

In the prediction phase, you fill a MeasurementSet (either one newly created or a pre-existing one, perhaps from a real telescope) with data from a model or componentlist, and then corrupt the measurements (if desired).

NOTE: sm.predict assumes model image units are Jy/pixel, and in fact will overwrite the brightness units of the image itself!

The ft function of the imager tool can also be used to calculate the model visibility for a model image or componentmodels.

To apply errors, first set up the various effects using the relevant set* methods, and then call corrupt.

Some important details: - One call to observe generates one scan (all rows have the same SCAN_NUMBER). - The start and stop times specified to observe need not be contiguous and so one can simulate antenna drive times or other gaps. - Currently there is only a rudimentary method to calculate patterns of observing (mosaicing), since it is easy to do this via sequences of calls of observe, or simutil::calcpointings, or the simobserve task - The heavy duty columns (DATA, FLAG, IMAGING_WEIGHT, etc. are tiled. New tiles are generated for each scan. Thus the TSM files will not get very large. - predict(incremental=False) calculates new visibilities and replaces the DATA column, - predict(incremental=True) calculates new visibilities, adds them to the DATA column - predict for any value of incremental then sets CORRECTED_DATA equal to DATA, and MODEL_DATA to 1

Methods Summary

close

Close the simulator tool

corrupt

Corrupt the data with visibility errors

done

Close the simulator tool

name

Provide the name of the attached MeasurementSet

observe

Observe a given configuration

observemany

Observe a given configuration

oldsetnoise

Set the noise level fixed sigma (mode=simplenoise) or

open

Construct a simulator tool and create a new MeasurementSet

openfromms

Construct a simulator tool using an already existing MS

predict

Predict astronomical data from an image or components

reset

Reset the corruption terms

setapply

Arrange for corruption by existing cal tables, in a manner

setauto

Set autocorrelation weight

setbandpass

Set the bandpasses

setconfig

Set the antenna configuration

setdata

Set the data parameters selection for subsequent processing

setfeed

Set the feed parameters

setfield

Set one or more observed fields, including name and coordinates.

setgain

Set the gains

setleakage

Set the polarization leakage

setlimits

Set limits for observing

setmosaicfield

Set observed mosaic fields

setnoise

Set the noise level fixed sigma (mode=simplenoise) or

setoptions

Set various processing options

setpa

Corrupt phase by the parallactic angle

setpointingerror

Set the Pointing error

setseed

Set the seed for the random number generator

setspwindow

Set one or more spectral windows for the observations, including

settimes

Set integration time, etc.

settrop

Set tropospheric gain corruptions

setvp

Set the voltage pattern model for subsequent processing

simulator

Construct a simulator tool

summary

Summarize the current state

type

Return the type of this tool

close()[source]

Close the simulator tool

Close tools and write data to disk. This is a synonym for done.

corrupt()[source]

Corrupt the data with visibility errors

Add errors specified by the set* functions (such as noise, gains,

polarization leakage, bandpass, etc) to the visibility data. The errors are applied to the DATA and CORRECTED_DATA columns.

Note that corrupt handles only visibility-plane effects, not image-plane effects such as pointing errors and voltage patterns, which get applied in predict. Note, the function applies errors to both cross- and auto-correlation data; The auto-correlation data are corrupted properly only for the thermalnoise set by setnoise.

done()[source]

Close the simulator tool

Close tools and write data to disk. This is a synonym for done.

name()[source]

Provide the name of the attached MeasurementSet

Returns the name of the attached MeasurementSet.

observe(sourcename='', spwname='', starttime='0s', stoptime='3600s', add_observation=False, state_sig=True, state_ref=False, state_cal=0.0, state_load=0.0, state_sub_scan=0, state_obs_mode='OBSERVE_TARGET.ON_SOURCE', observer='CASA simulator', project='CASA simulation')[source]

Observe a given configuration

Observe a given source with a given spectral window for the specified

times, including start, stop, integration, and gap times.

If usehourangle=False (set with settimes), the start and stop times are referenced to referencetime.

If userhourangle=True, starttime/stoptime are interpreted as startha/stopha, the start and stop times are calculated such that the start time is later than the reference time, but less than one day later, and the hour angles refer to the first source observed.

setconfig, setspwindow, setfeed, and setfield must be run before observe can be run.

See also sm.observemany

Parameters

  • sourcename (string='') - Name of source or field (must be specified)

  • spwname (string='') - Unique user-supplied name for this spectral window

  • starttime (variant='0s') - Start time referenced to referencetime, or start hour angle

  • stoptime (variant='3600s') - Stop time referenced to referencetime, or stop hour angle

  • add_observation (bool=False) - Add a new line to the OBSERVATION subtable for this call

  • state_sig (bool=True) - a new line will be added to STATE if the following don’t match

  • state_ref (bool=False)

  • state_cal (double=0.0)

  • state_load (double=0.0)

  • state_sub_scan (int=0)

  • state_obs_mode (string='OBSERVE_TARGET.ON_SOURCE')

  • observer (string='CASA simulator')

  • project (string='CASA simulation')

observemany(sourcenames=[''], spwname='', starttimes=['0s'], stoptimes=['3600s'], directions=[''], add_observation=False, state_sig=True, state_ref=False, state_cal=0.0, state_load=0.0, state_sub_scan=0, state_obs_mode='OBSERVE\\_TARGET#ON\\_SOURCE', observer='CASA simulator', project='CASA simulation')[source]

Observe a given configuration

Observe given sources with a given spectral window for the specified

times, including start, stop, integration, and gap times.

If usehourangle=False (set with settimes), the start and stop times are referenced to referencetime.

If userhourangle=True, starttime/stoptime are interpreted as startha/stopha, the start and stop times are calculated such that the start time is later than the reference time, but less than one day later, and the hour angles refer to the first source observed.

See also sm.observe

Parameters

  • sourcenames (stringArray=['']) - Name of sources

  • spwname (string='') - Unique user-supplied name for this spectral window

  • starttimes (stringArray=['0s']) - Start times referenced to referencetime, or start hour angle

  • stoptimes (stringArray=['3600s']) - Stop time referenced to referencetime, or stop hour angle

  • directions (stringArray=[''])

  • add_observation (bool=False) - Add a new line to the OBSERVATION subtable for this

    call

  • state_sig (bool=True) - a new line will be added to STATE if the following don’t match

  • state_ref (bool=False)

  • state_cal (double=0.0)

  • state_load (double=0.0)

  • state_sub_scan (int=0)

  • state_obs_mode (string='OBSERVE\_TARGET#ON\_SOURCE')

  • observer (string='CASA simulator')

  • project (string='CASA simulation')

oldsetnoise(mode='calculate', table='', simplenoise='0.0Jy', antefficiency=0.8, correfficiency=0.85, spillefficiency=0.85, tau=0.1, trx=50, tatmos=230.0, tcmb=2.7)[source]
Set the noise level fixed sigma (mode=simplenoise) or

Brown’s equation (mode=calculate) OBSOLETE VERSION

Set various system parameters from which the thermal (ie, random

additive) noise level will be calculated.

For mode=simplenoise, one specifies the standard deviation for the noise to be added to real and imaginary parts of the visibility.

For mode=calculate, the noise will vary with dish diameter, antenna efficiency, system temperature, opacity, sky temperature, etc. The noise will increase with the airmass if tau is greater than zero. The noise is calculated according to the Brown Equation (ie, R.L. Brown’s calculation of MMA sensitivity, 3Oct95): dS = 4*sqrt(2) *( T_rx*exp(-tau_atm) +

T_atm*( exp(tau_atm) - epsilon_l + T_cmb) )

*epsilon_q *epsilon_a *pi *D^2 *sqrt(dnu*dt)

Parameters

  • mode (string='calculate') - Mode of operation. String: ‘simplenoise’|’calculate’

  • table (string='') - Name of noise table - not currently implemented

  • simplenoise (variant='0.0Jy') - Level of noise (if mode=simplenoise)

  • antefficiency (double=0.8) - antenna efficiency

  • correfficiency (double=0.85) - Correlation efficiency

  • spillefficiency (double=0.85) - Forward spillover efficiency

  • tau (double=0.1) - Atmospheric Opacity

  • trx (double=50) - Receiver temp (ie, all non-atmospheric Tsys contributions) [K]

  • tatmos (double=230.0) - (Physical, not Brightness) Temperature of atmosphere [K]

  • tcmb (double=2.7) - Temperature of cosmic microwave background [K]

open(ms='')[source]

Construct a simulator tool and create a new MeasurementSet

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!

Parameters

  • ms (string='') - MeasurementSet to be created

openfromms(ms='')[source]

Construct a simulator tool using an already existing MS

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 sm.open(msname).

NOTE: sm.predict assumes the model image units are Jy/pixel, and in

fact will overwrite the brightness units of the image itself!

Parameters

  • ms (string='') - MeasurementSet to be processed

predict(imagename=[''], complist='', incremental=False)[source]

Predict astronomical data from an image or components

Predict astronomical data from an image. The (u,v) coordinates

already exist, either from a MeasurementSet we have read in or by generating the MeasurementSet coordinates and empty data through smobserve. This method calculates visibilities for those coordinates.

  • predict(incremental=False) calculates new visibilities and replaces the DATA column,

  • predict(incremental=True) calculates new visibilities, adds them to the DATA column

  • predict for any value of incremental then sets CORRECTED_DATA equal to DATA, and MODEL_DATA to 1

  • predict assumes model image units are Jy/pixel, and in fact will overwrite the brightness units of the image itself!

  • treatment of primary beam depends critically on parameters set in sm.setvp() and sm.setoptions(ftmachine) - see help sm.setvp for details. For componentlists, if sm.setvp() is run prior to predict, then the spectral variation of each component in the componentlist will include the multiplicative term of the beam value for each channel frequency. So a flat spectrum component will show the frequency variation of the beam in the predicted visibilities.

Parameters

  • imagename (stringArray=['']) - Name of image from which to predict visibilities

  • complist (string='') - Name of component list

  • incremental (bool=False) - Add this model to the existing Data Visibilities?

reset()[source]

Reset the corruption terms

Reset the visibility corruption terms: this means that corrupt

introduces no errors.

setapply(table='', type='B', t=0.0, field='', interp='aipslin', calwt=False, spwmap=[- 1], opacity=0.0)[source]
Arrange for corruption by existing cal tables, in a manner

exactly analogous to calibrater.setapply.

Parameters

  • table (string='') - Calibration table name

  • type (string='B') - Component type

  • t (double=0.0) - Interpolation interval (seconds)

  • field (variant='') - Select on field

  • interp (string='aipslin') - Interpolation type (in time)

  • calwt (bool=False) - Calibrate weights?

  • spwmap (intArray=[-1]) - Spectral windows to apply

  • opacity (double=0.0) - Array-wide zenith opacity (for type=’TOPAC’)

setauto(autocorrwt=0.0)[source]

Set autocorrelation weight

Parameters

  • autocorrwt (double=0.0) - Weight to assign autocorrelations (0=none)

setbandpass(mode='calculate', table='', interval='3600s', amplitude=[0.0])[source]

Set the bandpasses

Set the level of bandpass errors. The error distributions are normal, mean

zero, with the variances as specified. (Not yet implemented).

Parameters

  • mode (string='calculate') - Mode of operation. String: ‘calculate’|’table’

  • table (string='') - Name of table

  • interval (variant='3600s') - Coherence interval e.g. ‘1h’

  • amplitude (doubleArray=[0.0]) - Variances errors in amplitude and phase

setconfig(telescopename='VLA', x=[0], y=[0], z=[0], dishdiameter=[0], offset=[0], mount=['ALT-AZ'], antname=['A'], padname=['P'], coordsystem='global', referencelocation='ALMA')[source]

Set the antenna configuration

Set the positions of the antennas.
  • The name of the telescope will control which voltage pattern is applied to the data (see sm.setvp for details).

  • The diameter(s) will be written to the antenna subtable but ONLY affect the calculated visibilities in sm.predict if telescope=ALMA,ACA,OVRO, and ftmachine=mosaic (see sm.setvp for details).

  • simutil::readantenna can be used to read an antenna config. file which includes many existing observatories. see help for the simobserve task, or the example below

Parameters

  • telescopename (string='VLA') - Name of the telescope we are simulating (determines VP)

  • x (doubleArray=[0]) - Vector of x values of all antennas [m]

  • y (doubleArray=[0]) - Vector of y values of all antennas [m]

  • z (doubleArray=[0]) - Vector of z values of all antennas [m]

  • dishdiameter (doubleArray=[0]) - Vector of diameters of all antennas [m]

  • offset (doubleArray=[0]) - Vector of offset of all antennas [m]

  • mount (stringArray=['ALT-AZ']) - Vector of mount types of all antennas (recognized mounts are ‘ALT-AZ’, ‘EQUATORIAL’, ‘X-Y’, ‘ORBITING’, ‘BIZARRE’

  • antname (stringArray=['A']) - Vector of names of all antennas

  • padname (stringArray=['P']) - Vector of names of pads or stations

  • coordsystem (string='global') - Coordinate system of antenna positions [x,y,z],

    possibilities are ‘global’, ‘local’ , ‘longlat’

  • referencelocation (variant='ALMA') - Reference location [required for local coords] Position Measure of Coordinates of array location. E.g me.position(‘ITRF’, ‘30.5deg’, -20.2deg’, 6000km’) or me.observatory(‘ALMA’)

setdata(spwid=[0], fieldid=[0], msselect='')[source]

Set the data parameters selection for subsequent processing

This setup tool function selects which data are to be used

subsequently. After invocation of setdata, only the selected data are operated on.

Parameters

  • spwid (intArray=[0]) - Spectral Window Ids (0 relative) to select

  • fieldid (intArray=[0]) - Field Ids (0 relative) to select

  • msselect (string='') - TAQL select string applied as a logical “and” with the other selections

setfeed(mode='', x=[0], y=[0], pol=['R'])[source]

Set the feed parameters

Specify feed parameters. At this moment, you only have the choice

between ‘perfect R L’ and ‘perfect X Y’ (i.e., you cannot invent your own corrupted feeds yet). Doesn’t need to be run if you want perfect R and L feeds.

Parameters

  • mode (string='') - Mode for specifying feed parameters (currently, perfect only)

  • x (doubleArray=[0]) - Some very secretive feed array parameter x

  • y (doubleArray=[0]) - Some more very secretive feed array parameter y

  • pol (stringArray=['R'])

setfield(sourcename='SOURCE', sourcedirection='', calcode='', distance='0m')[source]
Set one or more observed fields, including name and coordinates.

Can be invoked multiple times for a complex observation. Must be invoked at least once before sm.observe.

If the distance to the object is set then the phase term includes a curvature for the near-field effect at the center of the image.

Parameters

  • sourcename (string='SOURCE') - Name of source or field (must be specified)

  • sourcedirection (variant='') - Direction Measure of Coordinates of source to be observed. E.g me.direction(‘J2000’, ‘30.5deg’,’-20.2deg’).

  • calcode (string='') - Calibration code

  • distance (variant='0m') - Distance to the object

setgain(mode='fbm', table='', interval='10s', amplitude=[0.01])[source]

Set the gains

Set the level of gain errors. Gain drift is implemented as

fractional brownian motion with rms amplitude as specified. Interval is not currently used.

Parameters

  • mode (string='fbm') - Mode of operation. String: ‘fbm’

  • table (string='') - Optional name of table to write

  • interval (variant='10s') - timescale for gain variations NOT USED

  • amplitude (doubleArray=[0.01]) - amplitude scale (RMS) for gain variations [real,imag] or scalar

setleakage(mode='constant', table='', amplitude=[0.01], offset=[0.0])[source]

Set the polarization leakage

Set the level of polarization leakage between feeds.

Currently, no time dependence is available.

Parameters

  • mode (string='constant') - Mode of operation. String: ‘constant’

  • table (string='') - Optional name of table to write

  • amplitude (doubleArray=[0.01]) - Magnitude of pol leakage [real,imag]

  • offset (doubleArray=[0.]) - Meam of pol leakage [real,imag]

setlimits(shadowlimit=1e-06, elevationlimit='10deg')[source]

Set limits for observing

Data are flagged for two conditions:

  • Below elevation limit: If either of the antennas point below the

specified elevation limit then the data are flagged. The elevation is calculated correctly for antennas at different locations (such as occurs in VLBI).

  • Shadowing: If one antenna shadows another such that the fractional

(geometric) blockage is greater than the specified limit then the data are flagged. No correction for blockage is made for shadowed but non-flagged points.

Parameters

  • shadowlimit (double=1e-6) - Maximum fraction of geometrically shadowed area before flagging occurs

  • elevationlimit (variant='10deg') - Minimum elevation angle before flagging occurs

setmosaicfield(sourcename='SOURCE', calcode='', fieldcenter='', xmosp=1, ymosp=1, mosspacing='1arcsec', distance='0m')[source]

Set observed mosaic fields

Set mosaic fields by internally invoking setfield multiple times.

Currently only handle a rectangular mosaicing pattern. Either setfield or setmosaicfield must be invoked at least once before observe.

If the distance to the object is set then the phase term includes a curvature for the near-field effect at the center of the image.

Parameters

  • sourcename (string='SOURCE') - Name of source or field (must be specified).

  • calcode (string='') - Calibration code

  • fieldcenter (variant='') - Coordinates of mosaic field center

  • xmosp (int=1) - Number of mosaic pointing in horizontal direction

  • ymosp (int=1) - Number of mosaic pointing in vertical direction

  • mosspacing (variant='1arcsec') - Spacing between mosaic pointings

  • distance (variant='0m') - Distance to the object

setnoise(mode='simplenoise', table='', simplenoise='0.1Jy', pground='560mbar', relhum=20.0, altitude='5000m', waterheight='200m', pwv='1mm', tatmos=250.0, tau=0.1, antefficiency=0.8, spillefficiency=0.85, correfficiency=0.88, trx=50, tground=270.0, tcmb=2.73, OTF=True, senscoeff=0.0, rxtype=0)[source]
Set the noise level fixed sigma (mode=simplenoise) or

Brown’s equation using the ATM model for frequency-dependent atmospheric opacity (mode=tsys-atm) or Brown’s equation, manually specifying the zenith opacity (constant across the band) and atmospheric temperature (mode=tsys-manual)

Set various system parameters from which the thermal (ie, random

additive) noise level will be calculated.

For mode=simplenoise, one specifies the standard deviation “sigma” for the noise to be added to real and imaginary parts of the visibility. The noise in amplitude per visibility is approximately “sigma” although

it is not Gaussian (see Thompson, Moran, and Swenson fig. 6.9)

and the point source noise in a Stokes I image will be

~sigma/sqrt(n_pol)/sqrt(n_baselines)/sqrt(n_integrations),

where n_pol are the number of polarizations in the MS (typically 2), and n_integrations are the number of correlator integration times in the MS (~ track time / int. time)

For mode=tsys-atm or tsys-atm, the noise will vary with dish diameter, antenna efficiency, system temperature, opacity, sky temperature, etc. The noise will increase with the airmass if tau is greater than zero. The noise is calculated according to the Brown Equation (ie, R.L. Brown’s calculation of MMA sensitivity, 3Oct95): dS = 4*sqrt(2) *( T_rx*exp(-tau_atm) +

T_atm*( exp(tau_atm) - epsilon_l + T_cmb) )

*epsilon_q *epsilon_a *pi *D^2 *sqrt(dnu*dt)

For mode=tsys-atm, the sky brightness temperature is calculated using an atmospheric model created for the user-input PWV. For mode=tsys-manual, the user specifies the sky brightness temperature manually.

Parameters

  • mode (string='simplenoise') - Mode of operation.

  • table (string='') - Name of optional cal table to write (if OTF=False)

  • simplenoise (variant='0.1Jy') - Level of noise if not calculated by amt

  • pground (variant='560mbar') - Ground pressure for ATM model (if tsys-atm)

  • relhum (double=20.0) - ground relative humidity for ATM model (if tsys-atm)

  • altitude (variant='5000m') - site altitude for ATM model (if tsys-atm)

  • waterheight (variant='200m') - Height of water layer for ATM model (if tsys-atm)

  • pwv (variant='1mm') - Precipitable Water Vapor ATM model (if tsys-atm)

  • tatmos (double=250.0) - Temperature of atmosphere [K] (if tsys-manual)

  • tau (double=0.1) - Zenith Atmospheric Opacity (if tsys-manual)

  • antefficiency (double=0.8) - Antenna efficiency

  • spillefficiency (double=0.85) - Forward spillover efficiency

  • correfficiency (double=0.88) - Correlation efficiency

  • trx (double=50) - Receiver temp (ie, all non-atmospheric Tsys contributions) [K]

  • tground (double=270.0) - Temperature of ground/spill [K]

  • tcmb (double=2.73) - Temperature of cosmic microwave background [K]

  • OTF (bool=True) - calculate noise on-the-fly (WARNING: only experts with high-RAM machines should use False)

  • senscoeff (double=0.) - sensitivity constant (1./sqrt(2) for interferometer [default]; 1. for total power)

  • rxtype (int=0) - Receiver type; 0=2SB, 1=DSB e.g. ALMA B9

setoptions(ftmachine='ft', cache=0, tile=16, gridfunction='SF', location='ALMA', padding=1.3, facets=1, maxdata=2000.0, wprojplanes=1)[source]

Set various processing options

Set options for predict. See also imager help.

To simulate single dish data, use gridft=SD and gridfunction=PB.

To invoke primary beam convolution in the uv domain, use ftmachine=”mosaic”. This is the only option that allows heterogeneous array simulation - see the example below and help sm.setvp for more details.

Parameters

  • ftmachine (string='ft') - Fourier transform machine. Possibilities are ‘ft’, ‘sd’, ‘mosaic’

  • cache (int=0) - Size of gridding cache in complex pixels

  • tile (int=16) - Size of a gridding tile in pixels (in 1 dimension)

  • gridfunction (string='SF') - Gridding function. String: ‘SF’|’BOX’|’PB’

  • location (variant='ALMA') - Location used in phase rotations. Position Measure of Coordinates of array location. E.g me.position(‘ITRF’, ‘30.5deg’, ‘-20.2deg’, ‘6000km’) or me.observatory(‘ALMA’)

  • padding (double=1.3) - Padding factor in image plane (>=1.0)

  • facets (int=1) - Number of facets

  • maxdata (double=2000.0) - Maximum data to write to a single TSM file (MB)

  • wprojplanes (int=1) - Number of projection planes when using wproject as the ft-machine

setpa(mode='calculate', table='', interval='10s')[source]

Corrupt phase by the parallactic angle

Parameters

  • mode (string='calculate') - Mode of operation. String: ‘calculate’|’table’

  • table (string='') - Name of table

  • interval (variant='10s') - Interval for parallactic angle application, e.g. ’10s’

setpointingerror(epjtablename='', applypointingoffsets=False, dopbcorrection=False)[source]

Set the Pointing error

Set the pointing error from a calpointing table

Parameters

  • epjtablename (string='') - Name of a table that has E-Jones errors for Pointing

  • applypointingoffsets (bool=False) - Apply pointing offsets

  • dopbcorrection (bool=False) - apply primary beam correction

setseed(seed=185349251)[source]

Set the seed for the random number generator

Parameters

  • seed (int=185349251) - Seed

setspwindow(spwname='XBAND', freq='8.0e9Hz', deltafreq='50e6Hz', freqresolution='50.e6Hz', refcode='TOPO', nchannels=1, stokes='RR LL')[source]
Set one or more spectral windows for the observations, including

starting frequency, number of channels, channel increment and resolution, and stokes parameters observed. Can be invoked multiple times for a complex observation. Must be invoked at least once before observe.

Parameters

  • spwname (string='XBAND') - Unique user-supplied name for this spectral window

  • freq (variant='8.0e9Hz') - Starting frequency

  • deltafreq (variant='50e6Hz') - Frequency increment per channel

  • freqresolution (variant='50.e6Hz') - Frequency resolution per channel

  • refcode (string='TOPO') - Spectral reference code e.g. LSRK, TOPO, BARY

  • nchannels (int=1) - Number of channels

  • stokes (string='RR LL') - Stokes types to simulate

settimes(integrationtime='10s', usehourangle=True, referencetime='50000.0d')[source]

Set integration time, etc.

This method sets values to be used in sm.observe.

If usehourangle=False, the start and stop times in sm.observe are referenced to referencetime.

If usehourangle=True, then in sm.observe, starttime/stoptime will be interpreted as startha/stopha. In that case, the start and stop times are calculated such that the start time is later than the reference time, but less than one day later. The hour angles refer to the first source observed.

Parameters

  • integrationtime (variant='10s') - Integration time

  • usehourangle (bool=True) - Use starttime/stoptime as hour angles - else they are referenced to referencetime

  • referencetime (variant='50000.0d') - Reference time for starttime and stoptime. Epoch Measure . E.g me.epoch(‘UTC’, ‘50000.0d’)

settrop(mode='screen', table='', pwv=3.0, deltapwv=0.15, beta=1.1, windspeed=7.0)[source]

Set tropospheric gain corruptions

Set up for corruption by the atmosphere - attenuation and increase in

noise.

Parameters

  • mode (string='screen') - Mode of operation - screen or individual antennas

  • table (string='') - Name of optional cal table to write

  • pwv (double=3.0) - total precipitable water vapour in mm

  • deltapwv (double=0.15) - RMS PWV fluctuations as a fraction of PWV parameter

  • beta (double=1.1) - exponent of fractional brownian motion

  • windspeed (double=7.) - wind speed for screen type corruption (m/s)

setvp(dovp=True, usedefaultvp=True, vptable='', dosquint=True, parangleinc='360deg', skyposthreshold='180deg', pblimit=0.01)[source]

Set the voltage pattern model for subsequent processing

Set the voltage pattern model (and hence, the primary beam) used

for a Telecope. There are currently two ways to set the voltage pattern: by using the extensive list of defaults which the system knows about, or by creating a voltage pattern description with the vpmanager. If you are simulating a telescope which doesn’t yet exist, you will need to supply a model voltage pattern using the vpmanager.

sm.predict behavior depends critically on the parameters here, and the ftmachine parameter set in sm.setoptions

sm.predict will always query the vpmanager for a primary beam/VP pattern. if usedefaultvp==True, it will reset the vpmanager first, so that

the PB obtained will be the default for the given telescope name

if usedefaultvp==False, it will check whether vptable is set, and if so,

load that table into the vpmanager and use the beams therein.

if usedefaultvp==False and vptable is not set, it will use whatever is

already set in the vpmanager (see example below for overriding a default telescope beam).

What sm.predict does with the obtained PB depends on the ftmachine and dovp parameters:

if ftmachine==”mosaic”: - a message “Performing Mosaic Gridding” indicates that one is using

uv domain convolution for simulating from images.

  • if the primary beam returned by the vpmanager is ALMA, ACA, or OVRO, heterogeneous gridding will be invoked, and the dish diameter set in sm.setconfig, or already in the antenna subtable, will be used to convolve sky model images. for ALMA or ACA, dish diameter =12m will use a 10.7m Airy pattern, and dish diameter =7m will use a 6.25m Airy pattern. see help sm.setoptions for an example.

  • otherwise the PB returned by the vpmanager will be used.

  • heterogeneous simulation only works at present from a sky model image, NOT from sky model components. If you want to simulate a heterogeneous array, please add components to an image using ia.modify, and don’t specify a component list in sm.predict. Homogeneous array simulation from component lists works fine.

  • IF dovp=True, the primary beam returned by the vpmanager will be used to convolve sky model components. This is not automatically invoked by ftmachine=”mosaic”, but needs to be set explicitly with sm.setvp() if you are simulating from components in addition to or instead of sky model images.

if ftmachine==”ft” (the default): - a message “Synthesis Gridding” indicates that if requested with

dovp==True, image domain PB convolution will be used.

  • if dovp==True, the primary beam returned by the vpmanager will be

used to convolve sky model components and images.

Parameters

  • dovp (bool=True) - Multiply by the voltage pattern (ie, primary beam) when simulating

  • usedefaultvp (bool=True) - Look up the default VP for this telescope and frequency?

  • vptable (string='') - If usedefaultvp is false, provide a VP Table made with vpmanager

  • dosquint (bool=True) - Activate the beam squint in the VP model

  • parangleinc (variant='360deg') - Parallactice angle increment for squint application

  • skyposthreshold (variant='180deg') - Position threshold on the sky for feed arrays ??

  • pblimit (double=1.0e-2) - Primary beam limit to use in feed arrays ?

simulator()[source]

Construct a simulator tool

Create a simulator tool.

summary()[source]

Summarize the current state

Writes a summary of the currently set properties to the default logger.

type()[source]

Return the type of this tool

This function returns the string `Simulator’. It is used so that in a

script, you can make sure this variable is a simulator tool.