SimFeed.h

Classes

SimFeed -- a container for data destined for an MS FEED record (full description)
SimFeedList -- a container for data destined for an MS FEED table (full description)

class SimFeed

Interface

Public Members
SimFeed(uInt nrec=2, 2 types="", Int ant=-1, Int spw=-1) : nrecp_p(nrec), antId_p(ant), spwId_p(spw), beamId_p(-1), row_p(-1), pols_p(), position_p(0), beamOff_p(0), polResp_p(0), angle_p(0)
SimFeed(const SimFeed& f) : nrecp_p(f.nrecp_p), antId_p(f.antId_p), spwId_p(f.spwId_p), beamId_p(f.beamId_p), row_p(-1), pols_p(f.pols_p), position_p(f.position_p), beamOff_p(f.beamOff_p), polResp_p(f.polResp_p), angle_p(f.angle_p)
SimFeed& operator=(const SimFeed& f)
virtual ~SimFeed()
void setKey(uInt feed, Int ant=-1, Int spw=-1, Double time=0, Double interval=0)
uInt numReceptors() const
uInt feedId() const
Int antId() const
Int spwId() const
Int beamId() const
Double time() const
Double interval() const
uInt nrows(uInt nants) const
void setPolTypes(const String &types)
const String& getPolTypes() const
void setBeamID(Int id)
Matrix<Double>& beamOffset()
Matrix<Complex>& polResponse()
void setPosition(const MPosition &pos)
Vector<Double>& receptorAngle()
Int getRow() const
void setRow(Int id)
uInt write(MSFeed& msf, MSFeedColumns& msfc, uInt nant=0)
Private Members
void deletePointers()

Description

Prerequisite

Etymology

This is a container for data describing a signal feed for a simulated telescope.

Synopsis

This class describes a feed in terms of the data that make up a record in the FEED table. In the MS data model, a feed can carry the signals for one or more polarizations. This class records those types as well as more complex characteristics of the feed. This container is used to define simulated observations. Simulators would not normally create these objects directly but rather implicitly via the SimTelescope class.

The most important part of the feed description is the set of polarization types. These are set at construction time or with setPolTypes(). The "key" is a set of data that uniquely identifies this feed within a set of records in a FEED table and is made up of a time stamp, a time interval, and a set of IDs; these are all set simultaneously with setKey(). Currently with this class, a feed is restricted to be associated with either a single antenna (and/or window) or all antennas currently defined. The more complex information, such as the feed postion and beam offset, can also be set after construction, via various set functions.

A row marker, set with setRow(), is used by SimFeedList to indicate that this SimFeed has been written out to a FEED table. In general, a single SimFeed will be written out as a series of rows in the FEED table, usually one for each antenna. Thus, the row marker represents the first row associated with this SimFeed.

Although this class has several non-const functions that update the internal data, it is not intended that the data be changed arbitrarily at any time. The complexity of the data (and the fact that much of it is optional) makes setting it via update functions more convenient than via a constructor. Care should be taken to avoid updating the object after it has been copied to disk (by the SimFeedList class). A negative value returned from getRow() indicates that the item has not yet been written out.

Motivation

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

To Do

Member Description

SimFeed(uInt nrec=2, 2 types="", Int ant=-1, Int spw=-1) : nrecp_p(nrec), antId_p(ant), spwId_p(spw), beamId_p(-1), row_p(-1), pols_p(), position_p(0), beamOff_p(0), polResp_p(0), angle_p(0)

create the record container. nrec is the number of receptors associated with this feed. types is a String containing the polarization codes for each receptor in their proper order (with no intervening spaces); the length of the string must either be 0 (to be set later with setPolTypes()) or equal to number of receptors. ant is the ID for the antenna associated with this feed; a value of -1 means this applies to all antennae. spw is the ID for the spectral window associated with this feed; a value of -1 means that this applies to all windows.

SimFeed(const SimFeed& f) : nrecp_p(f.nrecp_p), antId_p(f.antId_p), spwId_p(f.spwId_p), beamId_p(f.beamId_p), row_p(-1), pols_p(f.pols_p), position_p(f.position_p), beamOff_p(f.beamOff_p), polResp_p(f.polResp_p), angle_p(f.angle_p)

make a copy of the record

SimFeed& operator=(const SimFeed& f)

virtual ~SimFeed()

void setKey(uInt feed, Int ant=-1, Int spw=-1, Double time=0, Double interval=0)

set the values that make up the lookup key for this feed. Negative values for ant and spw mean the record applies to all antennae and windows, respectively. A value of 0 for time defaults to the start time.

uInt numReceptors() const

uInt feedId() const

Int antId() const

Int spwId() const

Int beamId() const

Double time() const

Double interval() const

uInt nrows(uInt nants) const

void setPolTypes(const String &types)

const String& getPolTypes() const

void setBeamID(Int id)

set the Beam ID

Matrix<Double>& beamOffset()

Matrix<Complex>& polResponse()

void setPosition(const MPosition &pos)

Vector<Double>& receptorAngle()

Int getRow() const
void setRow(Int id)

get and set the row ID, the row of the first record with this feedID. An ID less than zero means that this record has not yet been recorded.

uInt write(MSFeed& msf, MSFeedColumns& msfc, uInt nant=0)

void deletePointers()


class SimFeedList

Interface

Public Members
SimFeedList(uInt initsz=2, uInt stepsz=4) : n_p(0), chnk_p(stepsz), recs_p(initsz, 0)
SimFeedList(const SimFeedList& f, uInt stepsz=4) : n_p(0), chnk_p(stepsz), recs_p(f.recs_p.nelements(), 0)
SimFeedList& operator=(const SimFeedList& f)
SimFeedList(const MSFeed& fdt, uInt stepsz=4)
virtual ~SimFeedList()
uInt countRows(uInt nants, Bool unflushed=False) const
uInt numFeeds() const
Bool uniform() const
SimFeed& addFeed(uInt nrecp, String types)
SimFeed& operator[](Int i)
const SimFeed& operator[](Int i) const
void clearIds()
void initFrom(const MSFeed& fdt)
uInt write(MSFeed &msf, uInt nants) const
uInt flush(MSFeed& msf, uInt nants=0) const
Private Members
void deleteRecs()
SimFeed& get(Int i) const
void throwOutOfRange(uInt legallength, Int index) const
void add(SimFeed *feed)

Description

Prerequisite

Etymology

This class holds a list of SimFeed objects.

Synopsis

This class holds a list of SimFeed instances which, as a group, describes a spectrometer set-up (typical of correlation spectrometers). When using this class, one does not create SimFeed objects directly, but rather implicitly via the addFeed() 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 feed descriptions to a Measurement Set. This is done with the flush() function. When it writes the data from a SimFeed in its list to the MS, it sets the row number of the first feed record via setRow(); this is used as a flag indicating that the SimFeed as been flushed. This allows one to later add additional feeds to the list; when flush() is called again, only the new SimFeed data are written out. This, of course, assumes that the same output MSFeed is passed to the flush() function each time. If you want to write all the data to a new FEED table, you can call clearIds() to clear all the row markers.

A set of feeds can be read in from a FEED table as well using the initFrom() method or the SimFeedList(const MSFeed&, ...) constructor. These will implicitly set the row markers from the input table. This allows one to add new feeds to the already recorded set.

Motivation

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

To Do

Member Description

SimFeedList(uInt initsz=2, uInt stepsz=4) : n_p(0), chnk_p(stepsz), recs_p(initsz, 0)

create an empty list

SimFeedList(const SimFeedList& f, uInt stepsz=4) : n_p(0), chnk_p(stepsz), recs_p(f.recs_p.nelements(), 0)
SimFeedList& operator=(const SimFeedList& f)

create a copy of another list

SimFeedList(const MSFeed& fdt, uInt stepsz=4)

load the feeds described in the given FEED table

virtual ~SimFeedList()

uInt countRows(uInt nants, Bool unflushed=False) const

count the number of rows assuming a given number of antennae

uInt numFeeds() const

return the number of feeds described in this list

Bool uniform() const

return True if all feeds have the same number of receptors on them

SimFeed& addFeed(uInt nrecp, String types)

add a feed to this list. nrecp is the number of receptors attached to the feed. types lists polarizations for the receptors. The length of the string is equal to nrecp, and the values are taken from "RLXY".

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

access the i-th SimFeed object in this list.

void clearIds()

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

void initFrom(const MSFeed& fdt)

add feed descriptions from a Measurement set

uInt write(MSFeed &msf, uInt nants) const
uInt flush(MSFeed& msf, uInt nants=0) const

write out the FEED table assuming a given number of antennae

void deleteRecs()

SimFeed& get(Int i) const

void throwOutOfRange(uInt legallength, Int index) const

void add(SimFeed *feed)