MSDerivedValues.h

Classes

MSDerivedValues -- MSDerivedValues calculates values derived from a MS (full description)

class MSDerivedValues

Interface

Public Members
MSDerivedValues()
~MSDerivedValues()
MSDerivedValues(const MSDerivedValues& other)
MSDerivedValues& operator=(const MSDerivedValues& other)
Int setAntennas(const ROMSAntennaColumns& ac)
MSDerivedValues& setAntennaPositions(const Vector<MPosition>& antPosition)
MSDerivedValues& setObservatoryPosition(const MPosition& obsPosition)
MSDerivedValues& setAntennaMount(const Vector<String>& mount)
MSDerivedValues& setEpoch(const MEpoch& time)
MSDerivedValues& setFieldCenter(const MDirection& fieldCenter)
MSDerivedValues& setAntenna(Int antenna)
MSDerivedValues& setVelocityFrame(MRadialVelocity::Types vType)
Double hourAngle()
Double parAngle()
const MDirection& azel()
const MEpoch& last()
const MRadialVelocity& obsVel()
Private Members
void init()

Description

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

MSDerivedValues calculates values derived from those in a MS

Synopsis

MSDerivedValues is a class that computes values derived from those present in a MeasurementSet. E.g., calculate feed position angles on the sky from time, antenna positions and feed characteristics.

Example

    // calculate the parallactic angle and the observatory velocity for the
    // first time and first source in the MS.
    // set up 
    MSDerivedValues msd;
    MS myMS("myMS");
    ROMSColumns msc(myMS);
    msd.setAntennas(msc.antenna());
    MEpoch ep=MS::epochMeasure(msc.time());
    ep.set(MVEpoch(Quantity(msc.time()(0),"s")));
    msd.setEpoch(ep);
    MDirection dir=MS::directionMeasure(msc.field().phaseDir());
    dir.set(MVDirection(Vector<Double>(msc.field().phaseDir()(0))));
    msd.setFieldCenter(dir);
    msd.setVelocityFrame(MRadialVelocity::LSRK);
    // now we are ready for the calculations:
    Double parAngle = msd.parangle();
    MRadialVelocity observatoryVel = msd.obsVel();
    

Motivation

Values derived from those in a MS are needed in various places, e.g., for plotting purposes. This class combines the commonly needed calculations in one place.

Thrown Exceptions

To Do

Member Description

MSDerivedValues()

~MSDerivedValues()

MSDerivedValues(const MSDerivedValues& other)

Copy constructor, this will initialize with other's MS

MSDerivedValues& operator=(const MSDerivedValues& other)

Assignment, this will initialize with other's MS

Int setAntennas(const ROMSAntennaColumns& ac)

Set antenna position from an antenna table Returns the number of antennas. Also sets the observatory position to the average of the antenna positions.

MSDerivedValues& setAntennaPositions(const Vector<MPosition>& antPosition)

Set antenna positions, index in vector is antenna number for calls below.

MSDerivedValues& setObservatoryPosition(const MPosition& obsPosition)

Set the observatory position. Note that setAntennas will reset this.

MSDerivedValues& setAntennaMount(const Vector<String>& mount)

Set antenna mounts, should have same number of entries as antPosition in setAntennaPosition

MSDerivedValues& setEpoch(const MEpoch& time)

Set epoch

MSDerivedValues& setFieldCenter(const MDirection& fieldCenter)

Set field center

MSDerivedValues& setAntenna(Int antenna)

Set antenna index, sets the position reference for the conversions. Use -1 to set the reference frame to the observatory position.

MSDerivedValues& setVelocityFrame(MRadialVelocity::Types vType)

Set the velocity frame type (e.g., MRadialVelocity::LSRK)

Double hourAngle()

get hour angle

Double parAngle()

get parallactic angle

const MDirection& azel()

get azimuth & elevation

const MEpoch& last()

get LAST for given time, antenna

const MRadialVelocity& obsVel()

get observatory radial velocity for given epoch, position and direction

void init()

initialize data