SimPol.h

Classes

SimPol -- a container for data destined for an MS POLARIZATION record (full description)
SimPolList -- a container for data destined for an MS POLARIZATION table (full description)

class SimPol

Interface

Public Members
SimPol()
SimPol(const Vector<Stokes::StokesTypes>& corrTypes, const SimFeed& feed1, const SimFeed& feed2)
SimPol(const SimPol& other)
SimPol& operator=(const SimPol& other)
virtual ~SimPol()
uInt feed1() const
uInt feed2() const
const Matrix<Int>& corrProducts() const
const Vector<Int>& corrTypes() const
uInt numTypes() const
Stokes::StokesTypes getCorrType(Int i) const
Bool setCorrProducts(const Vector<Stokes::StokesTypes>& corrTypes, const SimFeed& feed1, const SimFeed& feed2)
Bool canUseFeed(const SimFeed& feed, Bool asFeed1)
Int getId() const
void setId(Int id)
Private Members
void requiredReceptors(uInt& need1, uInt& need2, Vector<String>& stokes) const

Description

Prerequisite

Etymology

This is a container for describing a polarization setup for a simulated telescope.

Synopsis

This describes a set of polarization correlations that are allowed from a set of feeds. The data model for this class relates closely to that of the POLARIZATION table, indicating which feeds and which receptors are cross-correlated to produce the set of correlations. This container is used to define simulated observations. Simulators would not normally create these objects directly but rather implicitly via the SimTelescope class.

The correlation types, set either at construction or vis setCorrProducts(), are represented as values from the Stokes::StokesTypes enumeration. To help ensure consistancy with the FEED table, one must also provide the SimFeed objects for the feeds being correlated; these feeds will be checked to ensure that the combinations are possible with the receptors associated with the given feeds.

A row marker, set with setId(), is used by SimPolList to indicate that this SimPol has been written out to a POLARIZATION table.

Motivation

This container provides an simplified in-memory representation of feeds that will ultimately be written to a POLARIZATION table. The interface is oriented toward what is typical with current instruments and thus is simpler than the interface provided by the MS POLARIZATION table.

To Do

Member Description

SimPol()

create an empty container

SimPol(const Vector<Stokes::StokesTypes>& corrTypes, const SimFeed& feed1, const SimFeed& feed2)

initialize the container

SimPol(const SimPol& other)

make a copy of the container

SimPol& operator=(const SimPol& other)

virtual ~SimPol()

uInt feed1() const

uInt feed2() const

const Matrix<Int>& corrProducts() const

const Vector<Int>& corrTypes() const

uInt numTypes() const

Stokes::StokesTypes getCorrType(Int i) const

Bool setCorrProducts(const Vector<Stokes::StokesTypes>& corrTypes, const SimFeed& feed1, const SimFeed& feed2)

set the correlation products using the given feeds. If it is not possilble to form the correlations with the given feeds, the correlations are not set and False is returned.

Bool canUseFeed(const SimFeed& feed, Bool asFeed1)

Int getId() const
void setId(Int id)

get and set the ID. An ID less than zero means that this record has not yet been recorded.

void requiredReceptors(uInt& need1, uInt& need2, Vector<String>& stokes) const

determine what polarization receptors we need from each feed.

class SimPolList

Interface

Public Members
SimPolList(uInt initsz=2, uInt stepsz=4) : n_p(0), chnk_p(stepsz), rec_p(initsz, 0)
SimPolList(const MSPolarization& polt, const SimFeedList& fdl, uInt stepsz=4)
SimPolList(const SimPolList& other)
SimPolList& operator=(const SimPolList& other)
~SimPolList()
uInt numSetups() const
void clearIds()
SimPol& operator[](Int i)
const SimPol& operator[](Int i) const
SimPol* addPolSetup(const Vector<Stokes::StokesTypes>& corrTypes, const SimFeed& feed1, const SimFeed& feed2)
void initFrom(const MSPolarization& polt, const SimFeedList& fdl)
void flush(MSPolarization& polt)
Private Members
void deleteRecs()
SimPol& get(Int i) const
void throwOutOfRange(uInt legallength, Int index) const
static Bool feedsGiveProducts(const SimFeed& fd1, const SimFeed& fd2, const Vector<Stokes::StokesTypes> ctype, const Matrix<Int>& cprod)

Description

Prerequisite

Etymology

This class holds a list of SimPol objects.

Synopsis

This class holds a list of SimPol instances which, as a group, describes a polarization set-up. When using this class, one does not create SimPol objects directly, but rather implicitly via the addPolSetup() function. The ultimate purpose of this container is to support simulated observations. Simulators would not normally create these objects directly but rather implicitly via the SimTelescope class.

An important function handled by this class is the recording of the polarization setups to a Measurement Set. This is done with the flush() function. When it writes the data from a SimPol in its list to the MS, it sets the row number of the window via setRow(); this is used as a flag indicating that the SimPol as been flushed. This allows one to later add additional setups to the list; when flush() is called again, only the new SimPol data are written out. This, of course, assumes that the same output MSPolarization is passed to the flush() function each time. If you want to write all the data to a new POLARIZATION table, you can call clearIds() to clear all the row markers.

A list of polarization setups can be read in from a POLARIZATION table as well using the initFrom() method or the SimPolList(const MSPolarization&, ...) constructor. These will implicitly set the row markers from the input table. This allows one to add new setups to the already recorded set.

Motivation

This container provides an simplified in-memory representation of spectral windows that will ultimately be written to a POLARIZATION table. The interface is oriented toward what is typical with current instruments and thus is simpler than the interface provided by the MS POLARIZATION table.

To Do

Member Description

SimPolList(uInt initsz=2, uInt stepsz=4) : n_p(0), chnk_p(stepsz), rec_p(initsz, 0)

create an empty buffer

SimPolList(const MSPolarization& polt, const SimFeedList& fdl, uInt stepsz=4)

create a buffer and fill it with the contents of a POLARIZATION table

SimPolList(const SimPolList& other)
SimPolList& operator=(const SimPolList& other)

make a copy of the container

~SimPolList()

uInt numSetups() const

return the number of setups currently defined.

void clearIds()

reset all the row markers used to flag the SimPol members that have been recorded to a Measurement Set already. Thus, the next call to flush() will record all SimPols to the POLARIZATION table. This should be used when writing to a new POLARIZATION table, different from one previously read from or written to.

SimPol& operator[](Int i)
const SimPol& operator[](Int i) const

access the i-th polarization setup in this list.

SimPol* addPolSetup(const Vector<Stokes::StokesTypes>& corrTypes, const SimFeed& feed1, const SimFeed& feed2)

add a polarization setup for a set of correlations. If the correlations cannot be formed with the given feeds, the correlations will not be added and null is returned.

void initFrom(const MSPolarization& polt, const SimFeedList& fdl)

fill list with the contents of a POLARIZATION table

void flush(MSPolarization& polt)

write out all windows that have yet to be written

void deleteRecs()

SimPol& get(Int i) const

void throwOutOfRange(uInt legallength, Int index) const

static Bool feedsGiveProducts(const SimFeed& fd1, const SimFeed& fd2, const Vector<Stokes::StokesTypes> ctype, const Matrix<Int>& cprod)