DOsimulator.h

Classes

simulator -- Simulates MeasurementSets from SkyModel and SkyEquation (full description)

class simulator : public ApplicationObject

Interface

Public Members
simulator(MeasurementSet &thems)
Bool open(MeasurementSet &thems)
Bool close()
String name() const
simulator()
simulator(const simulator &other)
simulator &operator=(const simulator &other)
~simulator()
Bool setconfig(const String& telname, const Vector<Double>& x, const Vector<Double>& y, const Vector<Double>& z, const Vector<Float>& dishDiameter, const Vector<String>& mount, const Vector<String>& antName, const String& coordsystem, const MPosition& referenceLocation)
Bool setfield(const uInt rowID, const String& sourceName, const MDirection& sourceDirection, const Int intsPerPointing, const Int mosPointingsX, const Int mosPointingsY, const Float& mosSpacing, const Quantity& distance)
Bool settimes(const Quantity& integrationTime, const Quantity& gapTime, const Bool useHourAngle, const Quantity& startTime, const Quantity& stopTime, const MEpoch& refTime)
Bool setspwindow(const uInt rowID, const String& spwName, const Quantity& freq, const Quantity& deltafreq, const Quantity& freqresolution, const Int nchannels, const String& stokes)
Bool setfeed(const String& mode)
Bool setvp(const Bool dovp, const Bool defaultVP, const String& vpTable, const Bool doSquint, const Quantity &parAngleInc)
Bool setseed(const Int seed)
Bool setgain(const String& mode, const String& table, const Quantity& interval, const Vector<Double>& amplitude)
Bool setleakage(const String& mode, const String& table, const Quantity& interval, const Double amplitude)
Bool setbandpass(const String& mode, const String& table, const Quantity& interval, const Vector<Double>& amplitude)
Bool setpa(const String& mode, const String& table, const Quantity& interval)
Bool setnoise(const String& mode, const Quantity& simplenoise, const String& table, const Float antefficiency, const Float correfficiency, const Float spillefficiency, const Float tau, const Float trx, const Float tatmos, const Float tcmb)
Bool corrupt()
Bool create(const String& newMSName, const Double shadowFraction, const Quantity& elevationLimit, const Float autocorrwt=0.0)
Bool add(const Double shadowFraction, const Quantity& elevationLimit, const Float autocorrwt=0.0)
Bool predict(const Vector<String>& modelImage, const String& compList, const Bool incremental)
String state()
Bool summary()
Bool reset()
Bool setoptions(const String& ftmachine, const Int cache, const Int tile, const String& gridfunction, const MPosition& mLocation, const Float padding, const Int facets)
virtual String className() const
virtual Vector<String> methods() const
virtual Vector<String> noTraceMethods() const
virtual MethodResult runMethod(uInt which, ParameterSet &inputRecord, Bool runMethod)
Private Members
Bool detached() const
void defaults()
void createHelp()
Bool createSummary(LogIO& os)
Bool configSummary(LogIO& os)
Bool fieldSummary(LogIO& os)
Bool spWindowSummary(LogIO& os)
Bool feedSummary(LogIO& os)
Bool timeSummary(LogIO& os)
Bool predictSummary(LogIO& os)
Bool vpSummary(LogIO& os)
Bool optionsSummary(LogIO& os)
Bool corruptSummary(LogIO& os)
Bool gainSummary(LogIO& os)
Bool leakageSummary(LogIO& os)
Bool bandpassSummary(LogIO& os)
Bool paSummary(LogIO& os)
Bool noiseSummary(LogIO& os)
Bool createSkyEquation( const Vector<String>& image, const String complist)
void destroySkyEquation()
Bool checkFields()
Bool fieldsContiguous(Bool doFix)
void resizeFields(const uInt newsize)
Bool checkSpWindows()
Bool spWindowsContiguous(Bool doFix)
void resizeSpWindows(const uInt newsize)

Description

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

The name MUST have the 'DO' prefix as this class is derived from ApplicationObject, and hence is classified as a distributed object. For the same reason the rest of its name must be in lower case. This class simulates visibility data, so it is called DOsimulator.

Synopsis

Motivation

This class was written to make the simulation capability useful from glish

Thrown Exceptions

To Do

Member Description

simulator(MeasurementSet &thems)

"simulator" ctor

Bool open(MeasurementSet &thems)

Close the current ms, and replace it with the supplied ms.

Bool close()

Flush the ms to disk and detach from the ms file. All function calls after this will be a no-op.

String name() const

Return the name of the MeasurementSet

simulator()

simulator(const simulator &other)

simulator &operator=(const simulator &other)

~simulator()

Bool setconfig(const String& telname, const Vector<Double>& x, const Vector<Double>& y, const Vector<Double>& z, const Vector<Float>& dishDiameter, const Vector<String>& mount, const Vector<String>& antName, const String& coordsystem, const MPosition& referenceLocation)

set the configuration; NOTE: the telname used here will determine the Voltage Pattern to be used in the simulation

Bool setfield(const uInt rowID, const String& sourceName, const MDirection& sourceDirection, const Int intsPerPointing, const Int mosPointingsX, const Int mosPointingsY, const Float& mosSpacing, const Quantity& distance)

set the observed fields for the simulation

Bool settimes(const Quantity& integrationTime, const Quantity& gapTime, const Bool useHourAngle, const Quantity& startTime, const Quantity& stopTime, const MEpoch& refTime)

set the required times for the simulation

Bool setspwindow(const uInt rowID, const String& spwName, const Quantity& freq, const Quantity& deltafreq, const Quantity& freqresolution, const Int nchannels, const String& stokes)

set one or more spectral windows and their characteristics

Bool setfeed(const String& mode)

Set the simulated feed characteristics (currently brain dead version, only takes "perfect R L" or "perfect X Y")

Bool setvp(const Bool dovp, const Bool defaultVP, const String& vpTable, const Bool doSquint, const Quantity &parAngleInc)

Set the voltage pattern

Bool setseed(const Int seed)

Set the random number generator seed for the addition of errors

Bool setgain(const String& mode, const String& table, const Quantity& interval, const Vector<Double>& amplitude)

Apply antenna-based gain errors

Bool setleakage(const String& mode, const String& table, const Quantity& interval, const Double amplitude)

Apply polarization leakage errors

Bool setbandpass(const String& mode, const String& table, const Quantity& interval, const Vector<Double>& amplitude)

Apply bandpass errors

Bool setpa(const String& mode, const String& table, const Quantity& interval)

Simulate the parallactic angle phase effect

Bool setnoise(const String& mode, const Quantity& simplenoise, const String& table, const Float antefficiency, const Float correfficiency, const Float spillefficiency, const Float tau, const Float trx, const Float tatmos, const Float tcmb)

Simulate quasi-realistic thermal noise, which can depend upon elevation, bandwidth, antenna diameter, as expected

Bool corrupt()

const Quantity& trx, const Quantity& tatmos, const Quantity& tcmb);

calculate errors and apply them to the data in our MS

Bool create(const String& newMSName, const Double shadowFraction, const Quantity& elevationLimit, const Float autocorrwt=0.0)

Create a MS from a file containing the names of various parameter files (ie, fields, spectral window, etc -- see MeasurementSets/MSSimulator for more info).

Bool add(const Double shadowFraction, const Quantity& elevationLimit, const Float autocorrwt=0.0)

add new visibilities as described by the set methods to an existing or just created measurement set

Bool predict(const Vector<String>& modelImage, const String& compList, const Bool incremental)

Given a model image, predict the visibilities onto the (u,v) coordinates of our MS

String state()

Bool summary()

Bool reset()

Bool setoptions(const String& ftmachine, const Int cache, const Int tile, const String& gridfunction, const MPosition& mLocation, const Float padding, const Int facets)

Set the processing options

virtual String className() const

Stuff needed for distributing this class

virtual Vector<String> methods() const

virtual Vector<String> noTraceMethods() const

virtual MethodResult runMethod(uInt which, ParameterSet &inputRecord, Bool runMethod)

If your object has more than one method

Bool detached() const

Prints an error message if the simulator DO is detached and returns True.

void defaults()

set up some defaults

void createHelp()

print out some help about create()

Bool createSummary(LogIO& os)
Bool configSummary(LogIO& os)
Bool fieldSummary(LogIO& os)
Bool spWindowSummary(LogIO& os)
Bool feedSummary(LogIO& os)
Bool timeSummary(LogIO& os)
Bool predictSummary(LogIO& os)
Bool vpSummary(LogIO& os)
Bool optionsSummary(LogIO& os)
Bool corruptSummary(LogIO& os)
Bool gainSummary(LogIO& os)
Bool leakageSummary(LogIO& os)
Bool bandpassSummary(LogIO& os)
Bool paSummary(LogIO& os)
Bool noiseSummary(LogIO& os)

individual summary() functions

Bool createSkyEquation( const Vector<String>& image, const String complist)
void destroySkyEquation()

info for coordinates and station locations

Bool fieldsContiguous(Bool doFix)

info for observed field parameters this will grow into an observing schedule

check to see if rows are contiguous; returns True if fields were contiguous in row numbers (ie, vectors had no gaps. if doFix==True, we remove any empty rows

void resizeFields(const uInt newsize)

info for observed field parameters this will grow into an observing schedule

resizes field vectors

Bool checkFields()

info for observed field parameters this will grow into an observing schedule

Bool spWindowsContiguous(Bool doFix)

info for spectral window parameters

check to see if rows are contiguous; returns True if spwindows were contiguous in row numbers (ie, vectors had no gaps. if doFix==True, we remove any empty rows

void resizeSpWindows(const uInt newsize)

info for spectral window parameters

resizes spWindow vectors

Bool checkSpWindows()

pointer to VPSkyJones for the sky equation

Saving some information about the various corrupting terms