Loading...
Searching...
No Matches
casacore::LatticeSlice1D< T > Class Template Reference
lattices package (libcasa_lattices) » LatticeMath_module

More...

`#include <LatticeSlice1D.h>`

## Public Types

enum | Method { NEAREST , LINEAR , CUBIC , N_TYPES }
| Interpolation method. More...

## Public Member Functions

| LatticeSlice1D ()
| Default constructor - object useless.
| LatticeSlice1D (const MaskedLattice< T > &lattice, Method method=LINEAR)
| Constructor.
| LatticeSlice1D (const LatticeSlice1D< T > &other)
| Copy constructor (reference semantics).
virtual | ~LatticeSlice1D ()
| Destructor.
LatticeSlice1D< T > & | operator= (const LatticeSlice1D< T > &other)
| Assignment operator (reference semantics).
void | getSlice (Vector< T > &data, Vector< Bool > &mask, const PixelCurve1D &curve, uInt axis0, uInt axis1, const IPosition &coord)
| Get 1-D slice.
void | getSlice (Vector< T > &data, Vector< Bool > &mask, const IPosition &blc, const IPosition &trc, uInt nPts=0)
| Get 1-D slice between blc & trc.
void | getPosition (uInt &axis0, uInt &axis1, Vector< Float > &x, Vector< Float > &y, Vector< Float > &distance) const
| Get the (x,y) pixel coordinates from the last slice and the distance along the slice in pixels.
Method | interpolationMethod () const
| Recover interpolation method.

## Static Public Member Functions

static Method | stringToMethod (const String &method)

## Private Member Functions

void | checkCurve (IPosition &blc, IPosition &trc, const IPosition &coord, const PixelCurve1D &curve)
| Check the suppliec curve is valid.
void | findPlane (const IPosition &blc, const IPosition &trc)
| Find the slice plane.
void | doGetSlice (Vector< T > &data, Vector< Bool > &mask, const PixelCurve1D &curve, const IPosition &blc, const IPosition &trc)
| Get the interpolated slice.
void | makeInterpolator (Method method)
| Make Interpolator.

## Private Attributes

MaskedLattice< T > * | itsLatticePtr
Interpolate2D * | itsInterpPtr
Method | itsMethod
Vector< Float > | itsX
Vector< Float > | itsY
Vector< Double > | itsPos
uInt | itsAxis0
uInt | itsAxis1

## Detailed Description

template<class T>
class casacore::LatticeSlice1D< T >

Extract a 1-D slice from a Lattice

### Intended use:

Public interface

### Review Status

Date Reviewed:
  yyyy/mm/dd
Test programs:
  test/tLatticeSlice1D

### Prerequisite

- MaskedLattice

### Etymology

### Synopsis

This class extracts an interpolated 1-D slice from a Lattice with a range of interpolation schemes available. The slice must lie in the plane of two cardinal axes.

Tip:

### Example

IPosition shape(2, 20, 30); // Create MaskedLattice
ArrayLattice<Float> arrLat(shape);
SubLattice<Float> subLat(arrLat);
LatticeSlice1D<Float> slicer(subLat);
IPosition blc(2); blc = 0; // Extract slice between corners
IPosition trc(shape-1);
Vector<Float> data;
Vector<Bool> mask;
slicer.getSlice (data, mask, blc, trc);
casacore::ArrayLattice
Definition ArrayLattice.h:144
casacore::IPosition
Definition IPosition.h:117
casacore::LatticeSlice1D::LatticeSlice1D
LatticeSlice1D()
Default constructor - object useless.
casacore::SubLattice
Definition SubLattice.h:83
casacore::Vector
Definition Vector.h:82
casacore::mask
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
casacore::shape
IPosition shape(const RecordFieldId &) const
Get the actual shape of this field.

### Motivation

Users often want to see cross-cuts through their data.

### To Do

- Handle curves not in cardinal axis plane
- Derive from MaskedLattice ?

Definition at line 92 of file LatticeSlice1D.h.

## Member Enumeration Documentation

## Method

template<class T>

enum casacore::LatticeSlice1D::Method

Interpolation method.

Enumerator
NEAREST |
LINEAR |
CUBIC |
N_TYPES |

Definition at line 97 of file LatticeSlice1D.h.

## Constructor & Destructor Documentation

## LatticeSlice1D() [1/3]

template<class T>

casacore::LatticeSlice1D< T >::LatticeSlice1D | ( |  | ) |

Default constructor - object useless.

Referenced by LatticeSlice1D(), and operator=().

## LatticeSlice1D() [2/3]

template<class T>

casacore::LatticeSlice1D< T >::LatticeSlice1D | ( | const MaskedLattice< T > & | lattice,
|  | Method | method = LINEAR )

Constructor.

References LINEAR.

## LatticeSlice1D() [3/3]

template<class T>

casacore::LatticeSlice1D< T >::LatticeSlice1D | ( | const LatticeSlice1D< T > & | other | ) |

Copy constructor (reference semantics).

References LatticeSlice1D().

## ~LatticeSlice1D()

template<class T>

virtual casacore::LatticeSlice1D< T >::~LatticeSlice1D | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## checkCurve()

template<class T>

void casacore::LatticeSlice1D< T >::checkCurve | ( | IPosition & | blc,
|  | IPosition & | trc,
|  | const IPosition & | coord,
|  | const PixelCurve1D & | curve )

private

Check the suppliec curve is valid.

## doGetSlice()

template<class T>

void casacore::LatticeSlice1D< T >::doGetSlice | ( | Vector< T > & | data,
|  | Vector< Bool > & | mask,
|  | const PixelCurve1D & | curve,
|  | const IPosition & | blc,
|  | const IPosition & | trc )

private

Get the interpolated slice.

References casacore::mask().

## findPlane()

template<class T>

void casacore::LatticeSlice1D< T >::findPlane | ( | const IPosition & | blc,
|  | const IPosition & | trc )

private

Find the slice plane.

## getPosition()

template<class T>

void casacore::LatticeSlice1D< T >::getPosition | ( | uInt & | axis0,
|  | uInt & | axis1,
|  | Vector< Float > & | x,
|  | Vector< Float > & | y,
|  | Vector< Float > & | distance ) const

Get the (x,y) pixel coordinates from the last slice and the distance along the slice in pixels.

. Also recover the axes of the slice plane

## getSlice() [1/2]

template<class T>

void casacore::LatticeSlice1D< T >::getSlice | ( | Vector< T > & | data,
|  | Vector< Bool > & | mask,
|  | const IPosition & | blc,
|  | const IPosition & | trc,
|  | uInt | nPts = 0 )

Get 1-D slice between blc & trc.

These start and end points must be in a cardinal plane of the lattice. If nPts is 0 it is set automatically to the length of the slice.

References casacore::mask().

## getSlice() [2/2]

template<class T>

void casacore::LatticeSlice1D< T >::getSlice | ( | Vector< T > & | data,
|  | Vector< Bool > & | mask,
|  | const PixelCurve1D & | curve,
|  | uInt | axis0,
|  | uInt | axis1,
|  | const IPosition & | coord )

Get 1-D slice.

PixelCurve1D supplies the locus of the slice in the plane specified by axis0 and axis1. The pixel coordinate for the rest of the lattice is specified in coord.

References casacore::mask().

## interpolationMethod()

template<class T>

Method casacore::LatticeSlice1D< T >::interpolationMethod | ( |  | ) | const

inline

Recover interpolation method.

Definition at line 133 of file LatticeSlice1D.h.

References itsMethod.

## makeInterpolator()

template<class T>

void casacore::LatticeSlice1D< T >::makeInterpolator | ( | Method | method | ) |

private

Make Interpolator.

## operator=()

template<class T>

LatticeSlice1D< T > & casacore::LatticeSlice1D< T >::operator= | ( | const LatticeSlice1D< T > & | other | ) |

Assignment operator (reference semantics).

References LatticeSlice1D().

## stringToMethod()

template<class T>

Method casacore::LatticeSlice1D< T >::stringToMethod | ( | const String & | method | ) |

static

## Member Data Documentation

## itsAxis0

template<class T>

uInt casacore::LatticeSlice1D< T >::itsAxis0

private

Definition at line 158 of file LatticeSlice1D.h.

## itsAxis1

template<class T>

uInt casacore::LatticeSlice1D< T >::itsAxis1

private

Definition at line 159 of file LatticeSlice1D.h.

## itsInterpPtr

template<class T>

Interpolate2D* casacore::LatticeSlice1D< T >::itsInterpPtr

private

Definition at line 153 of file LatticeSlice1D.h.

## itsLatticePtr

template<class T>

MaskedLattice<T>* casacore::LatticeSlice1D< T >::itsLatticePtr

private

Definition at line 152 of file LatticeSlice1D.h.

## itsMethod

template<class T>

Method casacore::LatticeSlice1D< T >::itsMethod

private

Definition at line 154 of file LatticeSlice1D.h.

Referenced by interpolationMethod().

## itsPos

template<class T>

Vector<Double> casacore::LatticeSlice1D< T >::itsPos

private

Definition at line 157 of file LatticeSlice1D.h.

## itsX

template<class T>

Vector<Float> casacore::LatticeSlice1D< T >::itsX

private

Definition at line 155 of file LatticeSlice1D.h.

## itsY

template<class T>

Vector<Float> casacore::LatticeSlice1D< T >::itsY

private

Definition at line 156 of file LatticeSlice1D.h.

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

- lattices/LatticeMath/LatticeSlice1D.h