casacore
Public Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::ExtendSpecifier Class Reference

More...

#include <ExtendSpecifier.h>

Public Member Functions

 ExtendSpecifier ()
 Default constructor generates empty IPositions. More...
 
 ExtendSpecifier (const IPosition &oldShape, const IPosition &newShape, const IPosition &newAxes, const IPosition &stretchAxes)
 Tell if no or all degenerate axes have to be removed. More...
 
const IPositionnewShape () const
 Return the new shape. More...
 
const IPositionnewAxes () const
 Return the new axes. More...
 
const IPositionstretchAxes () const
 Return the axes to be stretched. More...
 
const IPositionoldShape () const
 Return the old shape. More...
 
const IPositionextendAxes () const
 Return the axes to be extended (i.e. More...
 
const IPositionoldOldAxes () const
 Return the old axes (i.e. More...
 
const IPositionoldNewAxes () const
 Return the old axes as in new shape. More...
 
Slicer convert (IPosition &shape, const Slicer &section) const
 Convert the slicer to the specification for the old shape. More...
 
IPosition convertNew (const IPosition &oldShape) const
 Convert a shape to the specification for the new shape. More...
 

Private Member Functions

void fill (bool *flags, size_t nrdim, const IPosition &axes) const
 Fill the flags for the given axes. More...
 

Private Attributes

IPosition itsOldShape
 
IPosition itsNewShape
 
IPosition itsNewAxes
 
IPosition itsStretchAxes
 
IPosition itsExtendAxes
 
IPosition itsOldOldAxes
 
IPosition itsOldNewAxes
 

Detailed Description

Specification of new and stretched lattice axes

Intended use:

Internal

Review Status

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

Prerequisite

Synopsis

ExtendSpecifier is a class internally used by casacore class ExtendLattice. It holds the information which axes are stretched and which axes are new. Note that a stretched axis has to have length 1 in the original shape.

The class only contains the functionality needed by ExtendLattice. which are (mainly) 2 conversion functions. One function converts a slicer from the extended lattice to the original lattice, so ExtendLattice can read the correct data. The other function converts a shape in the original lattice to the shape in the extended lattice.
Some data is precalculated for more efficient processing of the conversion of slicers and shapes.

Example

IPosition oldShape(4,10,1,3,1);
IPosition newShape(5,10,1,5,3,8);
ExtendSpecifier spec (oldShape, newShape, IPosition(1,2), IPosition(1,4));
const IPosition & newShape() const
Return the new shape.
const IPosition & oldShape() const
Return the old shape.
ExtendSpecifier()
Default constructor generates empty IPositions.

This example extends the old shape to the new shape.
The 3rd argument tells that axes 2 is new. The newShape tells that its length will be 5. Note that adding this axis means that axes 2 in the old shape will get axes 3 in the new shape.
The 4th argument tells that axes 4 (in the new shape!!) is stretched (to 8 according to newShape).

Definition at line 88 of file ExtendSpecifier.h.

Constructor & Destructor Documentation

◆ ExtendSpecifier() [1/2]

casacore::ExtendSpecifier::ExtendSpecifier ( )

Default constructor generates empty IPositions.

◆ ExtendSpecifier() [2/2]

casacore::ExtendSpecifier::ExtendSpecifier ( const IPosition oldShape,
const IPosition newShape,
const IPosition newAxes,
const IPosition stretchAxes 
)

Tell if no or all degenerate axes have to be removed.

Member Function Documentation

◆ convert()

Slicer casacore::ExtendSpecifier::convert ( IPosition shape,
const Slicer section 
) const

Convert the slicer to the specification for the old shape.

It fills shape with the shape to reform the section length such that it contains the new axes.

◆ convertNew()

IPosition casacore::ExtendSpecifier::convertNew ( const IPosition oldShape) const

Convert a shape to the specification for the new shape.

◆ extendAxes()

const IPosition& casacore::ExtendSpecifier::extendAxes ( ) const
inline

Return the axes to be extended (i.e.

new and stretch axes).

Definition at line 117 of file ExtendSpecifier.h.

References itsExtendAxes.

◆ fill()

void casacore::ExtendSpecifier::fill ( bool *  flags,
size_t  nrdim,
const IPosition axes 
) const
private

Fill the flags for the given axes.

It throws an exception if the axis is invalid or multiply given.

◆ newAxes()

const IPosition& casacore::ExtendSpecifier::newAxes ( ) const
inline

Return the new axes.

Definition at line 105 of file ExtendSpecifier.h.

References itsNewAxes.

◆ newShape()

const IPosition& casacore::ExtendSpecifier::newShape ( ) const
inline

Return the new shape.

Definition at line 101 of file ExtendSpecifier.h.

References itsNewShape.

◆ oldNewAxes()

const IPosition& casacore::ExtendSpecifier::oldNewAxes ( ) const
inline

Return the old axes as in new shape.

Definition at line 125 of file ExtendSpecifier.h.

References itsOldNewAxes.

◆ oldOldAxes()

const IPosition& casacore::ExtendSpecifier::oldOldAxes ( ) const
inline

Return the old axes (i.e.

axes new nor stretched) as in old shape.

Definition at line 121 of file ExtendSpecifier.h.

References itsOldOldAxes.

◆ oldShape()

const IPosition& casacore::ExtendSpecifier::oldShape ( ) const
inline

Return the old shape.

Definition at line 113 of file ExtendSpecifier.h.

References itsOldShape.

◆ stretchAxes()

const IPosition& casacore::ExtendSpecifier::stretchAxes ( ) const
inline

Return the axes to be stretched.

Definition at line 109 of file ExtendSpecifier.h.

References itsStretchAxes.

Member Data Documentation

◆ itsExtendAxes

IPosition casacore::ExtendSpecifier::itsExtendAxes
private

Definition at line 145 of file ExtendSpecifier.h.

Referenced by extendAxes().

◆ itsNewAxes

IPosition casacore::ExtendSpecifier::itsNewAxes
private

Definition at line 143 of file ExtendSpecifier.h.

Referenced by newAxes().

◆ itsNewShape

IPosition casacore::ExtendSpecifier::itsNewShape
private

Definition at line 142 of file ExtendSpecifier.h.

Referenced by newShape().

◆ itsOldNewAxes

IPosition casacore::ExtendSpecifier::itsOldNewAxes
private

Definition at line 147 of file ExtendSpecifier.h.

Referenced by oldNewAxes().

◆ itsOldOldAxes

IPosition casacore::ExtendSpecifier::itsOldOldAxes
private

Definition at line 146 of file ExtendSpecifier.h.

Referenced by oldOldAxes().

◆ itsOldShape

IPosition casacore::ExtendSpecifier::itsOldShape
private

Definition at line 141 of file ExtendSpecifier.h.

Referenced by oldShape().

◆ itsStretchAxes

IPosition casacore::ExtendSpecifier::itsStretchAxes
private

Definition at line 144 of file ExtendSpecifier.h.

Referenced by stretchAxes().


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