casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
casa::MIRIADImage Class Reference

Class providing native access to MIRIAD images. More...

#include <MIRIADImage.h>

Inheritance diagram for casa::MIRIADImage:
casa::ImageInterface< Float > casa::MaskedLattice< Float > casa::Lattice< Float > casa::LatticeBase

List of all members.

Public Member Functions

 MIRIADImage (const String &name)
 Construct a MIRIADImage from the disk MIRIAD dataset name and apply mask.
 MIRIADImage (const String &name, const MaskSpecifier &)
 Construct a MIRIADImage from the disk MIRIAD file name and apply mask or not.
 MIRIADImage (const MIRIADImage &other)
 Copy constructor (reference semantics)
 ~MIRIADImage ()
 Destructor does nothing.
MIRIADImageoperator= (const MIRIADImage &other)
 Assignment (reference semantics)
virtual ImageInterface< Float > * cloneII () const
 Make a copy of the object with new (reference semantics).
virtual String imageType () const
 Get the image type (returns MIRIADImage).
virtual void resize (const TiledShape &newShape)
 Function which changes the shape of the MIRIADImage.
virtual const RecordInterfacemiscInfo () const
 Functions which get and set the units associated with the image pixels (i.e.
virtual Bool setMiscInfo (const RecordInterface &newInfo)
virtual Bool isMasked () const
 Has the object really a mask? The MIRIADImage always has a pixel mask and never has a region mask so this should always return True.
virtual Bool hasPixelMask () const
 MIRIADimage always has a pixel mask so should return True.
virtual const Lattice< Bool > & pixelMask () const
 Get access to the pixelmask.
virtual Lattice< Bool > & pixelMask ()
virtual Bool doGetMaskSlice (Array< Bool > &buffer, const Slicer &section)
 Do the actual get of the mask data.
virtual const LatticeRegiongetRegionPtr () const
 Get the region used.
virtual Bool doGetSlice (Array< Float > &buffer, const Slicer &theSlice)
 Do the actual get of the data.
virtual void doPutSlice (const Array< Float > &sourceBuffer, const IPosition &where, const IPosition &stride)
 The MIRIADImage is not writable, so this throws an exception.
virtual Bool isPaged () const
 The lattice is paged to disk.
virtual Bool isPersistent () const
 The lattice is persistent.
virtual Bool isWritable () const
 The MIRIADImage is not writable.
virtual String name (Bool stripPath=False) const
 Returns the name of the disk file.
virtual IPosition shape () const
 return the shape of the MIRIADImage
virtual uInt advisedMaxPixels () const
 Returns the maximum recommended number of pixels for a cursor.
virtual IPosition doNiceCursorShape (uInt maxPixels) const
 Help the user pick a cursor for most efficient access if they only want pixel values and don't care about the order or dimension of the cursor.
virtual void tempClose ()
 Temporarily close the image.
virtual void reopen ()
 Reopen a temporarily closed image.
virtual Bool ok () const
 Check class invariants.
DataType dataType () const
 Return the (internal) data type (TpFloat or TpShort).
virtual uInt maximumCacheSize () const
 Maximum size - not necessarily all used.
virtual void setMaximumCacheSize (uInt howManyPixels)
 Set the maximum (allowed) cache size as indicated.
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.
virtual void setCacheSizeInTiles (uInt howManyTiles)
 Set the actual cache size for this Array to be be big enough for the indicated number of tiles.
virtual void clearCache ()
 Clears and frees up the caches, but the maximum allowed cache size is unchanged from when setCacheSize was called.
virtual void showCacheStatistics (ostream &os) const
 Report on cache success.

Static Public Member Functions

static LatticeBaseopenMIRIADImage (const String &name, const MaskSpecifier &)
 Function to open a MIRIAD image.
static void registerOpenFunction ()
 Register the open function.

Private Member Functions

void reopenIfNeeded () const
 Reopen the image if needed.
void setup ()
 Setup the object (used by constructors).
void open ()
 Open the image (used by setup and reopen).
void getImageAttributes (CoordinateSystem &cSys, IPosition &shape, ImageInfo &info, Unit &brightnessUnit, Record &miscInfo, Bool &hasBlanks, const String &name)
 Fish things out of the MIRIAD file.
void crackHeader (CoordinateSystem &cSys, IPosition &shape, ImageInfo &imageInfo, Unit &brightnessUnit, Record &miscInfo, LogIO &os)

Private Attributes

String name_p
Int tno_p
MaskSpecifier maskSpec_p
Unit unit_p
Record rec_p
CountedPtr< TiledFileAccesspTiledFile_p
Lattice< Bool > * pPixelMask_p
TiledShape shape_p
 Float scale_p; Float offset_p; Short magic_p;.
Bool hasBlanks_p
DataType dataType_p
Int64 fileOffset_p
Bool isClosed_p

Detailed Description

Class providing native access to MIRIAD images.

Intended use:

Public interface

Review Status

Test programs:
tMIRIADImage

Prerequisite

Etymology

This class provides native access to MIRIAD images.

Synopsis

A MIRIADImage provides native access to MIRIAD images by accessing them with the TiledFileAccess class. -- or -- the native miriad I/O routines. The MIRIADImage is read only. -- really -- ??

Example

       MIRIADImage im("cube1"); 
       LogIO logger(or);
       ImageStatistics<Float> stats(im, logger);
       Bool ok = stats.display();                              // Display statistics

Motivation

This provides native access to MIRIAD images.

Definition at line 98 of file MIRIADImage.h.


Constructor & Destructor Documentation

casa::MIRIADImage::MIRIADImage ( const String name) [explicit]

Construct a MIRIADImage from the disk MIRIAD dataset name and apply mask.

casa::MIRIADImage::MIRIADImage ( const String name,
const MaskSpecifier  
)

Construct a MIRIADImage from the disk MIRIAD file name and apply mask or not.

Copy constructor (reference semantics)

Destructor does nothing.


Member Function Documentation

virtual uInt casa::MIRIADImage::advisedMaxPixels ( ) const [virtual]

Returns the maximum recommended number of pixels for a cursor.

This is the number of pixels in a tile.

Reimplemented from casa::Lattice< Float >.

virtual void casa::MIRIADImage::clearCache ( ) [virtual]

Clears and frees up the caches, but the maximum allowed cache size is unchanged from when setCacheSize was called.

Reimplemented from casa::LatticeBase.

virtual ImageInterface<Float>* casa::MIRIADImage::cloneII ( ) const [virtual]

Make a copy of the object with new (reference semantics).

Implements casa::ImageInterface< Float >.

void casa::MIRIADImage::crackHeader ( CoordinateSystem cSys,
IPosition shape,
ImageInfo imageInfo,
Unit brightnessUnit,
Record miscInfo,
LogIO os 
) [private]
DataType casa::MIRIADImage::dataType ( ) const [inline, virtual]

Return the (internal) data type (TpFloat or TpShort).

Reimplemented from casa::Lattice< Float >.

Definition at line 227 of file MIRIADImage.h.

References dataType_p.

virtual Bool casa::MIRIADImage::doGetMaskSlice ( Array< Bool > &  buffer,
const Slicer section 
) [virtual]

Do the actual get of the mask data.

The return value is always False, thus the buffer does not reference another array.

Reimplemented from casa::MaskedLattice< Float >.

virtual Bool casa::MIRIADImage::doGetSlice ( Array< Float > &  buffer,
const Slicer theSlice 
) [virtual]

Do the actual get of the data.

Returns False as the data do not reference another Array

Implements casa::Lattice< Float >.

virtual IPosition casa::MIRIADImage::doNiceCursorShape ( uInt  maxPixels) const [virtual]

Help the user pick a cursor for most efficient access if they only want pixel values and don't care about the order or dimension of the cursor.

Reimplemented from casa::LatticeBase.

virtual void casa::MIRIADImage::doPutSlice ( const Array< Float > &  sourceBuffer,
const IPosition where,
const IPosition stride 
) [virtual]

The MIRIADImage is not writable, so this throws an exception.

Implements casa::Lattice< Float >.

void casa::MIRIADImage::getImageAttributes ( CoordinateSystem cSys,
IPosition shape,
ImageInfo info,
Unit brightnessUnit,
Record miscInfo,
Bool hasBlanks,
const String name 
) [private]

Fish things out of the MIRIAD file.

virtual const LatticeRegion* casa::MIRIADImage::getRegionPtr ( ) const [virtual]

Get the region used.

There is no region. Always returns 0.

Implements casa::MaskedLattice< Float >.

virtual Bool casa::MIRIADImage::hasPixelMask ( ) const [virtual]

MIRIADimage always has a pixel mask so should return True.

Reimplemented from casa::MaskedLattice< Float >.

virtual String casa::MIRIADImage::imageType ( ) const [virtual]

Get the image type (returns MIRIADImage).

Implements casa::ImageInterface< Float >.

virtual Bool casa::MIRIADImage::isMasked ( ) const [virtual]

Has the object really a mask? The MIRIADImage always has a pixel mask and never has a region mask so this should always return True.

Reimplemented from casa::MaskedLattice< Float >.

virtual Bool casa::MIRIADImage::isPaged ( ) const [virtual]

The lattice is paged to disk.

Reimplemented from casa::LatticeBase.

virtual Bool casa::MIRIADImage::isPersistent ( ) const [virtual]

The lattice is persistent.

Reimplemented from casa::LatticeBase.

virtual Bool casa::MIRIADImage::isWritable ( ) const [virtual]

The MIRIADImage is not writable.

Reimplemented from casa::LatticeBase.

virtual uInt casa::MIRIADImage::maximumCacheSize ( ) const [virtual]

Maximum size - not necessarily all used.

In pixels.

Reimplemented from casa::LatticeBase.

virtual const RecordInterface& casa::MIRIADImage::miscInfo ( ) const [virtual]

Functions which get and set the units associated with the image pixels (i.e.

the "brightness" unit). Initially the unit is empty. Although the MIRIADimage is not writable, you can change the unit in the MIRIADImage object, but it will not be changed in the MIRIAD disk file.

Often we have miscellaneous information we want to attach to an image. Although MIRIADImage is not writable, you can set a new MiscInfo record, but it will not be stored with the MIRIAD file

Reimplemented from casa::ImageInterface< Float >.

virtual String casa::MIRIADImage::name ( Bool  stripPath = False) const [virtual]

Returns the name of the disk file.

Implements casa::ImageInterface< Float >.

virtual Bool casa::MIRIADImage::ok ( ) const [virtual]

Check class invariants.

Implements casa::ImageInterface< Float >.

void casa::MIRIADImage::open ( ) [private]

Open the image (used by setup and reopen).

static LatticeBase* casa::MIRIADImage::openMIRIADImage ( const String name,
const MaskSpecifier  
) [static]

Function to open a MIRIAD image.

MIRIADImage& casa::MIRIADImage::operator= ( const MIRIADImage other)

Assignment (reference semantics)

virtual const Lattice<Bool>& casa::MIRIADImage::pixelMask ( ) const [virtual]

Get access to the pixelmask.

MIRIADImage always has a pixel mask.

Reimplemented from casa::MaskedLattice< Float >.

virtual Lattice<Bool>& casa::MIRIADImage::pixelMask ( ) [virtual]

Reimplemented from casa::MaskedLattice< Float >.

static void casa::MIRIADImage::registerOpenFunction ( ) [static]

Register the open function.

virtual void casa::MIRIADImage::reopen ( ) [virtual]

Reopen a temporarily closed image.

Reimplemented from casa::LatticeBase.

Referenced by reopenIfNeeded().

void casa::MIRIADImage::reopenIfNeeded ( ) const [inline, private]

Reopen the image if needed.

Definition at line 274 of file MIRIADImage.h.

References isClosed_p, and reopen().

virtual void casa::MIRIADImage::resize ( const TiledShape newShape) [virtual]

Function which changes the shape of the MIRIADImage.

Throws an exception as MIRIADImage is not writable.

Implements casa::ImageInterface< Float >.

virtual void casa::MIRIADImage::setCacheSizeFromPath ( const IPosition sliceShape,
const IPosition windowStart,
const IPosition windowLength,
const IPosition axisPath 
) [virtual]

Set the cache size as to "fit" the indicated path.

Reimplemented from casa::LatticeBase.

virtual void casa::MIRIADImage::setCacheSizeInTiles ( uInt  howManyTiles) [virtual]

Set the actual cache size for this Array to be be big enough for the indicated number of tiles.

This cache is not shared with PagedArrays in other rows and is always clipped to be less than the maximum value set using the setMaximumCacheSize member function. tiles. Tiles are cached using a first in first out algorithm.

Reimplemented from casa::LatticeBase.

virtual void casa::MIRIADImage::setMaximumCacheSize ( uInt  howManyPixels) [virtual]

Set the maximum (allowed) cache size as indicated.

Reimplemented from casa::LatticeBase.

virtual Bool casa::MIRIADImage::setMiscInfo ( const RecordInterface newInfo) [virtual]

Reimplemented from casa::ImageInterface< Float >.

void casa::MIRIADImage::setup ( ) [private]

Setup the object (used by constructors).

virtual IPosition casa::MIRIADImage::shape ( ) const [virtual]

return the shape of the MIRIADImage

Implements casa::LatticeBase.

virtual void casa::MIRIADImage::showCacheStatistics ( ostream &  os) const [virtual]

Report on cache success.

Reimplemented from casa::LatticeBase.

virtual void casa::MIRIADImage::tempClose ( ) [virtual]

Temporarily close the image.

Reimplemented from casa::LatticeBase.


Member Data Documentation

DataType casa::MIRIADImage::dataType_p [private]

Definition at line 269 of file MIRIADImage.h.

Referenced by dataType().

Definition at line 270 of file MIRIADImage.h.

Definition at line 268 of file MIRIADImage.h.

Definition at line 271 of file MIRIADImage.h.

Referenced by reopenIfNeeded().

Definition at line 259 of file MIRIADImage.h.

Definition at line 257 of file MIRIADImage.h.

Definition at line 263 of file MIRIADImage.h.

Definition at line 262 of file MIRIADImage.h.

Definition at line 261 of file MIRIADImage.h.

Float scale_p; Float offset_p; Short magic_p;.

Definition at line 267 of file MIRIADImage.h.

Definition at line 258 of file MIRIADImage.h.

Reimplemented from casa::ImageInterface< Float >.

Definition at line 260 of file MIRIADImage.h.


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