Go to the documentation of this file.
29 #ifndef LATTICES_SUBLATTICE_H
30 #define LATTICES_SUBLATTICE_H
34 #include <casacore/casa/aips.h>
35 #include <casacore/lattices/Lattices/MaskedLattice.h>
36 #include <casacore/lattices/LRegions/LatticeRegion.h>
37 #include <casacore/casa/Arrays/AxesSpecifier.h>
38 #include <casacore/casa/Arrays/AxesMapping.h>
85 template<
class T>
class SubLattice:
public MaskedLattice<T>
102 SubLattice (
const Lattice<T>& lattice, AxesSpecifier=AxesSpecifier());
104 AxesSpecifier=AxesSpecifier());
115 SubLattice (
const MaskedLattice<T>& lattice, AxesSpecifier=AxesSpecifier());
117 AxesSpecifier=AxesSpecifier());
130 AxesSpecifier=AxesSpecifier());
132 Bool writableIfPossible, AxesSpecifier=AxesSpecifier());
134 AxesSpecifier=AxesSpecifier());
136 Bool writableIfPossible, AxesSpecifier=AxesSpecifier());
145 SubLattice (
const Lattice<T>& lattice,
const Slicer& slicer,
146 AxesSpecifier=AxesSpecifier());
147 SubLattice (Lattice<T>& lattice,
const Slicer& slicer,
148 Bool writableIfPossible, AxesSpecifier=AxesSpecifier());
149 SubLattice (
const MaskedLattice<T>& lattice,
const Slicer& slicer,
150 AxesSpecifier=AxesSpecifier());
151 SubLattice (MaskedLattice<T>& lattice,
const Slicer& slicer,
152 Bool writableIfPossible, AxesSpecifier=AxesSpecifier());
161 SubLattice<T>&
operator= (
const SubLattice<T>& other);
164 virtual MaskedLattice<T>*
cloneML()
const;
203 virtual void flush();
219 virtual const Lattice<Bool>&
pixelMask()
const;
237 virtual IPosition
shape()
const;
248 virtual T
getAt (
const IPosition& where)
const;
249 virtual void putAt (
const T&
value,
const IPosition& where);
258 virtual LatticeIterInterface<T>*
makeIter (
const LatticeNavigator& navigator,
262 virtual Bool doGetSlice (Array<T>& buffer,
const Slicer& section);
265 virtual void doPutSlice (
const Array<T>& sourceBuffer,
266 const IPosition& where,
267 const IPosition& stride);
313 Bool writableIfPossible);
348 #ifndef CASACORE_NO_AUTO_TEMPLATES
349 #include <casacore/lattices/Lattices/SubLattice.tcc>
350 #endif //# CASACORE_NO_AUTO_TEMPLATES
Specify which elements to extract from an n-dimensional array.
IPosition positionInParent(const IPosition &subLatticePosition) const
Convert the specified position in the sublattice to the corresponding position in the parent lattice.
A Vector of integers, for indexing into Array<T> objects.
virtual void reopen()
If needed, reopen a temporarily closed Lattice.
virtual void tempClose()
Close the Lattice temporarily (if it is paged to disk).
virtual Bool canReferenceArray() const
Can the lattice data be referenced as an array section?
void setPtr(Lattice< T > *latticePtr, MaskedLattice< T > *maskLatPtr, Bool writableIfPossible)
Set the various pointers needed to construct the object.
A templated, abstract base class for array-like objects with masks.
virtual void flush()
Flush the data.
IPosition posToOld(const IPosition &pos) const
Map a new position or shape to the old one.
virtual String name(Bool stripPath=False) const
Return the name of the parent lattice.
A subset of a Lattice or MaskedLattice.
virtual Bool isPaged() const
Is the SubLattice paged to disk?
LockType
Define the possible lock types.
virtual IPosition shape() const
Returns the shape of the SubLattice including all degenerate axes (i.e.
Bool getRegionDataSlice(Array< Bool > &buffer, const Slicer §ion)
Get mask data from region and mask.
Lattice< Bool > * itsPixelMask
void andMask(Array< Bool > &buffer, Bool ref, const Array< Bool > &tmpbuf) const
And tmpbuf into buffer.
An optionally strided region in a Lattice.
virtual Bool isPersistent() const
A SubLattice is persistent if no region is applied to the parent lattice.
virtual IPosition doNiceCursorShape(uInt maxPixels) const
Get the best cursor shape.
Lattice< Bool > * itsOwnPixelMask
const AxesMapping & getAxesMap() const
Set the axes mapping from the specification.
Lattice< T > * itsLatticePtr
virtual void doPutSlice(const Array< T > &sourceBuffer, const IPosition &where, const IPosition &stride)
Do the actual getting of an array of values.
const LatticeRegion & region() const
Get the region used.
virtual Bool lock(FileLocker::LockType, uInt nattempts)
Handle locking of the SubLattice which is delegated to its parent.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
virtual Bool hasLock(FileLocker::LockType) const
Bool getMaskDataSlice(Array< Bool > &buffer, const Slicer §ion)
virtual uInt advisedMaxPixels() const
This function returns the recommended maximum number of pixels to include in the cursor of an iterato...
virtual Bool doGetSlice(Array< T > &buffer, const Slicer §ion)
Do the actual getting of an array of values.
virtual Bool hasPixelMask() const
Does the SubLattice have a pixelmask?
void setAxesMap(const AxesSpecifier &)
Set the axes mapping from the specification.
virtual Bool doGetMaskSlice(Array< Bool > &buffer, const Slicer §ion)
Get a section of the mask.
virtual Bool isMasked() const
Is the lattice masked? It is if its parent lattice or its region is masked.
virtual Bool isWritable() const
Is the SubLattice writable?
SubLattice< T > & operator=(const SubLattice< T > &other)
Assignment (reference semantics).
this file contains all the compiler specific defines
virtual const Lattice< Bool > & pixelMask() const
Get access to the pixelmask.
Slicer convert(const Slicer &slicer) const
Convert positions to positions in the parent object.
Info about mapping array axes to another order.
virtual void putAt(const T &value, const IPosition &where)
Put the value of a single element.
virtual T getAt(const IPosition &where) const
Get or put a single element in the lattice.
MaskedLattice< T > * itsMaskLatPtr
A templated, abstract base class for array-like objects.
virtual Bool ok() const
Check class internals - used for debugging.
virtual MaskedLattice< T > * cloneML() const
Make a copy of the object (reference semantics).
AxesSpecifier itsAxesSpec
bool Bool
Define the standard types used by Casacore.
Specification of axes to keep or remove.
virtual const LatticeRegion * getRegionPtr() const
Get a pointer the region/mask object describing this sublattice.
SubLattice()
The default constructor creates a SubLattice that is useless for just about everything,...
void setPixelMask(const Lattice< Bool > &pixelMask, Bool mayExist)
Use the given mask as the pixelmask.
virtual void resync()
Resynchronize the Lattice object with the lattice file.
virtual LatticeIterInterface< T > * makeIter(const LatticeNavigator &navigator, Bool useRef) const
This function is used by the LatticeIterator class to generate an iterator of the correct type for th...
Bool isRemoved() const
Are axes removed?