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>
313 Bool writableIfPossible);
348 #ifndef CASACORE_NO_AUTO_TEMPLATES
349 #include <casacore/lattices/Lattices/SubLattice.tcc>
bool isRemoved() const
Are axes removed?
IPosition posToOld(const IPosition &pos) const
Map a new position or shape to the old one.
LockType
Define the possible lock types.
Slicer convert(const Slicer &slicer) const
Convert positions to positions in the parent object.
const LatticeRegion & region() const
Get the region used.
String: the storage and methods of handling collections of characters.
SubLattice(Lattice< T > &lattice, const Slicer &slicer, Bool writableIfPossible, AxesSpecifier=AxesSpecifier())
void setPixelMask(const Lattice< Bool > &pixelMask, Bool mayExist)
Use the given mask as the pixelmask.
SubLattice()
The default constructor creates a SubLattice that is useless for just about everything,...
virtual void tempClose()
Close the Lattice temporarily (if it is paged to disk).
virtual MaskedLattice< T > * cloneML() const
Make a copy of the object (reference semantics).
virtual Bool ok() const
Check class internals - used for debugging.
Lattice< Bool > * itsPixelMask
virtual void flush()
Flush the data.
virtual Bool hasLock(FileLocker::LockType) const
SubLattice(MaskedLattice< T > &lattice, const LatticeRegion ®ion, Bool writableIfPossible, AxesSpecifier=AxesSpecifier())
SubLattice(Lattice< T > &lattice, const LatticeRegion ®ion, Bool writableIfPossible, AxesSpecifier=AxesSpecifier())
virtual void doPutSlice(const Array< T > &sourceBuffer, const IPosition &where, const IPosition &stride)
Do the actual getting of an array of values.
virtual Bool canReferenceArray() const
Can the lattice data be referenced as an array section?
SubLattice(const Lattice< T > &lattice, const Slicer &slicer, AxesSpecifier=AxesSpecifier())
Create a SubLattice from the given (Masked)Lattice and slicer.
void setRegion(const Slicer &slicer)
Set the region object using a slicer.
const AxesMapping & getAxesMap() const
Set the axes mapping from the specification.
IPosition positionInParent(const IPosition &subLatticePosition) const
Convert the specified position in the sublattice to the corresponding position in the parent lattice.
void andMask(Array< Bool > &buffer, Bool ref, const Array< Bool > &tmpbuf) const
And tmpbuf into buffer.
virtual Bool isPersistent() const
A SubLattice is persistent if no region is applied to the parent lattice.
virtual Lattice< Bool > & pixelMask()
SubLattice(const Lattice< T > &lattice, AxesSpecifier=AxesSpecifier())
Create a SubLattice from a Lattice.
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...
virtual Bool isMasked() const
Is the lattice masked? It is if its parent lattice or its region is masked.
virtual void putAt(const T &value, const IPosition &where)
Put the value of a single element.
Bool getMaskDataSlice(Array< Bool > &buffer, const Slicer §ion)
virtual IPosition shape() const
Returns the shape of the SubLattice including all degenerate axes (i.e.
void setPtr(Lattice< T > *latticePtr, MaskedLattice< T > *maskLatPtr, Bool writableIfPossible)
Set the various pointers needed to construct the object.
SubLattice< T > & operator=(const SubLattice< T > &other)
Assignment (reference semantics).
SubLattice(const MaskedLattice< T > &lattice, const LatticeRegion ®ion, AxesSpecifier=AxesSpecifier())
void setAxesMap(const AxesSpecifier &)
Set the axes mapping from the specification.
virtual T getAt(const IPosition &where) const
Get or put a single element in the lattice.
SubLattice(Lattice< T > &lattice, Bool writableIfPossible, AxesSpecifier=AxesSpecifier())
virtual Bool isPaged() const
Is the SubLattice paged to disk?
virtual Bool hasPixelMask() const
Does the SubLattice have a pixelmask?
SubLattice(const MaskedLattice< T > &lattice, AxesSpecifier=AxesSpecifier())
Create a SubLattice from a MaskedLattice.
SubLattice(MaskedLattice< T > &lattice, const Slicer &slicer, Bool writableIfPossible, AxesSpecifier=AxesSpecifier())
void setRegion(const LatticeRegion ®ion)
Set the region object.
virtual Bool doGetMaskSlice(Array< Bool > &buffer, const Slicer §ion)
Get a section of the mask.
virtual Bool doGetSlice(Array< T > &buffer, const Slicer §ion)
Do the actual getting of an array of values.
MaskedLattice< T > * itsMaskLatPtr
virtual Bool isWritable() const
Is the SubLattice writable?
virtual const Lattice< Bool > & pixelMask() const
Get access to the pixelmask.
virtual String name(Bool stripPath=False) const
Return the name of the parent lattice.
virtual Bool lock(FileLocker::LockType, uInt nattempts)
Handle locking of the SubLattice which is delegated to its parent.
virtual uInt advisedMaxPixels() const
This function returns the recommended maximum number of pixels to include in the cursor of an iterato...
Bool getRegionDataSlice(Array< Bool > &buffer, const Slicer §ion)
Get mask data from region and mask.
AxesSpecifier itsAxesSpec
Lattice< Bool > * itsOwnPixelMask
virtual void reopen()
If needed, reopen a temporarily closed Lattice.
virtual IPosition doNiceCursorShape(uInt maxPixels) const
Get the best cursor shape.
SubLattice(const MaskedLattice< T > &lattice, const Slicer &slicer, AxesSpecifier=AxesSpecifier())
virtual void resync()
Resynchronize the Lattice object with the lattice file.
SubLattice(const SubLattice< T > &other)
Copy constructor (reference semantics).
virtual const LatticeRegion * getRegionPtr() const
Get a pointer the region/mask object describing this sublattice.
Lattice< T > * itsLatticePtr
SubLattice(MaskedLattice< T > &lattice, Bool writableIfPossible, AxesSpecifier=AxesSpecifier())
SubLattice(const Lattice< T > &lattice, const LatticeRegion ®ion, AxesSpecifier=AxesSpecifier())
Create a SubLattice from the given MaskedLattice and region.
this file contains all the compiler specific defines
bool Bool
Define the standard types used by Casacore.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.