Loading...
Searching...
No Matches
casacore::MSDerivedValues Class Reference
ms package (libcasa_ms) » MSOper_module

More...

`#include <MSDerivedValues.h>`

## Public Member Functions

| MSDerivedValues ()
| thread-hostile shared pointers (Jim Jacobs 111104)
| ~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 MSAntennaColumns &ac)
| Set antenna position from an antenna table Returns the number of antennas.
MSDerivedValues & | setAntennaPositions (const Vector< MPosition > &antPosition)
| Set antenna positions, index in vector is antenna number for calls below.
const Vector< MPosition > & | getAntennaPositions () const
MSDerivedValues & | setObservatoryPosition (const MPosition &obsPosition)
| Set the observatory position.
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 & | setFieldCenter (uInt fieldid=0)
| If you have used setMeasurementSet then this version of setFieldCenter using field id makes sense.
MSDerivedValues & | setAntenna (Int antenna)
| Set antenna index, sets the position reference for the conversions.
MSDerivedValues & | setVelocityFrame (MRadialVelocity::Types vType)
| Set the velocity frame type (e.g., MRadialVelocity::LSRK).
MSDerivedValues & | setVelocityReference (MDoppler::Types dopType)
| Set the velocity frame type (e.g., MRDoppler::RADIO).
MRadialVelocity::Types | getRadialVelocityType () const
MSDerivedValues & | setFrequencyReference (MFrequency::Types frqType)
| Set the frequency frame (e.g., MFrequency::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
MSDerivedValues & | setMeasurementSet (const MeasurementSet &ms)
| Set an ms does not need to explicity setAntennas and is necessary if setRestFreqency(fieldid, spwid) is used.
Bool | setRestFrequency (const Int fieldid, const Int spwid, const Int linenum=0)
| Set restFrequencies...make it look for it for the fieldid, spwid and line number defined in the SOURCE table return False if it fails to find the restFrquency.
MSDerivedValues & | setRestFrequency (const Quantity &restFreq)
Quantity | toFrequency (const Quantity &vel, const Quantity &restFreq)
| get frequency from velocity
Quantity | toFrequency (const Quantity &vel)
Quantity | toVelocity (const Quantity &freq, const Quantity &restFreq)
| get velocity from frequency
Quantity | toVelocity (const Quantity &freq)

## Private Member Functions

void | init ()
| initialize data

## Private Attributes

Int | antenna_p
MEpoch::Convert | cUTCToLAST_p
Vector< MPosition > | mAntPos_p
MDirection::Convert | cRADecToAzEl_p
MDirection::Convert | cHADecToAzEl_p
MDirection::Convert | cRADecToHADec_p
MeasFrame | fAntFrame_p
MDirection | mRADecInAzEl_p
MDirection | mHADecPoleInAzEl_p
MDirection | mFieldCenter_p
MPosition | mObsPos_p
MRadialVelocity::Convert | cTOPOToLSR_p
MDoppler::Ref | velref_p
MFrequency::Ref | frqref_p
Bool | hasMS_p
Quantity | restFreq_p
Vector< Int > | mount_p
MeasurementSet | ms_p
MRadialVelocity::Types | radialVelocityType_p

## Friends

class | VisBufferAsync

## Detailed Description

MSDerivedValues calculates values derived from a MS

### Intended use:

Public interface

### 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");
MSColumns 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();
casacore::MDirection
Definition MDirection.h:171
casacore::MEpoch
Definition MEpoch.h:101
casacore::MRadialVelocity
Definition MRadialVelocity.h:134
casacore::MRadialVelocity::LSRK
@ LSRK
Definition MRadialVelocity.h:150
casacore::MSColumns
Definition MSColumns.h:115
casacore::MSDerivedValues::MSDerivedValues
MSDerivedValues()
thread-hostile shared pointers (Jim Jacobs 111104)
casacore::MSDerivedValues::parAngle
Double parAngle()
get parallactic angle
casacore::MSDerivedValues::obsVel
const MRadialVelocity & obsVel()
get observatory radial velocity for given epoch, position and direction
casacore::MSDerivedValues::setVelocityFrame
MSDerivedValues & setVelocityFrame(MRadialVelocity::Types vType)
Set the velocity frame type (e.g., MRadialVelocity::LSRK).
casacore::MSDerivedValues::setEpoch
MSDerivedValues & setEpoch(const MEpoch &time)
Set epoch.
casacore::MSDerivedValues::setFieldCenter
MSDerivedValues & setFieldCenter(const MDirection &fieldCenter)
Set field center.
casacore::MSDerivedValues::setAntennas
Int setAntennas(const MSAntennaColumns &ac)
Set antenna position from an antenna table Returns the number of antennas.
casacore::MVDirection
Definition MVDirection.h:105
casacore::MVEpoch
Definition MVEpoch.h:87
casacore::MeasBase::set
void set(const Mv &dt)
Refill the specified entities.
casacore::Vector
Definition Vector.h:82
casacore::MS
MeasurementSet MS
MeasurementSet is too cumbersome for a number of common uses, so we give a typedef here.
Definition MeasurementSet.h:149
casacore::Quantity
Quantum< Double > Quantity
Definition Quantum.h:39
casacore::Double
double Double
Definition aipstype.h:53

### 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

Definition at line 107 of file MSDerivedValues.h.

## Constructor & Destructor Documentation

## MSDerivedValues() [1/2]

casacore::MSDerivedValues::MSDerivedValues | ( |  | ) |

thread-hostile shared pointers (Jim Jacobs 111104)

Referenced by MSDerivedValues(), operator=(), setAntenna(), setAntennaMount(), setAntennaPositions(), setEpoch(), setFieldCenter(), setFieldCenter(), setFrequencyReference(), setMeasurementSet(), setObservatoryPosition(), setRestFrequency(), setVelocityFrame(), and setVelocityReference().

## ~MSDerivedValues()

casacore::MSDerivedValues::~MSDerivedValues | ( |  | ) |

## MSDerivedValues() [2/2]

casacore::MSDerivedValues::MSDerivedValues | ( | const MSDerivedValues & | other | ) |

Copy constructor, this will initialize with other's MS.

References MSDerivedValues().

## Member Function Documentation

## azel()

const MDirection & casacore::MSDerivedValues::azel | ( |  | ) |

get azimuth & elevation

## getAntennaPositions()

const Vector< MPosition > & casacore::MSDerivedValues::getAntennaPositions | ( |  | ) | const

## getRadialVelocityType()

MRadialVelocity::Types casacore::MSDerivedValues::getRadialVelocityType | ( |  | ) | const

## hourAngle()

Double casacore::MSDerivedValues::hourAngle | ( |  | ) |

get hour angle

## init()

void casacore::MSDerivedValues::init | ( |  | ) |

private

initialize data

## last()

const MEpoch & casacore::MSDerivedValues::last | ( |  | ) |

get LAST for given time, antenna

## obsVel()

const MRadialVelocity & casacore::MSDerivedValues::obsVel | ( |  | ) |

get observatory radial velocity for given epoch, position and direction

## operator=()

MSDerivedValues & casacore::MSDerivedValues::operator= | ( | const MSDerivedValues & | other | ) |

Assignment, this will initialize with other's MS.

References MSDerivedValues().

## parAngle()

Double casacore::MSDerivedValues::parAngle | ( |  | ) |

get parallactic angle

## setAntenna()

MSDerivedValues & casacore::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.

References MSDerivedValues().

## setAntennaMount()

MSDerivedValues & casacore::MSDerivedValues::setAntennaMount | ( | const Vector< String > & | mount | ) |

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

References MSDerivedValues().

## setAntennaPositions()

MSDerivedValues & casacore::MSDerivedValues::setAntennaPositions | ( | const Vector< MPosition > & | antPosition | ) |

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

References MSDerivedValues().

## setAntennas()

Int casacore::MSDerivedValues::setAntennas | ( | const MSAntennaColumns & | 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.

## setEpoch()

MSDerivedValues & casacore::MSDerivedValues::setEpoch | ( | const MEpoch & | time | ) |

Set epoch.

References MSDerivedValues(), and casacore::time().

## setFieldCenter() [1/2]

MSDerivedValues & casacore::MSDerivedValues::setFieldCenter | ( | const MDirection & | fieldCenter | ) |

Set field center.

References MSDerivedValues().

## setFieldCenter() [2/2]

MSDerivedValues & casacore::MSDerivedValues::setFieldCenter | ( | uInt | fieldid = 0 | ) |

If you have used setMeasurementSet then this version of setFieldCenter using field id makes sense.

References MSDerivedValues().

## setFrequencyReference()

MSDerivedValues & casacore::MSDerivedValues::setFrequencyReference | ( | MFrequency::Types | frqType | ) |

Set the frequency frame (e.g., MFrequency::LSRK).

References MSDerivedValues().

## setMeasurementSet()

MSDerivedValues & casacore::MSDerivedValues::setMeasurementSet | ( | const MeasurementSet & | ms | ) |

Set an ms does not need to explicity setAntennas and is necessary if setRestFreqency(fieldid, spwid) is used.

References MSDerivedValues().

## setObservatoryPosition()

MSDerivedValues & casacore::MSDerivedValues::setObservatoryPosition | ( | const MPosition & | obsPosition | ) |

Set the observatory position.

Note that setAntennas will reset this.

References MSDerivedValues().

## setRestFrequency() [1/2]

Bool casacore::MSDerivedValues::setRestFrequency | ( | const Int | fieldid,
|  | const Int | spwid,
|  | const Int | linenum = 0 )

Set restFrequencies...make it look for it for the fieldid, spwid and line number defined in the SOURCE table return False if it fails to find the restFrquency.

## setRestFrequency() [2/2]

MSDerivedValues & casacore::MSDerivedValues::setRestFrequency | ( | const Quantity & | restFreq | ) |

References MSDerivedValues().

## setVelocityFrame()

MSDerivedValues & casacore::MSDerivedValues::setVelocityFrame | ( | MRadialVelocity::Types | vType | ) |

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

References MSDerivedValues().

## setVelocityReference()

MSDerivedValues & casacore::MSDerivedValues::setVelocityReference | ( | MDoppler::Types | dopType | ) |

Set the velocity frame type (e.g., MRDoppler::RADIO).

References MSDerivedValues().

## toFrequency() [1/2]

Quantity casacore::MSDerivedValues::toFrequency | ( | const Quantity & | vel | ) |

## toFrequency() [2/2]

Quantity casacore::MSDerivedValues::toFrequency | ( | const Quantity & | vel,
|  | const Quantity & | restFreq )

get frequency from velocity

## toVelocity() [1/2]

Quantity casacore::MSDerivedValues::toVelocity | ( | const Quantity & | freq | ) |

## toVelocity() [2/2]

Quantity casacore::MSDerivedValues::toVelocity | ( | const Quantity & | freq,
|  | const Quantity & | restFreq )

get velocity from frequency

## Friends And Related Symbol Documentation

## VisBufferAsync

friend class VisBufferAsync

friend

Definition at line 109 of file MSDerivedValues.h.

References VisBufferAsync.

Referenced by VisBufferAsync.

## Member Data Documentation

## antenna_p

Int casacore::MSDerivedValues::antenna_p

private

Definition at line 208 of file MSDerivedValues.h.

## cHADecToAzEl_p

MDirection::Convert casacore::MSDerivedValues::cHADecToAzEl_p

private

Definition at line 212 of file MSDerivedValues.h.

## cRADecToAzEl_p

MDirection::Convert casacore::MSDerivedValues::cRADecToAzEl_p

private

Definition at line 211 of file MSDerivedValues.h.

## cRADecToHADec_p

MDirection::Convert casacore::MSDerivedValues::cRADecToHADec_p

private

Definition at line 213 of file MSDerivedValues.h.

## cTOPOToLSR_p

MRadialVelocity::Convert casacore::MSDerivedValues::cTOPOToLSR_p

private

Definition at line 219 of file MSDerivedValues.h.

## cUTCToLAST_p

MEpoch::Convert casacore::MSDerivedValues::cUTCToLAST_p

private

Definition at line 209 of file MSDerivedValues.h.

## fAntFrame_p

MeasFrame casacore::MSDerivedValues::fAntFrame_p

private

Definition at line 214 of file MSDerivedValues.h.

## frqref_p

MFrequency::Ref casacore::MSDerivedValues::frqref_p

private

Definition at line 221 of file MSDerivedValues.h.

## hasMS_p

Bool casacore::MSDerivedValues::hasMS_p

private

Definition at line 222 of file MSDerivedValues.h.

## mAntPos_p

Vector<MPosition> casacore::MSDerivedValues::mAntPos_p

private

Definition at line 210 of file MSDerivedValues.h.

## mFieldCenter_p

MDirection casacore::MSDerivedValues::mFieldCenter_p

private

Definition at line 217 of file MSDerivedValues.h.

## mHADecPoleInAzEl_p

MDirection casacore::MSDerivedValues::mHADecPoleInAzEl_p

private

Definition at line 216 of file MSDerivedValues.h.

## mObsPos_p

MPosition casacore::MSDerivedValues::mObsPos_p

private

Definition at line 218 of file MSDerivedValues.h.

## mount_p

Vector<Int> casacore::MSDerivedValues::mount_p

private

Definition at line 224 of file MSDerivedValues.h.

## mRADecInAzEl_p

MDirection casacore::MSDerivedValues::mRADecInAzEl_p

private

Definition at line 215 of file MSDerivedValues.h.

## ms_p

MeasurementSet casacore::MSDerivedValues::ms_p

private

Definition at line 225 of file MSDerivedValues.h.

## radialVelocityType_p

MRadialVelocity::Types casacore::MSDerivedValues::radialVelocityType_p

private

Definition at line 226 of file MSDerivedValues.h.

## restFreq_p

Quantity casacore::MSDerivedValues::restFreq_p

private

Definition at line 223 of file MSDerivedValues.h.

## velref_p

MDoppler::Ref casacore::MSDerivedValues::velref_p

private

Definition at line 220 of file MSDerivedValues.h.

The documentation for this class was generated from the following file:

- ms/MSOper/MSDerivedValues.h