29 #ifndef LATTICES_SUBLATTICE_H
30 #define LATTICES_SUBLATTICE_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());
131 SubLattice (Lattice<T>& lattice,
const LatticeRegion& region,
132 Bool writableIfPossible, AxesSpecifier=AxesSpecifier());
133 SubLattice (
const MaskedLattice<T>& lattice,
const LatticeRegion& region,
134 AxesSpecifier=AxesSpecifier());
135 SubLattice (MaskedLattice<T>& lattice,
const LatticeRegion& region,
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
A Vector of integers, for indexing into Array<T> objects.
virtual Bool ok() const
Check class internals - used for debugging.
SubLattice< T > & operator=(const SubLattice< T > &other)
Assignment (reference semantics).
virtual Bool doGetSlice(Array< T > &buffer, const Slicer §ion)
Do the actual getting of an array of values.
A subset of a Lattice or MaskedLattice.
virtual String name(Bool stripPath=False) const
Return the name of the parent lattice.
virtual T getAt(const IPosition &where) const
Get or put a single element in the lattice.
virtual Bool doGetMaskSlice(Array< Bool > &buffer, const Slicer §ion)
Get a section of the mask.
virtual void putAt(const T &value, const IPosition &where)
Put the value of a single element.
virtual IPosition shape() const
Returns the shape of the SubLattice including all degenerate axes (i.e.
virtual Bool isPaged() const
Is the SubLattice paged to disk?
MaskedLattice< T > * itsMaskLatPtr
A templated, abstract base class for array-like objects with masks.
IPosition posToOld(const IPosition &pos) const
Map a new position or shape to the old one.
void andMask(Array< Bool > &buffer, Bool ref, const Array< Bool > &tmpbuf) const
And tmpbuf into buffer.
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...
Specification of axes to keep or remove.
Info about mapping array axes to another order.
AxesSpecifier itsAxesSpec
virtual Bool hasLock(FileLocker::LockType) const
void setPixelMask(const Lattice< Bool > &pixelMask, Bool mayExist)
Use the given mask as the pixelmask.
virtual Bool canReferenceArray() const
Can the lattice data be referenced as an array section?
virtual void resync()
Resynchronize the Lattice object with the lattice file.
virtual IPosition doNiceCursorShape(uInt maxPixels) const
Get the best cursor shape.
A templated, abstract base class for array-like objects.
SubLattice()
The default constructor creates a SubLattice that is useless for just about everything, except that it can be assigned to with the assignment operator.
virtual void reopen()
If needed, reopen a temporarily closed Lattice.
virtual Bool isWritable() const
Is the SubLattice writable?
IPosition positionInParent(const IPosition &subLatticePosition) const
Convert the specified position in the sublattice to the corresponding position in the parent lattice...
void setPtr(Lattice< T > *latticePtr, MaskedLattice< T > *maskLatPtr, Bool writableIfPossible)
Set the various pointers needed to construct the object.
bool Bool
Define the standard types used by Casacore.
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).
Slicer convert(const Slicer &slicer) const
Convert positions to positions in the parent object.
virtual uInt advisedMaxPixels() const
This function returns the recommended maximum number of pixels to include in the cursor of an iterato...
Specify which elements to extract from an n-dimensional array.
virtual void flush()
Flush the data.
Bool getRegionDataSlice(Array< Bool > &buffer, const Slicer §ion)
Get mask data from region and mask.
virtual const Lattice< Bool > & pixelMask() const
Get access to the pixelmask.
const LatticeRegion & region() const
Get the region used.
Lattice< Bool > * itsOwnPixelMask
Lattice< Bool > * itsPixelMask
An optionally strided region in a Lattice.
Lattice< T > * itsLatticePtr
virtual Bool hasPixelMask() const
Does the SubLattice have a pixelmask?
virtual Bool isMasked() const
Is the lattice masked? It is if its parent lattice or its region is masked.
LockType
Define the possible lock types.
virtual Bool isPersistent() const
A SubLattice is persistent if no region is applied to the parent lattice.
virtual Bool lock(FileLocker::LockType, uInt nattempts)
Handle locking of the SubLattice which is delegated to its parent.
const AxesMapping & getAxesMap() const
Set the axes mapping from the specification.
Bool getMaskDataSlice(Array< Bool > &buffer, const Slicer §ion)
bool isRemoved() const
Are axes removed?
virtual void doPutSlice(const Array< T > &sourceBuffer, const IPosition &where, const IPosition &stride)
Do the actual getting of an array of values.
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
virtual const LatticeRegion * getRegionPtr() const
Get a pointer the region/mask object describing this sublattice.
void setAxesMap(const AxesSpecifier &)
Set the axes mapping from the specification.