SimpleSimulator.h

Classes

SimpleSimulator -- a simple simulated MS writer (full description)

class SimpleSimulator

Interface

Public Members
SimpleSimulator(SimObservations *obs)
SimpleSimulator(SimObservations *obs, const String& msname)
virtual ~SimpleSimulator()
Float getAutoCorrWeight() const
void setAutoCorrWeight(Float wt)
Quantity getElevationLimit() const
void setElevationLimit(const Quantity& limit)
Double getFractionalBlockageLimit() const
void setFractionalBlockageLimit(Double limit)
void write(const MEpoch& start, const Quantity& duration, const SimScan& scan)
Bool writeObsRecord()
Protected Members
static void blockage(Double &fraction1, Double &fraction2, const Vector<Double>& uvw, const Double diam1, const Double diam2)
SimpleSimulator()
SimpleSimulator(SimObservations *obs, MeasurementSet& ms)
void attach(MeasurementSet *ms)

Description

Prerequisite

Etymology

This class is simulator that uses a simple observational model that is typical of modern "guest observer" interferometers.

Synopsis

Despite the "Simple" in its name, this class is capable of driving simulated interometric observations using a variety of typical observing patterns. At its simplest, it can integrate on a single source for a set amount of time; at its most complex it can observe a pattern of fields, switch between sources (e.g. target and calibrator), switch between polarization set ups, and fill multiple spectral windows. It does assume that it will write all its data to a single MeasurementSet that it creates.

This class uses a general pattern intended for a whole class of simulators of which this simulator is one. In this pattern, the application first defines the telescope's hardware--i.e. the antennas, the feeds and polarizations, and the spectral windows, via a SimTelescope object. Next, the SimTelescope is passed to a SimObservation object, and the observational configurations are added; this includes the sources, fields, spectral lines, and window-polarization combinations (i.e. data descriptions). The SimObservation object is then passed to the constructor of a simulator. One can then define some global properties of the observations, include blockage and elevation limits.

The simulations are carried out by a series of calls to the write() function. This causes the definition of the telescope and the observational parameters to be written to the output MS along with integration records in the MS's main table for each baseline, data description, and timestamp over some interval of time. Note that the MS's DATA column will be filled with zeros; it is intended that visibilities based on a source model will be filled into this column later using the Measurment Equation.

Each call to the write() function represents a new scan. The parameters that define the scan are a start time, a duration, and the various properties held in a SimScan object. In non-trivial simulation, an application may manage several SimScan objects, each containing the configuration choices for the different phases of the observations. For example, if the observational program observes multiple sources, the application would have one SimScan for each source.

The writeObsRecord() function is meant to be called after a series of calls to write(), marking a major transition point in the observations (e.g. switch to a new day or track). It should be called at least once at the end of the observations. This will write out a record to the OBSERVATION subtable and increment the OBSERVATION_ID that is written to the main table.

Data is flushed after every call to write() and writeObsRecord(); thus, it is possible for other classes to open the output measurement set for read-only access. Destructing the class closes out the measurment set permanently.

It is possible after calls to write() to add to the telescopes configuration--e.g. add antennas, windows, sources, etc. When write() is called again, the new configuration will get flushed to the MS automatically.

Motivation

This replaces the functionality of the MSSimulator class and is based on the more flexible SimTelescope & SimObservations classes. Together, these classes are capable of simulated the most typical types of observations carried out by interferometers like the VLA, BIMA, ATCA, ....

To Do

Member Description

SimpleSimulator(SimObservations *obs)

Create a simulator. This will operate on the MS that is currently attached to obs; an exception is thrown if none is yet attached.

SimpleSimulator(SimObservations *obs, const String& msname)

Create a simulator that will create a new measurement set with a given name.

virtual ~SimpleSimulator()

delete this simulator

Float getAutoCorrWeight() const
void setAutoCorrWeight(Float wt)

get and set the autocorrelation weight. If the weight is <= 0.0 (the default), autocorrelation is not written out. For cross-correlation records, the value in the WEIGHT column is set to 1/sigma. For autocorrelation records, the 1/sigma value is multiplied by this autocorrelation weight value.

Quantity getElevationLimit() const
void setElevationLimit(const Quantity& limit)

get and set the elevation limit.

Double getFractionalBlockageLimit() const
void setFractionalBlockageLimit(Double limit)

get and set the fractional shadowing limit.

void write(const MEpoch& start, const Quantity& duration, const SimScan& scan)

write out the next scan. Each call to write increments the scan number written to the MS's main table.

Bool writeObsRecord()

write out an OBSERVATION record for the scans written so far. If write() has not yet been called, the observation internally stored start and end times will be undefined, and no record will be written out. In this case, False will be returned. Otherwise, True is returned, and the times will be reset to undefined.

static void blockage(Double &fraction1, Double &fraction2, const Vector<Double>& uvw, const Double diam1, const Double diam2)

calculate the amount of shadowing between 2 antennas

SimpleSimulator()

SimpleSimulator(SimObservations *obs, MeasurementSet& ms)

Create a simulator that will extend an existing MS. This is not currently supported; thus, this constructor always throws an exception.

void attach(MeasurementSet *ms)

create an MS with the necessary optional tables