Loading...
Searching...
No Matches
casacore::UVWMachine Class Reference
measures package (libcasa_measures) » Measures_module

More...

`#include <UVWMachine.h>`

## Public Member Functions

| UVWMachine (const MDirection::Ref &out, const MDirection &in, Bool EW=False, Bool project=False)
| Constructors have an EW flag, which will give a projection parallel to the polar axis rather than in the direction of the fieldcenter, and a project flag.
| UVWMachine (const MDirection &out, const MDirection &in, Bool EW=False, Bool project=False)
| Construct a UVW conversion machine from the in coordinate and its system to the out coordinate and its system.
| UVWMachine (const MDirection::Ref &out, const MDirection &in, const MeasFrame &frame, Bool EW=False, Bool project=False)
| Construct UVW conversion machine with an explicitly given frame.
| UVWMachine (const MDirection &out, const MDirection &in, const MeasFrame &frame, Bool EW=False, Bool project=False)
| UVWMachine (const UVWMachine &other)
| Copy constructor.
UVWMachine & | operator= (const UVWMachine &other)
| Copy assignments.
| ~UVWMachine ()
Vector< Double > | operator() (const Vector< Double > &uv) const
| Return converted UVW coordinates.
Vector< Vector< Double > > | operator() (const Vector< Vector< Double > > &uv) const
MVPosition | operator() (const MVPosition &uv) const
Vector< MVPosition > | operator() (const Vector< MVPosition > &uv) const
const MDirection & | phaseCenter () const
| Return the new phase center coordinates.
Bool | isNOP ()
| Return if the engine is an effective NOP.
const RotMatrix & | rotationUVW () const
| Return a rotation matrix that can be used to convert UVW coordinates: UVW(new) = UVW(old) * rotationUVW().
const MVPosition & | rotationPhase () const
| Return a position vector that can produce the phase correction: dPhase = rotationPhase * UVW(new).
void | convertUVW (Vector< Double > &uv) const
| replace UVW with converted values
void | convertUVW (Vector< Vector< Double > > &uv) const
void | convertUVW (MVPosition &uv) const
void | convertUVW (Vector< MVPosition > &uv) const
Double | getPhase (Vector< Double > &uv) const
| Get phase shift (in implied units of UVW), and change input uvw as well.
Vector< Double > | getPhase (Vector< Vector< Double > > &uv) const
Double | getPhase (MVPosition &uv) const
Vector< Double > | getPhase (Vector< MVPosition > &uv) const
void | convertUVW (Double &phase, Vector< Double > &uv) const
| Replace UVW with converted, and return phase.
void | convertUVW (Vector< Double > &phase, Vector< Vector< Double > > &uv) const
void | convertUVW (Double &phase, MVPosition &uv) const
void | convertUVW (Vector< Double > &phase, Vector< MVPosition > &uv) const
void | reCalculate ()
| Recalculate the parameters for the machine after e.g.

## Private Member Functions

| UVWMachine ()
| default constructor: not implemented
void | init ()
| Initialise machinery.
void | planetinit ()
| Planet handling.
void | copy (const UVWMachine &other)
| Copy data members.

## Private Attributes

Bool | ew_p
| EW flag.
Bool | proj_p
| Projection flag.
Bool | zp_p
| Zero phase flag (for speed).
Bool | nop_p
| No conversion necessary flag.
MDirection | in_p
| Old phase center.
MDirection::Ref | outref_p
| New coordinate reference.
MDirection | outin_p
| Old phase center in new coordinates.
MDirection | out_p
| New phase center.
RotMatrix | rot1_p
| Rotation Matrix to go from input UVW to coordinate system.
RotMatrix | rot2_p
| Rotation matrix to go from old system to new system.
RotMatrix | rot3_p
| Rotation Matrix to go from new coordinate system to output UVW.
RotMatrix | rot4_p
| Rotation Matrix to project UV-plane onto.
RotMatrix | uvrot_p
| UVW rotation.
RotMatrix | uvproj_p
| UVW rotation including projection.
MVPosition | phrot_p
| Phase rotation.
MDirection::Convert | conv_p
| Conversion engine.

## Detailed Description

Converts UVW coordinates between coordinate systems

### Intended use:

Public interface

### Review Status

Reviewed By:
  UNKNOWN
Date Reviewed:
  before2004/08/25
Test programs:
  tUVWMachine

### Prerequisite

- MDirection class

### Etymology

From UVW coordinates and machinery

### Synopsis

The construction of a UVWMachine class object creates a machine that can convert UVW coordinates from one coordinate system to another. In addition it can also supply the phase rotation necessary to move to a new position.

The constructors need an input MDirection to specify the input UVW coordinates reference direction and coordinate system. An EW flag can be specified to indicate the different type of UVW coordinates. I.e. projection along polar axis rather than towards observing direction (not implemented yet). A project flag, if set, will re-project the resulting UV plane onto the in-direction reference plane.

The constructors also need an output coordinate system (MDirection::Ref) or an output MDirection (including the reference coordinate system). The first case indicates that the real position on the sky does not change (only the coordinate system used); the second indicates that the UVW should be for a new position on the sky (in addition to maybe a different coordinate system). In the first case only the UVW coordinates will change, in the second the UVW positions will change, but also the phase of the observed data will have to change. For some conversions a reference frame is needed (to indicate e.g. the position or time). This frame can be part of one of the constructor references, but can also be specified separately in the constructor. A change in the frame parameter can be made outside the UVWMachine by e.g. frame.reset(anMEpoch).
Caution: If the frame is changed by the user of the conversion machine, the machine has to be reinitialised before using it for output by using reCalculate();

Projection entails a rotation; For changes to a fixed frame (i;e; not changing with e;g; time), the rotation matrix is calculated only once; In other cases it has to be calculated per series of uvw conversions; The latter case can hence be time consuming;
Tip: If either the input or output direction/reference specifies a planet, action is special; Planets are assumed to be in J2000 positions, since that is the only way to carry them from conversion to conversion (and also have a variable phase-center; which can, btw, always be obtained by the phaseCenter() member);
Note that a reCalculate() is necessary between calls of the engine, since the planetary position will change from time to time (i.e. with the Frame).

If no explicit output coordinate is given (i.e. no phase shift necessary), and the conversion from input to output is an essential NOP, and no reprojection to the input plane is required, the machine will bypass all calculations. This state can be inspected by the isNOP() method.

If you want to convert to say an azimuth/elevation map of the Sun, this can be done to have either two conversion engines (original to Sun, then Sun to AzEl), or by conversion of the Sun to AzEl before entering the engine.
Tip: The output of the machine is either a set of rotation matrices that can be used to convert UVW coordinates (and, if necessary, phases); or the UVW conversion and actual phase can be calculated from a given UVW coordinate (or set of coordinates);
Tip: Since e;g; in an EW interferometer (or any set of baselines on a line) the phase correction and UVW transform scales with the length of the baseline, conversion of a nominal (say 1m) baseline suffices to easily calculate others; The same is true for baselines in a plane, where a conversion of two orthogonal baselines in that plane will suffice;

### Example

// Given a current phase stopping Center
MDirection indir(Quantity(3.25745692, "rad"),
Quantity(0.040643336,"rad"),
MDirection::Ref(MDirection::B1950));
// Conversion to J2000 is set by:
UVWMachine uvm(MDirection::Ref(MDirection::J2000), indir);
// The rotation matrix to go to new UVW is obtained by:
RotMatrix rm(uvm.rotationUVM());
// If an UVW specified:
MVPosition uvw(-739.048461, -1939.10604, 1168.62562);
// This can be converted by e.g.:
uvw *= rm;
// Or, alternatively, by e.g.:
uvm.convertUVW(uvw);
casacore::MDirection
Definition MDirection.h:171
casacore::MDirection::Ref
MeasRef< MDirection > Ref
Measure reference (i.e.
Definition MDirection.h:244
casacore::MDirection::B1950
@ B1950
Definition MDirection.h:190
casacore::MDirection::J2000
@ J2000
Definition MDirection.h:186
casacore::MVPosition
Definition MVPosition.h:111
casacore::RotMatrix
Definition RotMatrix.h:84
casacore::UVWMachine::UVWMachine
UVWMachine(const MDirection::Ref &out, const MDirection &in, Bool EW=False, Bool project=False)
Constructors have an EW flag, which will give a projection parallel to the polar axis rather than in ...
casacore::Quantity
Quantum< Double > Quantity
Definition Quantum.h:39

### Motivation

To aid making maps in different coordinate systems

### To Do

- add EW UVW coordinates
- check if non right-handed coordinates systems (like AzEl) are handled correctly
- provide a MVuvw and Muvw class to cater for second order effects appropiately

Definition at line 158 of file UVWMachine.h.

## Constructor & Destructor Documentation

## UVWMachine() [1/6]

casacore::UVWMachine::UVWMachine | ( | const MDirection::Ref & | out,
|  | const MDirection & | in,
|  | Bool | EW = False,
|  | Bool | project = False )

Constructors have an EW flag, which will give a projection parallel to the polar axis rather than in the direction of the fieldcenter, and a project flag.

The last will correct the UV coordinates to re-project them onto the plane specified by the in direction

Construct a UVW conversion machine from the in coordinate and its system to the out coordinate system (output absolute direction remains the same)

References casacore::False.

Referenced by copy(), operator=(), and UVWMachine().

## UVWMachine() [2/6]

casacore::UVWMachine::UVWMachine | ( | const MDirection & | out,
|  | const MDirection & | in,
|  | Bool | EW = False,
|  | Bool | project = False )

Construct a UVW conversion machine from the in coordinate and its system to the out coordinate and its system.

References casacore::False.

## UVWMachine() [3/6]

casacore::UVWMachine::UVWMachine | ( | const MDirection::Ref & | out,
|  | const MDirection & | in,
|  | const MeasFrame & | frame,
|  | Bool | EW = False,
|  | Bool | project = False )

Construct UVW conversion machine with an explicitly given frame.

References casacore::False.

## UVWMachine() [4/6]

casacore::UVWMachine::UVWMachine | ( | const MDirection & | out,
|  | const MDirection & | in,
|  | const MeasFrame & | frame,
|  | Bool | EW = False,
|  | Bool | project = False )

References casacore::False.

## UVWMachine() [5/6]

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

Copy constructor.

References UVWMachine().

## ~UVWMachine()

casacore::UVWMachine::~UVWMachine | ( |  | ) |

## UVWMachine() [6/6]

casacore::UVWMachine::UVWMachine | ( |  | ) |

private

default constructor: not implemented

## Member Function Documentation

## convertUVW() [1/8]

void casacore::UVWMachine::convertUVW | ( | Double & | phase,
|  | MVPosition & | uv ) const

References casacore::phase().

## convertUVW() [2/8]

void casacore::UVWMachine::convertUVW | ( | Double & | phase,
|  | Vector< Double > & | uv ) const

Replace UVW with converted, and return phase.

References casacore::phase().

## convertUVW() [3/8]

void casacore::UVWMachine::convertUVW | ( | MVPosition & | uv | ) | const

## convertUVW() [4/8]

void casacore::UVWMachine::convertUVW | ( | Vector< Double > & | phase,
|  | Vector< MVPosition > & | uv ) const

References casacore::phase().

## convertUVW() [5/8]

void casacore::UVWMachine::convertUVW | ( | Vector< Double > & | phase,
|  | Vector< Vector< Double > > & | uv ) const

References casacore::phase().

## convertUVW() [6/8]

void casacore::UVWMachine::convertUVW | ( | Vector< Double > & | uv | ) | const

replace UVW with converted values

## convertUVW() [7/8]

void casacore::UVWMachine::convertUVW | ( | Vector< MVPosition > & | uv | ) | const

## convertUVW() [8/8]

void casacore::UVWMachine::convertUVW | ( | Vector< Vector< Double > > & | uv | ) | const

## copy()

void casacore::UVWMachine::copy | ( | const UVWMachine & | other | ) |

private

Copy data members.

References UVWMachine().

## getPhase() [1/4]

Double casacore::UVWMachine::getPhase | ( | MVPosition & | uv | ) | const

## getPhase() [2/4]

Double casacore::UVWMachine::getPhase | ( | Vector< Double > & | uv | ) | const

Get phase shift (in implied units of UVW), and change input uvw as well.

## getPhase() [3/4]

Vector< Double > casacore::UVWMachine::getPhase | ( | Vector< MVPosition > & | uv | ) | const

## getPhase() [4/4]

Vector< Double > casacore::UVWMachine::getPhase | ( | Vector< Vector< Double > > & | uv | ) | const

## init()

void casacore::UVWMachine::init | ( |  | ) |

private

Initialise machinery.

## isNOP()

Bool casacore::UVWMachine::isNOP | ( |  | ) |

inline

Return if the engine is an effective NOP.

Definition at line 204 of file UVWMachine.h.

References nop_p.

## operator()() [1/4]

MVPosition casacore::UVWMachine::operator() | ( | const MVPosition & | uv | ) | const

## operator()() [2/4]

Vector< Double > casacore::UVWMachine::operator() | ( | const Vector< Double > & | uv | ) | const

Return converted UVW coordinates.

## operator()() [3/4]

Vector< MVPosition > casacore::UVWMachine::operator() | ( | const Vector< MVPosition > & | uv | ) | const

## operator()() [4/4]

Vector< Vector< Double > > casacore::UVWMachine::operator() | ( | const Vector< Vector< Double > > & | uv | ) | const

## operator=()

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

Copy assignments.

References UVWMachine().

## phaseCenter()

const MDirection & casacore::UVWMachine::phaseCenter | ( |  | ) | const

Return the new phase center coordinates.

## planetinit()

void casacore::UVWMachine::planetinit | ( |  | ) |

private

Planet handling.

## reCalculate()

void casacore::UVWMachine::reCalculate | ( |  | ) |

Recalculate the parameters for the machine after e.g.

a frame change

## rotationPhase()

const MVPosition & casacore::UVWMachine::rotationPhase | ( |  | ) | const

Return a position vector that can produce the phase correction: dPhase = rotationPhase * UVW(new).

## rotationUVW()

const RotMatrix & casacore::UVWMachine::rotationUVW | ( |  | ) | const

Return a rotation matrix that can be used to convert UVW coordinates: UVW(new) = UVW(old) * rotationUVW().

## Member Data Documentation

## conv_p

MDirection::Convert casacore::UVWMachine::conv_p

private

Conversion engine.

Definition at line 270 of file UVWMachine.h.

## ew_p

Bool casacore::UVWMachine::ew_p

private

EW flag.

Definition at line 240 of file UVWMachine.h.

## in_p

MDirection casacore::UVWMachine::in_p

private

Old phase center.

Definition at line 248 of file UVWMachine.h.

## nop_p

Bool casacore::UVWMachine::nop_p

private

No conversion necessary flag.

Definition at line 246 of file UVWMachine.h.

Referenced by isNOP().

## out_p

MDirection casacore::UVWMachine::out_p

private

New phase center.

Definition at line 254 of file UVWMachine.h.

## outin_p

MDirection casacore::UVWMachine::outin_p

private

Old phase center in new coordinates.

Definition at line 252 of file UVWMachine.h.

## outref_p

MDirection::Ref casacore::UVWMachine::outref_p

private

New coordinate reference.

Definition at line 250 of file UVWMachine.h.

## phrot_p

MVPosition casacore::UVWMachine::phrot_p

private

Phase rotation.

Definition at line 268 of file UVWMachine.h.

## proj_p

Bool casacore::UVWMachine::proj_p

private

Projection flag.

Definition at line 242 of file UVWMachine.h.

## rot1_p

RotMatrix casacore::UVWMachine::rot1_p

private

Rotation Matrix to go from input UVW to coordinate system.

Definition at line 256 of file UVWMachine.h.

## rot2_p

RotMatrix casacore::UVWMachine::rot2_p

private

Rotation matrix to go from old system to new system.

Definition at line 258 of file UVWMachine.h.

## rot3_p

RotMatrix casacore::UVWMachine::rot3_p

private

Rotation Matrix to go from new coordinate system to output UVW.

Definition at line 260 of file UVWMachine.h.

## rot4_p

RotMatrix casacore::UVWMachine::rot4_p

private

Rotation Matrix to project UV-plane onto.

Definition at line 262 of file UVWMachine.h.

## uvproj_p

RotMatrix casacore::UVWMachine::uvproj_p

private

UVW rotation including projection.

Definition at line 266 of file UVWMachine.h.

## uvrot_p

RotMatrix casacore::UVWMachine::uvrot_p

private

UVW rotation.

Definition at line 264 of file UVWMachine.h.

## zp_p

Bool casacore::UVWMachine::zp_p

private

Zero phase flag (for speed).

Definition at line 244 of file UVWMachine.h.

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

- measures/Measures/UVWMachine.h