MSDerivedValues.h
Classes
- MSDerivedValues -- MSDerivedValues calculates values derived from a MS (full description)
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()
Review Status
- Date Reviewed:
- yyyy/mm/dd
Prerequisite
- MeasurementSet
- SomeOtherClass
- some concept
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
- the interface should be less cumbersome
- probably needs speeding up
Member Description
Copy constructor, this will initialize with other's MS
MSDerivedValues& operator=(const MSDerivedValues& other)
Assignment, this will initialize with other's MS
Set antenna position from an antenna table
Returns the number of antennas. Also
sets the observatory position to the average of the antenna positions.
Set antenna positions, index in vector is antenna number
for calls below.
Set the observatory position. Note that setAntennas will reset this.
Set antenna mounts, should have same number of entries as
antPosition in setAntennaPosition
MSDerivedValues& setEpoch(const MEpoch& time)
Set epoch
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.
Set the velocity frame type (e.g., MRadialVelocity::LSRK)
get hour angle
get parallactic angle
get azimuth & elevation
get LAST for given time, antenna
get observatory radial velocity for given epoch, position and direction
initialize data