casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | List of all members
casacore::LatticeBase Class Referenceabstract

A non-templated, abstract base class for array-like objects. More...

#include <LatticeBase.h>

Inheritance diagram for casacore::LatticeBase:
casacore::Lattice< T > casacore::Lattice< Bool > casacore::Lattice< casacore::Complex > casacore::Lattice< casacore::Float > casacore::Lattice< casacore::Int > casacore::ArrayLattice< T > casacore::HDF5Lattice< T > casacore::MaskedLattice< T > casacore::PagedArray< T > casacore::TempLattice< T > casacore::TempLattice< casacore::DComplex > casacore::TempLattice< Complex > casacore::TempLattice< Float > casacore::TempLattice< typename casacore::NumericTraits< casacore::Float >::ConjugateType > casacore::TempLattice< typename casacore::NumericTraits< T >::ConjugateType > casacore::ArrayLattice< Bool > casacore::FITSMask casacore::FITSQualityMask casacore::LatticeRegion casacore::LCRegion casacore::HDF5Lattice< Bool > casacore::PagedArray< Bool > casacore::TempLattice< casacore::Complex > casacore::MaskedLattice< casacore::Float > casacore::PagedArray< casacore::Float > casacore::TempLattice< casacore::Float >

Public Member Functions

virtual ~LatticeBase ()
 A virtual destructor is needed so that it will use the actual destructor in the derived class. More...
 
virtual LatticeBaseclone () const =0
 Make a copy of the derived object (reference semantics). More...
 
virtual String imageType () const
 Get the image type (returns name of derived class). More...
 
virtual DataType dataType () const =0
 Get the data type of the lattice. More...
 
virtual Bool isPersistent () const
 Is the lattice persistent and can it be loaded by other processes as well? That is the case for a PagedArray or PagedImage and for an ImageExpr which does not use transient lattices or regions. More...
 
virtual Bool isPaged () const
 Is the lattice paged to disk?
The default implementation returns False. More...
 
virtual Bool canReferenceArray () const
 Can the lattice data be referenced as an array section? That is the case for an ArrayLattice or a Temp/SubLattice using it. More...
 
virtual Bool isWritable () const
 Is the lattice writable?
The default implementation returns True. More...
 
virtual void save (const String &fileName) const
 Save the image in an AipsIO file with the given name. More...
 
virtual Bool lock (FileLocker::LockType, uInt nattempts)
 It is strongly recommended to use class LatticeLocker to handle lattice locking. More...
 
virtual void unlock ()
 
virtual Bool hasLock (FileLocker::LockType) const
 
virtual void resync ()
 Resynchronize the Lattice object with the lattice file. More...
 
virtual void flush ()
 Flush the data (but do not unlock). More...
 
virtual void tempClose ()
 Temporarily close the lattice. More...
 
virtual void reopen ()
 Explicitly reopen the temporarily closed lattice. More...
 
virtual String name (Bool stripPath=False) const
 Return the name of the current Lattice object. More...
 
virtual IPosition shape () const =0
 Return the shape of the Lattice including all degenerate axes (ie. More...
 
virtual uInt ndim () const
 Return the number of axes in this Lattice. More...
 
virtual size_t nelements () const
 Return the total number of elements in this Lattice. More...
 
size_t size () const
 
Bool conform (const LatticeBase &other) const
 Return a value of "True" if this instance of Lattice and 'other' have the same shape, otherwise returns a value of "False". More...
 
virtual LELCoordinates lelCoordinates () const
 Return the coordinates of the lattice. More...
 
virtual uInt advisedMaxPixels () const =0
 This function returns the recommended maximum number of pixels to include in the cursor of an iterator. More...
 
IPosition niceCursorShape (uInt maxPixels) const
 Returns a recommended cursor shape for iterating through all the pixels in the Lattice. More...
 
IPosition niceCursorShape () const
 
virtual Bool ok () const
 Check class internals - used for debugging. More...
 
virtual IPosition doNiceCursorShape (uInt maxPixels) const
 The function (in the derived classes) doing the actual work. More...
 
virtual uInt maximumCacheSize () const
 Maximum cache size - not necessarily all used. More...
 
virtual void setMaximumCacheSize (uInt howManyPixels)
 Set the maximum (allowed) cache size as indicated. More...
 
virtual void setCacheSizeInTiles (uInt howManyTiles)
 Set the actual cache size for this Array to be big enough for the indicated number of tiles. More...
 
virtual void setCacheSizeFromPath (const IPosition &sliceShape, const IPosition &windowStart, const IPosition &windowLength, const IPosition &axisPath)
 Set the cache size as to "fit" the indicated path. More...
 
virtual void clearCache ()
 Clears and frees up the caches, but the maximum allowed cache size is unchanged from when setCacheSize was called. More...
 
virtual void showCacheStatistics (ostream &os) const
 Report on cache success. More...
 

Protected Member Functions

 LatticeBase ()
 Define default constructor to be used by derived classes. More...
 
 LatticeBase (const LatticeBase &)
 Copy constructor and assignment can only be used by derived classes. More...
 
LatticeBaseoperator= (const LatticeBase &)
 
void throwBoolMath () const
 Throw an exception for arithmetic on a Bool Lattice. More...
 

Detailed Description

A non-templated, abstract base class for array-like objects.

Intended use:

Public interface

Review Status

Reviewed By:
Bob Garwood
Date Reviewed:
2000/01/18
Test programs:
tArrayLattice
Demo programs:
dLattice

Synopsis

This pure abstract base class defines the operations which may be performed on a lattice of any type.
See class Lattice for a detailed description of a lattice.

Motivation

It is very useful to be able to keep a pointer to a non-templated base class. Furthermore it gives the opportunity to factor out some non-templated code.


Note: The cache functions (maximumCacheSize, setMaximumCacheSize, setCacheSizeInTiles, setCacheSizeFromPath, clearCache, and showCacheStatistics) should all be over-ridden together as in PagedArray;

Definition at line 80 of file LatticeBase.h.

Constructor & Destructor Documentation

virtual casacore::LatticeBase::~LatticeBase ( )
virtual

A virtual destructor is needed so that it will use the actual destructor in the derived class.

casacore::LatticeBase::LatticeBase ( )
inlineprotected

Define default constructor to be used by derived classes.

Definition at line 259 of file LatticeBase.h.

casacore::LatticeBase::LatticeBase ( const LatticeBase )
inlineprotected

Copy constructor and assignment can only be used by derived classes.

Definition at line 263 of file LatticeBase.h.

Member Function Documentation

virtual uInt casacore::LatticeBase::advisedMaxPixels ( ) const
pure virtual

This function returns the recommended maximum number of pixels to include in the cursor of an iterator.

The Lattice class has a default implementation which returns a number that is a power of two and includes enough pixels to consume between 4 and 8 MBytes of memory.

Implemented in casacore::PagedArray< T >, casacore::PagedArray< casacore::Float >, casacore::PagedArray< Bool >, casacore::Lattice< T >, casacore::Lattice< casacore::Float >, casacore::Lattice< Bool >, casacore::Lattice< casacore::Int >, casacore::Lattice< casacore::Complex >, casacore::PagedImage< T >, casacore::PagedImage< casacore::Float >, casacore::HDF5Image< T >, casacore::HDF5Lattice< T >, casacore::HDF5Lattice< Bool >, casacore::TempImage< T >, casacore::TempImage< casacore::DComplex >, casacore::TempImage< casacore::Float >, casacore::TempImage< casacore::Complex >, casacore::SubLattice< T >, casacore::SubLattice< casacore::Float >, casacore::TempLattice< T >, casacore::TempLattice< Float >, casacore::TempLattice< typename casacore::NumericTraits< T >::ConjugateType >, casacore::TempLattice< casacore::DComplex >, casacore::TempLattice< casacore::Float >, casacore::TempLattice< typename casacore::NumericTraits< casacore::Float >::ConjugateType >, casacore::TempLattice< Complex >, casacore::TempLattice< casacore::Complex >, casacore::ArrayLattice< T >, casacore::ArrayLattice< Bool >, casacore::MIRIADImage, casacore::FITSImage, casacore::SubImage< T >, casacore::CurvedImage2D< T >, casacore::FITSQualityImage, casacore::ExtendLattice< T >, casacore::CurvedLattice2D< T >, casacore::LatticeRegion, casacore::RebinLattice< T >, casacore::RebinImage< T >, casacore::ExtendImage< T >, casacore::LCMask, casacore::LCPagedMask, and casacore::LCHDF5Mask.

Referenced by niceCursorShape().

virtual Bool casacore::LatticeBase::canReferenceArray ( ) const
virtual
virtual void casacore::LatticeBase::clearCache ( )
virtual
virtual LatticeBase* casacore::LatticeBase::clone ( ) const
pure virtual
Bool casacore::LatticeBase::conform ( const LatticeBase other) const
inline

Return a value of "True" if this instance of Lattice and 'other' have the same shape, otherwise returns a value of "False".

Definition at line 183 of file LatticeBase.h.

References casacore::IPosition::isEqual(), and shape().

virtual DataType casacore::LatticeBase::dataType ( ) const
pure virtual
virtual IPosition casacore::LatticeBase::doNiceCursorShape ( uInt  maxPixels) const
virtual

The function (in the derived classes) doing the actual work.

This function is public, so it can be used internally in the various Lattice classes.
The default implementation tries to fit as many axes as possible given maxPixels.

Reimplemented in casacore::PagedArray< T >, casacore::PagedArray< casacore::Float >, casacore::PagedArray< Bool >, casacore::PagedImage< T >, casacore::PagedImage< casacore::Float >, casacore::HDF5Image< T >, casacore::SubLattice< T >, casacore::SubLattice< casacore::Float >, casacore::HDF5Lattice< T >, casacore::HDF5Lattice< Bool >, casacore::TempImage< T >, casacore::TempImage< casacore::DComplex >, casacore::TempImage< casacore::Float >, casacore::TempImage< casacore::Complex >, casacore::ImageConcat< T >, casacore::SubImage< T >, casacore::LatticeConcat< T >, casacore::LatticeConcat< casacore::Float >, casacore::CurvedImage2D< T >, casacore::TempLattice< T >, casacore::TempLattice< Float >, casacore::TempLattice< typename casacore::NumericTraits< T >::ConjugateType >, casacore::TempLattice< casacore::DComplex >, casacore::TempLattice< casacore::Float >, casacore::TempLattice< typename casacore::NumericTraits< casacore::Float >::ConjugateType >, casacore::TempLattice< Complex >, casacore::TempLattice< casacore::Complex >, casacore::MIRIADImage, casacore::FITSImage, casacore::ImageExpr< T >, casacore::ImageExpr< Bool >, casacore::LatticeExpr< T >, casacore::LatticeExpr< Bool >, casacore::ExtendLattice< T >, casacore::FITSQualityImage, casacore::CurvedLattice2D< T >, casacore::RebinImage< T >, casacore::ExtendImage< T >, casacore::LatticeRegion, casacore::LCConcatenation, casacore::LCRegionMulti, casacore::LCExtension, casacore::LCStretch, casacore::LCRegionSingle, casacore::LCMask, casacore::LCPagedMask, and casacore::LCHDF5Mask.

Referenced by niceCursorShape().

virtual void casacore::LatticeBase::flush ( )
virtual
virtual Bool casacore::LatticeBase::hasLock ( FileLocker::LockType  ) const
virtual
virtual String casacore::LatticeBase::imageType ( ) const
virtual
virtual Bool casacore::LatticeBase::isPaged ( ) const
virtual
virtual Bool casacore::LatticeBase::isPersistent ( ) const
virtual
virtual Bool casacore::LatticeBase::isWritable ( ) const
virtual

Is the lattice writable?
The default implementation returns True.

Reimplemented in casacore::PagedArray< T >, casacore::PagedArray< casacore::Float >, casacore::PagedArray< Bool >, casacore::ImageConcat< T >, casa::ComponentListImage, casacore::LatticeConcat< T >, casacore::LatticeConcat< casacore::Float >, casacore::PagedImage< T >, casacore::PagedImage< casacore::Float >, casacore::MIRIADImage, casacore::ImageExpr< T >, casacore::FITSImage, casacore::ImageExpr< Bool >, casacore::LCMask, casacore::ArrayLattice< T >, casacore::ArrayLattice< Bool >, casacore::SubLattice< T >, casacore::HDF5Image< T >, casacore::LCPagedMask, casacore::SubLattice< casacore::Float >, casacore::LCRegion, casacore::CurvedImage2D< T >, casacore::TempLattice< T >, casacore::HDF5Lattice< T >, casacore::TempLattice< Float >, casacore::TempLattice< typename casacore::NumericTraits< T >::ConjugateType >, casacore::TempLattice< casacore::DComplex >, casacore::TempLattice< casacore::Float >, casacore::TempLattice< typename casacore::NumericTraits< casacore::Float >::ConjugateType >, casacore::TempLattice< Complex >, casacore::TempLattice< casacore::Complex >, casacore::HDF5Lattice< Bool >, casacore::LatticeExpr< T >, casacore::LatticeExpr< Bool >, casacore::FITSQualityImage, casacore::SubImage< T >, casacore::FITSMask, casacore::TempImage< T >, casacore::TempImage< casacore::DComplex >, casacore::TempImage< casacore::Float >, casacore::TempImage< casacore::Complex >, casacore::RebinImage< T >, casacore::ExtendImage< T >, casacore::CurvedLattice2D< T >, casacore::ExtendLattice< T >, casacore::LCHDF5Mask, casacore::FITSQualityMask, casacore::RebinLattice< T >, and casacore::LatticeRegion.

virtual LELCoordinates casacore::LatticeBase::lelCoordinates ( ) const
virtual
virtual Bool casacore::LatticeBase::lock ( FileLocker::LockType  ,
uInt  nattempts 
)
virtual
virtual uInt casacore::LatticeBase::maximumCacheSize ( ) const
virtual
virtual String casacore::LatticeBase::name ( Bool  stripPath = False) const
virtual
virtual uInt casacore::LatticeBase::ndim ( ) const
virtual

Return the number of axes in this Lattice.

This includes all degenerate axes.
The default implementation returns shape().nelements().

Reimplemented in casacore::SubImage< T >, casacore::LCRegion, and casacore::LatticeRegion.

virtual size_t casacore::LatticeBase::nelements ( ) const
virtual

Return the total number of elements in this Lattice.


The default implementation returns shape().product().

Reimplemented in casacore::SubImage< T >, and casacore::LatticeRegion.

Referenced by size().

IPosition casacore::LatticeBase::niceCursorShape ( uInt  maxPixels) const
inline

Returns a recommended cursor shape for iterating through all the pixels in the Lattice.

The default implementation sets up a shape that completely fills as many axes as possible, but always at least the first axis. For example, given a 10x20x30 Lattice

maxPixels = 1 --> niceCursorShape = [10,1,1]
100 --> niceCursorShape = [10,1,1]
300 --> niceCursorShape = [10,20,1]
10000 --> niceCursorShape = [10,20,30]

The default argument is the result of advisedMaxPixels().

Definition at line 208 of file LatticeBase.h.

References doNiceCursorShape().

IPosition casacore::LatticeBase::niceCursorShape ( ) const
inline

Definition at line 210 of file LatticeBase.h.

References advisedMaxPixels(), and doNiceCursorShape().

virtual Bool casacore::LatticeBase::ok ( ) const
virtual

Check class internals - used for debugging.

Should always return True

Reimplemented in casacore::PagedArray< T >, casacore::PagedArray< casacore::Float >, casacore::PagedArray< Bool >, casacore::ImageInterface< T >, casacore::ImageInterface< Float >, casacore::ImageInterface< Double >, casacore::ImageInterface< float >, casacore::ImageInterface< casacore::Float >, casacore::ImageInterface< DComplex >, casacore::ImageInterface< Complex >, casacore::ImageInterface< casacore::Complex >, casacore::PagedImage< T >, casacore::PagedImage< casacore::Float >, casacore::TempImage< T >, casacore::TempImage< casacore::DComplex >, casacore::TempImage< casacore::Float >, casacore::TempImage< casacore::Complex >, casacore::ImageConcat< T >, casacore::TempLattice< T >, casacore::TempLattice< Float >, casacore::TempLattice< typename casacore::NumericTraits< T >::ConjugateType >, casacore::TempLattice< casacore::DComplex >, casacore::TempLattice< casacore::Float >, casacore::TempLattice< typename casacore::NumericTraits< casacore::Float >::ConjugateType >, casacore::TempLattice< Complex >, casacore::TempLattice< casacore::Complex >, casacore::SubLattice< T >, casacore::SubLattice< casacore::Float >, casacore::HDF5Lattice< T >, casacore::HDF5Lattice< Bool >, casacore::MIRIADImage, casacore::FITSImage, casa::ComponentListImage, casacore::SubImage< T >, casacore::ArrayLattice< T >, casacore::ArrayLattice< Bool >, casacore::CurvedImage2D< T >, casacore::FITSQualityImage, casacore::ImageExpr< T >, casacore::ImageExpr< Bool >, casacore::ExtendLattice< T >, casacore::CurvedLattice2D< T >, casacore::LatticeRegion, casacore::HDF5Image< T >, casacore::RebinLattice< T >, casacore::RebinImage< T >, and casacore::ExtendImage< T >.

LatticeBase& casacore::LatticeBase::operator= ( const LatticeBase )
inlineprotected

Definition at line 264 of file LatticeBase.h.

virtual void casacore::LatticeBase::reopen ( )
virtual
virtual void casacore::LatticeBase::resync ( )
virtual
virtual void casacore::LatticeBase::save ( const String fileName) const
virtual

Save the image in an AipsIO file with the given name.

Its purpose is to make ImageConcat and ImageExpr objects persistent.
The default implementation throws an exception.

Reimplemented in casacore::ImageConcat< T >, casacore::ImageExpr< T >, and casacore::ImageExpr< Bool >.

virtual void casacore::LatticeBase::setCacheSizeFromPath ( const IPosition sliceShape,
const IPosition windowStart,
const IPosition windowLength,
const IPosition axisPath 
)
virtual
virtual void casacore::LatticeBase::setCacheSizeInTiles ( uInt  howManyTiles)
virtual
virtual void casacore::LatticeBase::setMaximumCacheSize ( uInt  howManyPixels)
virtual
virtual IPosition casacore::LatticeBase::shape ( ) const
pure virtual

Return the shape of the Lattice including all degenerate axes (ie.

axes with a length of one)

Implemented in casacore::PagedArray< T >, casacore::PagedArray< casacore::Float >, casacore::PagedArray< Bool >, casa::ComponentListImage, casacore::PagedImage< T >, casacore::PagedImage< casacore::Float >, casacore::ImageConcat< T >, casacore::SubLattice< T >, casacore::SubLattice< casacore::Float >, casacore::LatticeConcat< T >, casacore::LatticeConcat< casacore::Float >, casacore::TempImage< T >, casacore::TempImage< casacore::DComplex >, casacore::TempImage< casacore::Float >, casacore::TempImage< casacore::Complex >, casacore::MIRIADImage, casacore::FITSImage, casacore::LatticeExpr< T >, casacore::LatticeExpr< Bool >, casacore::TempLattice< T >, casacore::TempLattice< Float >, casacore::TempLattice< typename casacore::NumericTraits< T >::ConjugateType >, casacore::TempLattice< casacore::DComplex >, casacore::TempLattice< casacore::Float >, casacore::TempLattice< typename casacore::NumericTraits< casacore::Float >::ConjugateType >, casacore::TempLattice< Complex >, casacore::TempLattice< casacore::Complex >, casacore::ArrayLattice< T >, casacore::ArrayLattice< Bool >, casacore::CurvedImage2D< T >, casacore::SubImage< T >, casacore::FITSQualityImage, casacore::HDF5Lattice< T >, casacore::HDF5Lattice< Bool >, casacore::LCRegion, casacore::ExtendLattice< T >, casacore::ImageExpr< T >, casacore::ImageExpr< Bool >, casacore::CurvedLattice2D< T >, casacore::HDF5Image< T >, casacore::LatticeRegion, casacore::RebinLattice< T >, casacore::FITSMask, casacore::RebinImage< T >, casacore::ExtendImage< T >, and casacore::FITSQualityMask.

Referenced by conform(), casa::ScrollingRasterDD::latticesShape(), casa::nPBWProjectFT::verifyAvgPB(), casa::AWProjectFT::verifyAvgPB(), and casa::refim::AWProjectFT::verifyAvgPB().

virtual void casacore::LatticeBase::showCacheStatistics ( ostream &  os) const
virtual
size_t casacore::LatticeBase::size ( ) const
inline

Definition at line 177 of file LatticeBase.h.

References nelements().

virtual void casacore::LatticeBase::tempClose ( )
virtual
void casacore::LatticeBase::throwBoolMath ( ) const
protected

Throw an exception for arithmetic on a Bool Lattice.

virtual void casacore::LatticeBase::unlock ( )
virtual

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