casa::ImageInfo Class Reference
[Images]

#include <ImageInfo.h>

Inheritance diagram for casa::ImageInfo:

Inheritance graph
[legend]
Collaboration diagram for casa::ImageInfo:

Collaboration graph
[legend]
List of all members.

Detailed Description

Miscellaneous information related to an image.

Intended use:

Part of API

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Synopsis

This class is used to record information about an image. At present it contains the following:

  1. The restoring beam
  2. A parameter describing what quantity the image holds.
  3. The image object name.
This list can easily be extended if necessary.

Example

The interface is a simple get/set interface. Note that the "set" methods can be chained together since each set method returns a reference to its object (rather like cout).

       ImageInfo ii;
       ii.setRestoringBeam(Quantity(30,"arcsec"), Quantity(10,"arcsec"),
                           Quantity(-18,"deg"));
       .\..
       cout << "The restoring beam is : " << oi.restoringBeam() << endl;

Motivation

This sort of information needed a standard place to go with a standard interface so it could be moved out of MiscInfo.

To Do

Definition at line 92 of file ImageInfo.h.
ImageInfo::ImageTypes imageType () const
 Set and get the Image Type.
ImageInfosetImageType (ImageTypes type)
static String imageType (ImageInfo::ImageTypes type)
static ImageInfo::ImageTypes imageType (String type)

Public Types

enum  ImageTypes
 This enum defines the actual quantity being held in an image It's really only used for descriptive information. More...

Public Member Functions

 ImageInfo ()
 Default constructor.
 ~ImageInfo ()
 Destructor.
 ImageInfo (const ImageInfo &other)
 Copy constructor (copy semantics).
ImageInfooperator= (const ImageInfo &other)
 Assignment (copy semantics).
Bool getRestoringBeam (LoggerHolder &logger)
 Get the restoring beam from a LoggerHolder (where the history is stored) as AIPS writes the beam in the FITS history rather than the header keywords.
Bool fromFITSOld (Vector< String > &error, const RecordInterface &inRecord)
 Old version.
Vector< Quantum< Double > > restoringBeam () const
 Set and get the restoring beam.
ImageInfosetRestoringBeam (const Vector< Quantum< Double > > &beam)
ImageInfosetRestoringBeam (const Quantum< Double > &major, const Quantum< Double > &minor, const Quantum< Double > &pa)
ImageInforemoveRestoringBeam ()
String objectName () const
 Set and get the Image object name.
ImageInfosetObjectName (const String &object)
virtual Bool toRecord (String &error, RecordInterface &outRecord) const
 Functions to interconvert between an ImageInfo and a record.
virtual Bool fromRecord (String &error, const RecordInterface &inRecord)
 Initialise the class from a Record representation.
Bool toFITS (String &error, RecordInterface &outRecord) const
 Functions to interconvert between an ImageInfo and FITS keywords (converted to a Record).
Bool fromFITS (Vector< String > &error, const RecordInterface &inRecord)

Static Public Member Functions

static ImageInfo::ImageTypes imageTypeFromFITS (Int fitsValue)
 This function takes an unofficial fitsValue found on the Stokes axis and returns the appropriate ImageType.
static Vector< StringkeywordNamesFITS ()
 It might be useful to know what FITS keyword names are used in to/from FITS so we can remove them so they won't be used more than once.
static ImageInfo::ImageTypes MiriadImageType (const String &type)
 Convert the Miriad 'btype' strings to the ImageType.
static Vector< Quantum< Double > > defaultRestoringBeam ()
 In some circumstances it might be useful to know what the defaults for the various values are so you can check if they have been set.
static ImageTypes defaultImageType ()
static String defaultObjectName ()

Private Member Functions

void copy_other (const ImageInfo &other)
 Common copy ctor/assignment operator code.

Private Attributes

Vector< Quantum< Double > > itsRestoringBeam
ImageInfo::ImageTypes itsImageType
String itsObjectName


Member Enumeration Documentation

enum casa::ImageInfo::ImageTypes

This enum defines the actual quantity being held in an image It's really only used for descriptive information.

Definition at line 98 of file ImageInfo.h.


Constructor & Destructor Documentation

casa::ImageInfo::ImageInfo (  ) 

Default constructor.

casa::ImageInfo::~ImageInfo (  ) 

Destructor.

casa::ImageInfo::ImageInfo ( const ImageInfo other  ) 

Copy constructor (copy semantics).


Member Function Documentation

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

Assignment (copy semantics).

Vector<Quantum<Double> > casa::ImageInfo::restoringBeam (  )  const

Set and get the restoring beam.

Vector beam in order major axis, minor axis, position angle.

ImageInfo& casa::ImageInfo::setRestoringBeam ( const Vector< Quantum< Double > > &  beam  ) 

ImageInfo& casa::ImageInfo::setRestoringBeam ( const Quantum< Double > &  major,
const Quantum< Double > &  minor,
const Quantum< Double > &  pa 
)

ImageInfo& casa::ImageInfo::removeRestoringBeam (  ) 

Bool casa::ImageInfo::getRestoringBeam ( LoggerHolder logger  ) 

Get the restoring beam from a LoggerHolder (where the history is stored) as AIPS writes the beam in the FITS history rather than the header keywords.

If there is no beam, False is returned, and the internal state of the object is unchanged.

ImageInfo::ImageTypes casa::ImageInfo::imageType (  )  const

Set and get the Image Type.

ImageInfo& casa::ImageInfo::setImageType ( ImageTypes  type  ) 

static String casa::ImageInfo::imageType ( ImageInfo::ImageTypes  type  )  [static]

static ImageInfo::ImageTypes casa::ImageInfo::imageType ( String  type  )  [static]

String casa::ImageInfo::objectName (  )  const

Set and get the Image object name.

ImageInfo& casa::ImageInfo::setObjectName ( const String object  ) 

virtual Bool casa::ImageInfo::toRecord ( String error,
RecordInterface outRecord 
) const [virtual]

Functions to interconvert between an ImageInfo and a record.

These functions are inherited from class RecordTransformable . As new fields get added to ImageInfo these functions should be augmented. Missing fields should not generate an error to in fromRecord to allow for backwards compatibility - null values should be supplied instead. The record field names are: "restoringbeam, imagetype, objectname".

Implements casa::RecordTransformable.

virtual Bool casa::ImageInfo::fromRecord ( String error,
const RecordInterface inRecord 
) [virtual]

Initialise the class from a Record representation.

The input record should contain the fields that are required by the class. Other fields will be ignored. If the transformation succeeds then the error String is unchanged and the function returns True. Otherwise the function returns False and appends an error message to the supplied String giving the reason why the conversion failed.

Implements casa::RecordTransformable.

static Vector<Quantum<Double> > casa::ImageInfo::defaultRestoringBeam (  )  [static]

In some circumstances it might be useful to know what the defaults for the various values are so you can check if they have been set.

The default restoring beam is a null vector.

static ImageTypes casa::ImageInfo::defaultImageType (  )  [static]

static String casa::ImageInfo::defaultObjectName (  )  [static]

Bool casa::ImageInfo::toFITS ( String error,
RecordInterface outRecord 
) const

Functions to interconvert between an ImageInfo and FITS keywords (converted to a Record).

Failure of fromFITS should probably not be regarded as fatal as the default ImageInfo values are viable. For each item contained in the ImageInfo, an attempt to decode it from FITS is made. If any of them fail, False is returned, but it attempts to decode them all. For those that fail an error message is held in error in the order restoring beam, and image type. error will be returned of length 0 if the return value is True, else it will be length 2.

Bool casa::ImageInfo::fromFITS ( Vector< String > &  error,
const RecordInterface inRecord 
)

Bool casa::ImageInfo::fromFITSOld ( Vector< String > &  error,
const RecordInterface inRecord 
)

Old version.

static ImageInfo::ImageTypes casa::ImageInfo::imageTypeFromFITS ( Int  fitsValue  )  [static]

This function takes an unofficial fitsValue found on the Stokes axis and returns the appropriate ImageType.

The idea is that you detect the unofficial value, drop the Stokes axis, and store the value as an ImageType in ImageInfo. Only values pertaining to beam, optical depth and spectral index are handled here. All others give back Undefined. See usage in Image FITS conversion classes.

static Vector<String> casa::ImageInfo::keywordNamesFITS (  )  [static]

It might be useful to know what FITS keyword names are used in to/from FITS so we can remove them so they won't be used more than once.

The names are in lower case.

static ImageInfo::ImageTypes casa::ImageInfo::MiriadImageType ( const String type  )  [static]

Convert the Miriad 'btype' strings to the ImageType.

Some Miriad 'btype's are dealt with in aips++ via the Stokes axis (fractional_polarization, polarized_intensity, position_angle) and so these will return Undefined.

void casa::ImageInfo::copy_other ( const ImageInfo other  )  [private]

Common copy ctor/assignment operator code.


Member Data Documentation

Vector<Quantum<Double> > casa::ImageInfo::itsRestoringBeam [private]

Definition at line 220 of file ImageInfo.h.

ImageInfo::ImageTypes casa::ImageInfo::itsImageType [private]

Definition at line 221 of file ImageInfo.h.

String casa::ImageInfo::itsObjectName [private]

Definition at line 222 of file ImageInfo.h.


The documentation for this class was generated from the following file:
Generated on Mon Sep 1 22:46:40 2008 for NRAOCASA by  doxygen 1.5.1