casa::SimFieldList Class Reference
[Simulators]

#include <SimField.h>

List of all members.


Detailed Description

a container for data destined for an MS FIELD table

Intended use:

Part of API

Prerequisite

Etymology

This class holds a list of SimField objects.

Synopsis

This class holds a list of SimField instances which, as a group, describes a list of sources to observe. When using this class, one does not create SimField objects directly, but rather implicitly via the addSource() 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 SimObservations class.

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

A list of fields can be read in from a FIELD table as well using the initFrom() method or the SimFieldList(const MSField&, .\..) 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 sources that will ultimately be written to a FIELD table. The interface is oriented toward what is typical with current instruments and thus is simpler than the interface provided by the MS FIELD table.

To Do

Definition at line 239 of file SimField.h.

Public Member Functions

 SimFieldList (uInt initsz=2, uInt stepsz=4)
 create an empty list
 SimFieldList (const MSField &fldt, uInt stepz=4)
 create a list and fill it with the contents of a FIELD table
 ~SimFieldList ()
void clearIds ()
 reset all the row markers used to flag the SimField members that have been recorded to a Measurement Set already.
uInt numFields () const
 return the number of fields in this list
SimFieldaddField (uInt srcId, const MDirection &dir, Double longOffset=0.0, Double latOffset=0.0, const String &name="", const String &code="")
 Add a field.
void initFrom (const MSField &fldt)
 add field descriptions from an MS FIELD table
void flush (MSField &fldt, MSSource &srct)
 write out all fields that have yet to be written
 SimFieldList (const SimFieldList &t)
 create a copy
SimFieldListoperator= (const SimFieldList &t)
SimFieldoperator[] (Int i)
 access the i-th field in this list.
const SimFieldoperator[] (Int i) const

Private Member Functions

void deleteRecs ()
SimFieldget (Int i) const
void throwOutOfRange (uInt legallength, Int index) const
void add (SimField *fld)
uInt loadSourceInfo (MSSource &srct, SimpleOrderedMap< Int, String > &snames, SimpleOrderedMap< Int, Double > &times)

Private Attributes

uInt n_p
uInt chnk_p
Block< SimField * > rec_p


Constructor & Destructor Documentation

casa::SimFieldList::SimFieldList ( uInt  initsz = 2,
uInt  stepsz = 4 
) [inline]

create an empty list

Definition at line 242 of file SimField.h.

casa::SimFieldList::SimFieldList ( const MSField fldt,
uInt  stepz = 4 
)

create a list and fill it with the contents of a FIELD table

casa::SimFieldList::SimFieldList ( const SimFieldList t  ) 

create a copy

casa::SimFieldList::~SimFieldList (  )  [inline]

Definition at line 254 of file SimField.h.

References deleteRecs().


Member Function Documentation

SimFieldList& casa::SimFieldList::operator= ( const SimFieldList t  ) 

void casa::SimFieldList::clearIds (  )  [inline]

reset all the row markers used to flag the SimField members that have been recorded to a Measurement Set already.

Thus, the next call to flush() will record all SimFields to the FIELD table. This should be used when writing to a new FIELD table, different from one previously read from or written to.

Definition at line 261 of file SimField.h.

References n_p, and rec_p.

SimField& casa::SimFieldList::operator[] ( Int  i  )  [inline]

access the i-th field in this list.

Definition at line 268 of file SimField.h.

References get().

const SimField& casa::SimFieldList::operator[] ( Int  i  )  const [inline]

Definition at line 269 of file SimField.h.

References get().

uInt casa::SimFieldList::numFields (  )  const [inline]

return the number of fields in this list

Definition at line 273 of file SimField.h.

References n_p.

Referenced by casa::SimObservations::addField(), and casa::SimObservations::numFields().

SimField& casa::SimFieldList::addField ( uInt  srcId,
const MDirection dir,
Double  longOffset = 0.0,
Double  latOffset = 0.0,
const String name = "",
const String code = "" 
) [inline]

Add a field.

srcId is the source ID that this field is associated with. dir is normally the position of the source referenced by srcId so that longOffset and latOffset gives the relative position of the field center; however, dir will be the absolute position of the field when longOffset=latOffset=0. longOffset is the true angular offset in radians in the direction perpendicular to the celestial pole (i.e. along a great circle) of the field center from the source position given by dir. latOffset is the angular offset in radians in the direction of the celestial (north) pole of the field center from the source position.

Definition at line 289 of file SimField.h.

References add().

Referenced by casa::SimObservations::addField().

void casa::SimFieldList::initFrom ( const MSField fldt  ) 

add field descriptions from an MS FIELD table

void casa::SimFieldList::flush ( MSField fldt,
MSSource srct 
)

write out all fields that have yet to be written

void casa::SimFieldList::deleteRecs (  )  [inline, private]

Definition at line 306 of file SimField.h.

References n_p, and rec_p.

Referenced by ~SimFieldList().

SimField& casa::SimFieldList::get ( Int  i  )  const [inline, private]

Definition at line 312 of file SimField.h.

References n_p, rec_p, and throwOutOfRange().

Referenced by operator[]().

void casa::SimFieldList::throwOutOfRange ( uInt  legallength,
Int  index 
) const [private]

Referenced by get().

void casa::SimFieldList::add ( SimField fld  )  [inline, private]

Definition at line 319 of file SimField.h.

References chnk_p, n_p, and rec_p.

Referenced by addField().

uInt casa::SimFieldList::loadSourceInfo ( MSSource srct,
SimpleOrderedMap< Int, String > &  snames,
SimpleOrderedMap< Int, Double > &  times 
) [private]


Member Data Documentation

uInt casa::SimFieldList::n_p [private]

Definition at line 330 of file SimField.h.

Referenced by add(), clearIds(), deleteRecs(), get(), and numFields().

uInt casa::SimFieldList::chnk_p [private]

Definition at line 330 of file SimField.h.

Referenced by add().

Block<SimField*> casa::SimFieldList::rec_p [private]

Definition at line 331 of file SimField.h.

Referenced by add(), clearIds(), deleteRecs(), and get().


The documentation for this class was generated from the following file:
Generated on Mon Sep 1 22:47:37 2008 for NRAOCASA by  doxygen 1.5.1