FITSMask.h

Classes

FITSMask -- Provides an on-the-fly mask for FITS images (full description)

class FITSMask : public Lattice<Bool>

Interface

Public Members
FITSMask (TiledFileAccess* tiledFileAccess)
FITSMask (TiledFileAccess* tiledFileAccess, Float scale, Float offset, Short magic, Bool hasBlanks)
FITSMask (TiledFileAccess* tiledFileAccess, Float scale, Float offset, Int magic, Bool hasBlanks)
FITSMask (const FITSMask& other)
virtual ~FITSMask()
FITSMask& operator= (const FITSMask& other)
virtual Lattice<Bool>* clone() const
virtual Bool isWritable() const
IPosition shape() const
virtual Bool doGetSlice (Array<Bool>& buffer, const Slicer& section)
virtual void doPutSlice (const Array<Bool>& sourceBuffer, const IPosition& where, const IPosition& stride)
Private Members
FITSMask()

Description

Prerequisite

Etymology

This class provides a pixel mask for the FITSImage class.

Synopsis

Masked values are indicated in FITS images via magic value blanking. This class provides an on-the-fly mask. The doGetSlice function reads the data values and returns an Array which is True (good) or False (bad - blanked)

Because FITSMask inherits from Lattice it can be used as the private pixel mask data member for FITSImage returned by the MaskedLattice::pixelMask() functions

The FITSMask object is constructed from a TiledFileAccess object. This must be the same one that the FITSImage object constructs internally. It is shared by both FITSImage and FITSMask.

Example


 

Motivation

FITSImage provides native access to FITS image files and needede an efficient way to handle the pixel mask other than iterating all the way through the image first to set a mask.

Member Description

FITSMask (TiledFileAccess* tiledFileAccess)

Constructor (for 32 bit floating point). The pointer is not cloned, just copied.

FITSMask (TiledFileAccess* tiledFileAccess, Float scale, Float offset, Short magic, Bool hasBlanks)

Constructor (for 16 bit integers). The pointer is not cloned, just copied The scale, offset, magic blanking values must come from the FITS header ('bscale', 'bzero', 'blank')

FITSMask (TiledFileAccess* tiledFileAccess, Float scale, Float offset, Int magic, Bool hasBlanks)

Constructor (for 32 bit integers). The pointer is not cloned, just copied The scale, offset, magic blanking values must come from the FITS header ('bscale', 'bzero', 'blank')

FITSMask (const FITSMask& other)

Copy constructor (reference semantics). The TiledFileAccess pointer is just copied.

virtual ~FITSMask()

Destructor

FITSMask& operator= (const FITSMask& other)

The assignment operator with reference semantics. The TiledFileAccess pointer is just copied.

virtual Lattice<Bool>* clone() const

Make a copy of the object (reference semantics).

virtual Bool isWritable() const

Is the FITSMask writable? Returns False. Although it is not hard to implement writing of the mask, data values would be lost because of magic blanking.

IPosition shape() const

Return the shape of the Lattice including all degenerate axes (ie. axes with a length of one)

virtual Bool doGetSlice (Array<Bool>& buffer, const Slicer& section)

Do the actual getting of an array of values.

virtual void doPutSlice (const Array<Bool>& sourceBuffer, const IPosition& where, const IPosition& stride)

Do the actual getting of an array of values. Throws an exception.

FITSMask()