Loading...
Searching...
No Matches
casacore::AxesMapping Class Reference
casa package (libcasa_casa) » Arrays_module » Arrays_module_internal_classes

More...

`#include <AxesMapping.h>`

## Public Member Functions

| AxesMapping ()
| The default constructor creates empty maps.
| AxesMapping (const IPosition &oldToNew)
| Construct it with the mapping from old to new axes order.
bool | isRemoved () const
| Are axes removed?
bool | isReordered () const
| Is the axes order reordered?
const IPosition & | getToNew () const
| Get the mapping of old->new.
const IPosition & | getToOld () const
| Get the mapping of new->old.
IPosition | posToNew (const IPosition &pos) const
| Map an old position to the new one.
IPosition | posToOld (const IPosition &pos) const
| Map a new position or shape to the old one.
IPosition | shapeToNew (const IPosition &shape) const
| Map an old shape to the new one.
IPosition | shapeToOld (const IPosition &shape) const
| Map a new position or shape to the old one.
Slicer | slicerToNew (const Slicer &slicer) const
| Map an old shape to the new one.
Slicer | slicerToOld (const Slicer &slicer) const
| Map a new position or shape to the old one.

## Private Attributes

IPosition | itsToNew
IPosition | itsToOld
bool | itsRemoved
bool | itsReordered

## Detailed Description

Info about mapping array axes to another order.

### Intended use:

Internal

### Review Status

Date Reviewed:
  yyyy/mm/dd
Test programs:
  tAxesSpecifier

### Prerequisite

- IPosition
- AxesSpecifier

### Synopsis

AxesMapping holds the information about mapping axes to another order. It can be constructed by AxesSpecifier by applying a shape to the axes specification.
AxesMapping is thereafter used to map positions, shapes, and slices to the new axes or backwards.
Caution: Shapes and positions are both represented by class IPosition; However, they have to be treated differently in this class, because removed axes for a position have value 0, while for a shape they have value 1; Hence there are different functions for them and the user has to take care that the correct function is called;

### Example

### Motivation

The class encapsulates the mapping functionality. It is meant as a helper class for casacore's SubLattice.

Definition at line 81 of file AxesMapping.h.

## Constructor & Destructor Documentation

## AxesMapping() [1/2]

casacore::AxesMapping::AxesMapping | ( |  | ) |

The default constructor creates empty maps.

## AxesMapping() [2/2]

casacore::AxesMapping::AxesMapping | ( | const IPosition & | oldToNew | ) |

explicit

Construct it with the mapping from old to new axes order.

A value of -1 means that the old axes is ignored in the new one. Another value gives the new axis number.
It determines if axes are removed and/or reordered.

## Member Function Documentation

## getToNew()

const IPosition & casacore::AxesMapping::getToNew | ( |  | ) | const

inline

Get the mapping of old->new.

The length of the resulting IPosition is the dimensionality of the original lattice. A value of -1 indicates that the corresponding axis in the original lattice is removed. Another value is the axis number in the new lattice,

Definition at line 106 of file AxesMapping.h.

References itsToNew.

## getToOld()

const IPosition & casacore::AxesMapping::getToOld | ( |  | ) | const

inline

Get the mapping of new->old.

The length of the resulting IPosition is the dimensionality of the new lattice. Its values give the axes in the original lattice.

Definition at line 112 of file AxesMapping.h.

References itsToOld.

## isRemoved()

bool casacore::AxesMapping::isRemoved | ( |  | ) | const

inline

Are axes removed?

Definition at line 94 of file AxesMapping.h.

References itsRemoved.

## isReordered()

bool casacore::AxesMapping::isReordered | ( |  | ) | const

inline

Is the axes order reordered?

Definition at line 98 of file AxesMapping.h.

References itsReordered.

## posToNew()

IPosition casacore::AxesMapping::posToNew | ( | const IPosition & | pos | ) | const

Map an old position to the new one.

In debug-mode it checks if the removed axes have position 0 in the input position.

## posToOld()

IPosition casacore::AxesMapping::posToOld | ( | const IPosition & | pos | ) | const

Map a new position or shape to the old one.

## shapeToNew()

IPosition casacore::AxesMapping::shapeToNew | ( | const IPosition & | shape | ) | const

Map an old shape to the new one.

In debug-mode it checks if the removed axes have length 1 in the input shape.

References casacore::shape().

## shapeToOld()

IPosition casacore::AxesMapping::shapeToOld | ( | const IPosition & | shape | ) | const

Map a new position or shape to the old one.

References casacore::shape().

## slicerToNew()

Slicer casacore::AxesMapping::slicerToNew | ( | const Slicer & | slicer | ) | const

Map an old shape to the new one.

In debug-mode it checks if the removed axes have length 1 in the input slicer.

## slicerToOld()

Slicer casacore::AxesMapping::slicerToOld | ( | const Slicer & | slicer | ) | const

Map a new position or shape to the old one.

## Member Data Documentation

## itsRemoved

bool casacore::AxesMapping::itsRemoved

private

Definition at line 142 of file AxesMapping.h.

Referenced by isRemoved().

## itsReordered

bool casacore::AxesMapping::itsReordered

private

Definition at line 143 of file AxesMapping.h.

Referenced by isReordered().

## itsToNew

IPosition casacore::AxesMapping::itsToNew

private

Definition at line 140 of file AxesMapping.h.

Referenced by getToNew().

## itsToOld

IPosition casacore::AxesMapping::itsToOld

private

Definition at line 141 of file AxesMapping.h.

Referenced by getToOld().

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

- casa/Arrays/AxesMapping.h