Loading...
Searching...
No Matches
casacore::ObsInfo Class Reference
coordinates package (libcasa_coordinates) » Coordinates_module

More...

`#include <ObsInfo.h>`

## Public Member Functions

| ObsInfo ()
| Default constructor makes an object where all the parameters are set to their default values (see below).
| ~ObsInfo ()
| Destructor.
| ObsInfo (const ObsInfo &other)
| Copy all fields from "other" to this object.
ObsInfo & | operator= (const ObsInfo &other)
String | telescope () const
| Telescope identifier.
ObsInfo & | setTelescope (const String &telescope)
Bool | isTelescopePositionSet () const
const MPosition & | telescopePosition () const
String | telescopePositionString () const
ObsInfo & | setTelescopePosition (const MPosition &)
String | observer () const
| The name (or initials) of the observer.
ObsInfo & | setObserver (const String &observer)
MEpoch | obsDate () const
| When was the observation taken (start time)?
ObsInfo & | setObsDate (const MEpoch &obsDate)
MVDirection | pointingCenter () const
| What was the pointing centre, as distinct from the phase centre ?
ObsInfo & | setPointingCenter (const MVDirection &direction)
Bool | isPointingCenterInitial () const
| Because the default pointing center is a valid value (0,0), this function is available to tell you whether the pointing center has been set (with setPointingCenter) to some value other than its initial (return False).
virtual Bool | toRecord (String &error, RecordInterface &outRecord) const
| Functions to interconvert between an ObsInfo and a record.
virtual Bool | fromRecord (String &error, const RecordInterface &inRecord)
| Initialise the class from a Record representation.
Bool | toFITS (String &error, RecordInterface &outRecord) const
| Functions to interconvert between an ObsInfo and FITS keywords (converted to a Record).
Bool | fromFITS (Vector< String > &error, const RecordInterface &inRecord)
Public Member Functions inherited from casacore::RecordTransformable
virtual | ~RecordTransformable ()
| The destructor must be virtual so that the destructor of derived classes is actually used.
virtual Bool | fromString (String &error, const String &inString)
| Initialise the class from a String representation.
virtual const String & | ident () const
| Specify the identification of the record (e.g.

## Static Public Member Functions

static String | defaultTelescope ()
| In some circumstances it might be useful to know what the defaults for the various values are so you can check if they have been set.
static String | defaultObserver ()
static MEpoch | defaultObsDate ()
static MVDirection | defaultPointingCenter ()
static Vector< String > | keywordNamesFITS ()
| It might be useful to know what FITS keyword names are used in to/from FITS so we can remove them so they won't be used more than once.

## Private Member Functions

void | copy_other (const ObsInfo &other)
| False after setPointingCenter called.

## Private Attributes

String | telescope_p
String | observer_p
MEpoch | obsdate_p
MPosition | telPosition_p
Bool | isTelPositionSet_p
MVDirection | pointingCenter_p
Bool | isPointingCenterInitial_p

## Detailed Description

Store miscellaneous information related to an observation.

### Intended use:

Public interface

### Review Status

Date Reviewed:
  yyyy/mm/dd

### Prerequisite

- RecordTransformable
- MEpoch

### Synopsis

This class is used to record miscellaneous information about an observation. At present it contains the following:

1. Telescope name
2. Observer name
3. Observation date
4. Pointing centre (as distinct from the phase center or tangent point)

This list can easily be extended if necessary.

This class has functions to interconvert with a record in a "lossless" fashion, and to also interconvert between a record that contains a list of FITS keywords.

### Example

The interface is a simple get/set interface. Note that the "set" methods can be chained together since each set method returns a reference to its object (rather like cout).

ObsInfo oi;
oi.setTelescope("VLA").setObserver("Glendenning");
..\.
cout << "The date observed is: " << oi.obsDate() << endl;
casacore::ObsInfo::setObserver
ObsInfo & setObserver(const String &observer)
casacore::ObsInfo::ObsInfo
ObsInfo()
Default constructor makes an object where all the parameters are set to their default values (see bel...
casacore::ObsInfo::setTelescope
ObsInfo & setTelescope(const String &telescope)
casacore::ObsInfo::obsDate
MEpoch obsDate() const
When was the observation taken (start time)?

### Motivation

Record information to allow more full measures conversion, e.g. topo->lsr requires observatory location and time. Also record in a typesafe way image summary information users are used to from classic AIPS.

### To Do

- Nothing known

Definition at line 94 of file ObsInfo.h.

## Constructor & Destructor Documentation

## ObsInfo() [1/2]

casacore::ObsInfo::ObsInfo | ( |  | ) |

Default constructor makes an object where all the parameters are set to their default values (see below).

Referenced by copy_other(), ObsInfo(), operator=(), setObsDate(), setObserver(), setPointingCenter(), setTelescope(), and setTelescopePosition().

## ~ObsInfo()

casacore::ObsInfo::~ObsInfo | ( |  | ) |

Destructor.

## ObsInfo() [2/2]

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

Copy all fields from "other" to this object.

Uses copy semantics.

References ObsInfo().

## Member Function Documentation

## copy_other()

void casacore::ObsInfo::copy_other | ( | const ObsInfo & | other | ) |

private

False after setPointingCenter called.

Common copy ctor/assignment operator code.

References ObsInfo().

## defaultObsDate()

MEpoch casacore::ObsInfo::defaultObsDate | ( |  | ) |

static

## defaultObserver()

String casacore::ObsInfo::defaultObserver | ( |  | ) |

static

## defaultPointingCenter()

MVDirection casacore::ObsInfo::defaultPointingCenter | ( |  | ) |

static

## defaultTelescope()

String casacore::ObsInfo::defaultTelescope | ( |  | ) |

static

In some circumstances it might be useful to know what the defaults for the various values are so you can check if they have been set.

## fromFITS()

Bool casacore::ObsInfo::fromFITS | ( | Vector< String > & | error,
|  | const RecordInterface & | inRecord )

References casacore::RecordInterface().

## fromRecord()

virtual Bool casacore::ObsInfo::fromRecord | ( | String & | error,
|  | const RecordInterface & | inRecord )

virtual

Initialise the class from a Record representation.

The input record should contain the fields that are required by the class. Other fields will be ignored. If the transformation succeeds then the error String is unchanged and the function returns True. Otherwise the function returns False and appends an error message to the supplied String giving the reason why the conversion failed.

Implements casacore::RecordTransformable.

References casacore::RecordInterface().

## isPointingCenterInitial()

Bool casacore::ObsInfo::isPointingCenterInitial | ( |  | ) | const

inline

Because the default pointing center is a valid value (0,0), this function is available to tell you whether the pointing center has been set (with setPointingCenter) to some value other than its initial (return False).

Definition at line 159 of file ObsInfo.h.

References isPointingCenterInitial_p.

## isTelescopePositionSet()

Bool casacore::ObsInfo::isTelescopePositionSet | ( |  | ) | const

inline

Definition at line 121 of file ObsInfo.h.

References isTelPositionSet_p.

## keywordNamesFITS()

Vector< String > casacore::ObsInfo::keywordNamesFITS | ( |  | ) |

static

It might be useful to know what FITS keyword names are used in to/from FITS so we can remove them so they won't be used more than once.

The names are in lower case.

## obsDate()

MEpoch casacore::ObsInfo::obsDate | ( |  | ) | const

When was the observation taken (start time)?

This is somewhat problematical for observations which are taken at multiple epochs. You should use the start time of the first sample. The default is the MEpoch default: MJD 0 UTC

Referenced by setObsDate().

## observer()

String casacore::ObsInfo::observer | ( |  | ) | const

The name (or initials) of the observer.

Defaults to "UNKNOWN".

Referenced by setObserver().

## operator=()

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

References ObsInfo().

## pointingCenter()

MVDirection casacore::ObsInfo::pointingCenter | ( |  | ) | const

What was the pointing centre, as distinct from the phase centre ?

This value is specified as an MVDirection. This means it is you, the callers responsibility, to know what its reference type is in order to turn it into an MDirection. The default is (0,0) (or [1,0,0]). After you have called setPointingCenter, the function isPointingCenterInitial will return False.

## setObsDate()

ObsInfo & casacore::ObsInfo::setObsDate | ( | const MEpoch & | obsDate | ) |

References obsDate(), and ObsInfo().

## setObserver()

ObsInfo & casacore::ObsInfo::setObserver | ( | const String & | observer | ) |

References observer(), and ObsInfo().

## setPointingCenter()

ObsInfo & casacore::ObsInfo::setPointingCenter | ( | const MVDirection & | direction | ) |

References ObsInfo().

## setTelescope()

ObsInfo & casacore::ObsInfo::setTelescope | ( | const String & | telescope | ) |

References ObsInfo(), and telescope().

## setTelescopePosition()

ObsInfo & casacore::ObsInfo::setTelescopePosition | ( | const MPosition & |  | ) |

References ObsInfo().

## telescope()

String casacore::ObsInfo::telescope | ( |  | ) | const

Telescope identifier.

If this is a "standard" telescope, you should use the same name as is available in the Observatories method of class MeasTable. Defaults to "UNKNOWN".
The telescope position can be set and will be converted to ITRF. If the telescope position has not been set explicitly, it will be set for a standard telescope found in the MeasTable.

Referenced by setTelescope().

## telescopePosition()

const MPosition & casacore::ObsInfo::telescopePosition | ( |  | ) | const

inline

Definition at line 123 of file ObsInfo.h.

References telPosition_p.

## telescopePositionString()

String casacore::ObsInfo::telescopePositionString | ( |  | ) | const

## toFITS()

Bool casacore::ObsInfo::toFITS | ( | String & | error,
|  | RecordInterface & | outRecord ) const

Functions to interconvert between an ObsInfo and FITS keywords (converted to a Record).

For the pointing center, the FITS keywords OBSRA and OBSDEC are used. Failure of fromFITS should probably not be regarded as fatal as the default ObsInfo values are viable. For each item contained in the ObsInfo, an attempt to decode it from FITS is made. If any of them fail, False is returned, but it attempts to decode them all. For those that fail an error message is held in error in the order telescope (error(0)), observer (error(1)), date (error(2)), pointing center (error(3)). error will be returned of length 0 if the return value is True, else it will be length 4.

References casacore::RecordInterface().

## toRecord()

virtual Bool casacore::ObsInfo::toRecord | ( | String & | error,
|  | RecordInterface & | outRecord ) const

virtual

Functions to interconvert between an ObsInfo and a record.

These functions are inherited from class RecordTransformable. As new fields get added to ObsInfo these functions should be augmented. Missing fields should not generate an error to in fromRecord to allow for backwards compatibility - null values should be supplied instead. The field names are "observer", "telescope", "obsdate", and "pointingcenter"

Implements casacore::RecordTransformable.

References casacore::RecordInterface().

## Member Data Documentation

## isPointingCenterInitial_p

Bool casacore::ObsInfo::isPointingCenterInitial_p

private

Definition at line 213 of file ObsInfo.h.

Referenced by isPointingCenterInitial().

## isTelPositionSet_p

Bool casacore::ObsInfo::isTelPositionSet_p

private

Definition at line 211 of file ObsInfo.h.

Referenced by isTelescopePositionSet().

## obsdate_p

MEpoch casacore::ObsInfo::obsdate_p

private

Definition at line 209 of file ObsInfo.h.

## observer_p

String casacore::ObsInfo::observer_p

private

Definition at line 208 of file ObsInfo.h.

## pointingCenter_p

MVDirection casacore::ObsInfo::pointingCenter_p

private

Definition at line 212 of file ObsInfo.h.

## telescope_p

String casacore::ObsInfo::telescope_p

private

Definition at line 207 of file ObsInfo.h.

## telPosition_p

MPosition casacore::ObsInfo::telPosition_p

private

Definition at line 210 of file ObsInfo.h.

Referenced by telescopePosition().

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

- coordinates/Coordinates/ObsInfo.h