casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
casa::ImageMetaDataRW< T > Class Template Reference

A class in which to store and allow read-write access to image metadata. More...

#include <ImageMetaDataRW.h>

Inheritance diagram for casa::ImageMetaDataRW< T >:
casa::ImageMetaDataBase< T >

Public Member Functions

 ImageMetaDataRW ()=delete
 
 ImageMetaDataRW (SPIIT image)
 
casacore::Bool remove (const casacore::String &key)
 remove, if possible, the specified parameter. More...
 
casacore::Bool removeMask (const casacore::String &maskName)
 remove the specified mask. More...
 
casacore::Record toRecord (casacore::Bool verbose) const
 convert the header info to a casacore::Record and list to logger if verbose=true More...
 
casacore::Bool add (const casacore::String &key, const casacore::ValueHolder &value)
 add a key-value pair More...
 
casacore::Bool set (const casacore::String &key, const casacore::ValueHolder &value)
 set (update) the value associated with the key. More...
 
void setCsys (const casacore::Record &coordinates)
 set the coordinate system from a Record. More...
 
- Public Member Functions inherited from casa::ImageMetaDataBase< T >
 ImageMetaDataBase ()=delete
 
virtual ~ImageMetaDataBase ()
 
casacore::CoordinateSystem coordsys (const std::vector< casacore::Int > &axes) const
 
casacore::DataType dataType () const
 
casacore::uInt nChannels () const
 
casacore::Bool isChannelNumberValid (const casacore::uInt chan) const
 Is the specified channel number valid for this image? More...
 
casacore::Int stokesPixelNumber (const casacore::String &stokesString) const
 Get the pixel number on the polarization axis of the specified stokes parameter. More...
 
casacore::String stokesAtPixel (const casacore::uInt pixel) const
 get the stokes parameter at the specified pixel value on the polarization axis. More...
 
casacore::uInt nStokes () const
 Get the number of stokes parameters in this image. More...
 
casacore::Bool isStokesValid (const casacore::String &stokesString) const
 is the specified stokes parameter present in the image? More...
 
casacore::Vector< casacore::IntdirectionShape () const
 Get the shape of the direction axes. More...
 
casacore::Bool areChannelAndStokesValid (casacore::String &message, const casacore::uInt chan, const casacore::String &stokesString) const
 if the specified stokes parameter is valid. More...
 
casacore::RecordgetBoundingBox (const casacore::Record &region) const
 get the bounding box in the image for the specified region. More...
 
casacore::ValueHolder getFITSValue (const casacore::String &key) const
 get the value of the datum corresponding to the given casacore::FITS keyword. More...
 
casacore::Record toWorld (const casacore::Vector< double > &value, const casacore::String &format="n", casacore::Bool doVelocity=true, const casacore::String &dirFrame="cl", const casacore::String &freqFrame="cl") const
 if doVelocity=true, compute spectral velocities as well as frequencies, if false, only compute frequencies. More...
 

Protected Member Functions

const casacore::ImageInfo_getInfo () const
 
const casacore::CoordinateSystem_getCoords () const
 
casacore::Vector
< casacore::String
_getAxisNames () const
 
casacore::Vector
< casacore::String
_getAxisUnits () const
 
casacore::GaussianBeam _getBeam () const
 
casacore::String _getBrightnessUnit () const
 
casacore::String _getImType () const
 
std::vector< casacore::Quantity_getIncrements () const
 
casacore::Vector
< casacore::String
_getMasks () const
 
casacore::String _getObject () const
 
casacore::String _getEquinox () const
 
casacore::MEpoch _getObsDate () const
 
casacore::String _getObserver () const
 
casacore::String _getProjection () const
 
casacore::String _getRefFreqType () const
 
casacore::Vector
< casacore::Double
_getRefPixel () const
 
casacore::Vector
< casacore::Quantity
_getRefValue () const
 
casacore::Quantity _getRestFrequency () const
 
casacore::String _getTelescope () const
 
casacore::Record _getStatistics () const
 
casacore::Vector
< casacore::String
_getStokes () const
 
- Protected Member Functions inherited from casa::ImageMetaDataBase< T >
 ImageMetaDataBase (SPCIIT)
 
casacore::LogIO_getLog ()
 
casacore::String _getEpochString () const
 
casacore::IPosition _getShape () const
 
casacore::Record _makeHeader () const
 
void _toLog (const casacore::Record &header) const
 
casacore::uInt _getAxisNumber (const casacore::String &key) const
 
casacore::Record _calcStats () const
 
const casacore::TableRecord _miscInfo () const
 
casacore::uInt _ndim () const
 

Private Member Functions

std::unique_ptr
< casacore::CoordinateSystem
_makeCoordinateSystem (const casacore::Record &coordinates, const casacore::IPosition &shape)
 
void _setCoordinateValue (const casacore::String &key, const casacore::ValueHolder &value)
 
casacore::String _getString (const casacore::String &key, const casacore::ValueHolder &value) const
 
void _setUserDefined (const casacore::String &key, const casacore::ValueHolder &v)
 
casacore::Bool _setUnit (const casacore::String &unit)
 
casacore::Bool _setCsys (const casacore::CoordinateSystem &csys)
 
casacore::Bool _setImageInfo (const casacore::ImageInfo &info)
 
const casacore::TableRecord _miscInfo () const
 
void _setMiscInfo (const casacore::TableRecord &rec)
 
casacore::Bool _hasRegion (const casacore::String &maskName) const
 
casacore::Bool _isWritable () const
 
template<class U , class V >
void _modHistory (const casacore::String &func, const casacore::String &keyword, const U &oldVal, const V &newVal)
 
template<class U >
void _addHistory (const casacore::String &func, const casacore::String &keyword, const U &newVal)
 
void _toHistory (const casacore::String &origin, const casacore::String &record)
 

Static Private Member Functions

static casacore::Quantity _getQuantity (const casacore::ValueHolder &v)
 
template<class U >
static casacore::String _quotify (const U &val)
 

Private Attributes

SPIIT _image
 
casacore::String _bunit
 These are mutable because they are only to be set once and then cached. More...
 
casacore::String _imtype
 
casacore::String _object
 
casacore::String _equinox
 
casacore::String _observer
 
casacore::String _projection
 
casacore::String _reffreqtype
 
casacore::String _telescope
 
casacore::MEpoch _obsdate
 
casacore::Quantity _restFreq
 
casacore::Vector
< casacore::String
_masks
 
casacore::Vector
< casacore::String
_stokes
 
casacore::GaussianBeam _beam
 
casacore::Vector
< casacore::String
_axisNames
 
casacore::Vector
< casacore::String
_axisUnits
 
casacore::Vector
< casacore::Double
_refPixel
 
std::vector< casacore::Quantity_refVal
 
std::vector< casacore::Quantity_increment
 
casacore::Record _header
 
casacore::Record _stats
 

Detailed Description

template<class T>
class casa::ImageMetaDataRW< T >

A class in which to store and allow read-write access to image metadata.

Intended use:

Public interface

Prerequisite

Etymology

The ImageMetaDataRW class name is derived from its role as holding image metadata and providing read-write access.

Synopsis

The ImageMetaDataRW object is meant to allow access to image metadata (eg, shape, coordinate system info such as spectral and polarization axes numbers, etc). It allows write access to some values. This class contains the writable methods and extends ImageMetaData which contains the read-only methods.

Example

Construct an object of this class by passing the associated image to the constructor.

ImageMetaDataRW<casacore::Float> myImageMetaData(myImage);

Motivation

This class is meant to provide an object-oriented interface for accessing image metadata without polluting the casacore::ImageInterface and CoordinateSystem classes with these methods.

Definition at line 76 of file ImageMetaDataRW.h.

Constructor & Destructor Documentation

template<class T >
casa::ImageMetaDataRW< T >::ImageMetaDataRW ( )
delete
template<class T >
casa::ImageMetaDataRW< T >::ImageMetaDataRW ( SPIIT  image)

Member Function Documentation

template<class T >
template<class U >
void casa::ImageMetaDataRW< T >::_addHistory ( const casacore::String func,
const casacore::String keyword,
const U &  newVal 
)
private
template<class T >
casacore::Vector<casacore::String> casa::ImageMetaDataRW< T >::_getAxisNames ( ) const
protectedvirtual
template<class T >
casacore::Vector<casacore::String> casa::ImageMetaDataRW< T >::_getAxisUnits ( ) const
protectedvirtual
template<class T >
casacore::GaussianBeam casa::ImageMetaDataRW< T >::_getBeam ( ) const
protectedvirtual
template<class T >
casacore::String casa::ImageMetaDataRW< T >::_getBrightnessUnit ( ) const
protectedvirtual
template<class T >
const casacore::CoordinateSystem& casa::ImageMetaDataRW< T >::_getCoords ( ) const
protectedvirtual
template<class T >
casacore::String casa::ImageMetaDataRW< T >::_getEquinox ( ) const
protectedvirtual
template<class T >
casacore::String casa::ImageMetaDataRW< T >::_getImType ( ) const
protectedvirtual
template<class T >
std::vector<casacore::Quantity> casa::ImageMetaDataRW< T >::_getIncrements ( ) const
protectedvirtual
template<class T >
const casacore::ImageInfo& casa::ImageMetaDataRW< T >::_getInfo ( ) const
protectedvirtual
template<class T >
casacore::Vector<casacore::String> casa::ImageMetaDataRW< T >::_getMasks ( ) const
protectedvirtual
template<class T >
casacore::String casa::ImageMetaDataRW< T >::_getObject ( ) const
protectedvirtual
template<class T >
casacore::MEpoch casa::ImageMetaDataRW< T >::_getObsDate ( ) const
protectedvirtual
template<class T >
casacore::String casa::ImageMetaDataRW< T >::_getObserver ( ) const
protectedvirtual
template<class T >
casacore::String casa::ImageMetaDataRW< T >::_getProjection ( ) const
protectedvirtual

Reimplemented from casa::ImageMetaDataBase< T >.

template<class T >
static casacore::Quantity casa::ImageMetaDataRW< T >::_getQuantity ( const casacore::ValueHolder v)
staticprivate
template<class T >
casacore::String casa::ImageMetaDataRW< T >::_getRefFreqType ( ) const
protectedvirtual
template<class T >
casacore::Vector<casacore::Double> casa::ImageMetaDataRW< T >::_getRefPixel ( ) const
protectedvirtual
template<class T >
casacore::Vector<casacore::Quantity> casa::ImageMetaDataRW< T >::_getRefValue ( ) const
protectedvirtual
template<class T >
casacore::Quantity casa::ImageMetaDataRW< T >::_getRestFrequency ( ) const
protectedvirtual
template<class T >
casacore::Record casa::ImageMetaDataRW< T >::_getStatistics ( ) const
protectedvirtual
template<class T >
casacore::Vector<casacore::String> casa::ImageMetaDataRW< T >::_getStokes ( ) const
protectedvirtual
template<class T >
casacore::String casa::ImageMetaDataRW< T >::_getString ( const casacore::String key,
const casacore::ValueHolder value 
) const
private
template<class T >
casacore::String casa::ImageMetaDataRW< T >::_getTelescope ( ) const
protectedvirtual
template<class T >
casacore::Bool casa::ImageMetaDataRW< T >::_hasRegion ( const casacore::String maskName) const
private
template<class T >
casacore::Bool casa::ImageMetaDataRW< T >::_isWritable ( ) const
private
template<class T >
std::unique_ptr<casacore::CoordinateSystem> casa::ImageMetaDataRW< T >::_makeCoordinateSystem ( const casacore::Record coordinates,
const casacore::IPosition shape 
)
private
template<class T >
const casacore::TableRecord casa::ImageMetaDataRW< T >::_miscInfo ( ) const
private
template<class T >
template<class U , class V >
void casa::ImageMetaDataRW< T >::_modHistory ( const casacore::String func,
const casacore::String keyword,
const U &  oldVal,
const V &  newVal 
)
private
template<class T >
template<class U >
static casacore::String casa::ImageMetaDataRW< T >::_quotify ( const U &  val)
staticprivate
template<class T >
void casa::ImageMetaDataRW< T >::_setCoordinateValue ( const casacore::String key,
const casacore::ValueHolder value 
)
private
template<class T >
casacore::Bool casa::ImageMetaDataRW< T >::_setCsys ( const casacore::CoordinateSystem csys)
private
template<class T >
casacore::Bool casa::ImageMetaDataRW< T >::_setImageInfo ( const casacore::ImageInfo info)
private
template<class T >
void casa::ImageMetaDataRW< T >::_setMiscInfo ( const casacore::TableRecord rec)
private
template<class T >
casacore::Bool casa::ImageMetaDataRW< T >::_setUnit ( const casacore::String unit)
private
template<class T >
void casa::ImageMetaDataRW< T >::_setUserDefined ( const casacore::String key,
const casacore::ValueHolder v 
)
private
template<class T >
void casa::ImageMetaDataRW< T >::_toHistory ( const casacore::String origin,
const casacore::String record 
)
private
template<class T >
casacore::Bool casa::ImageMetaDataRW< T >::add ( const casacore::String key,
const casacore::ValueHolder value 
)

add a key-value pair

template<class T >
casacore::Bool casa::ImageMetaDataRW< T >::remove ( const casacore::String key)

remove, if possible, the specified parameter.

Returns true if removal was successful.

template<class T >
casacore::Bool casa::ImageMetaDataRW< T >::removeMask ( const casacore::String maskName)

remove the specified mask.

If the empty string is given, all masks will be removed. Returns true if successful, false otherwise or if the specfied mask does not exist.

template<class T >
casacore::Bool casa::ImageMetaDataRW< T >::set ( const casacore::String key,
const casacore::ValueHolder value 
)

set (update) the value associated with the key.

template<class T >
void casa::ImageMetaDataRW< T >::setCsys ( const casacore::Record coordinates)

set the coordinate system from a Record.

template<class T >
casacore::Record casa::ImageMetaDataRW< T >::toRecord ( casacore::Bool  verbose) const
virtual

convert the header info to a casacore::Record and list to logger if verbose=true

Implements casa::ImageMetaDataBase< T >.

Member Data Documentation

template<class T >
casacore::Vector<casacore::String> casa::ImageMetaDataRW< T >::_axisNames
mutableprivate

Definition at line 159 of file ImageMetaDataRW.h.

template<class T >
casacore::Vector<casacore::String> casa::ImageMetaDataRW< T >::_axisUnits
mutableprivate

Definition at line 159 of file ImageMetaDataRW.h.

template<class T >
casacore::GaussianBeam casa::ImageMetaDataRW< T >::_beam
mutableprivate

Definition at line 158 of file ImageMetaDataRW.h.

template<class T >
casacore::String casa::ImageMetaDataRW< T >::_bunit
mutableprivate

These are mutable because they are only to be set once and then cached.

If this contract is broken, and they are set elsewhere defects will likely occur.

Definition at line 153 of file ImageMetaDataRW.h.

template<class T >
casacore::String casa::ImageMetaDataRW< T >::_equinox
mutableprivate

Definition at line 153 of file ImageMetaDataRW.h.

template<class T >
casacore::Record casa::ImageMetaDataRW< T >::_header
mutableprivate

Definition at line 162 of file ImageMetaDataRW.h.

template<class T >
SPIIT casa::ImageMetaDataRW< T >::_image
private

Definition at line 148 of file ImageMetaDataRW.h.

template<class T >
casacore::String casa::ImageMetaDataRW< T >::_imtype
mutableprivate

Definition at line 153 of file ImageMetaDataRW.h.

template<class T >
std::vector<casacore::Quantity> casa::ImageMetaDataRW< T >::_increment
mutableprivate

Definition at line 161 of file ImageMetaDataRW.h.

template<class T >
casacore::Vector<casacore::String> casa::ImageMetaDataRW< T >::_masks
mutableprivate

Definition at line 157 of file ImageMetaDataRW.h.

template<class T >
casacore::String casa::ImageMetaDataRW< T >::_object
mutableprivate

Definition at line 153 of file ImageMetaDataRW.h.

template<class T >
casacore::MEpoch casa::ImageMetaDataRW< T >::_obsdate
mutableprivate

Definition at line 155 of file ImageMetaDataRW.h.

template<class T >
casacore::String casa::ImageMetaDataRW< T >::_observer
mutableprivate

Definition at line 153 of file ImageMetaDataRW.h.

template<class T >
casacore::String casa::ImageMetaDataRW< T >::_projection
mutableprivate

Definition at line 153 of file ImageMetaDataRW.h.

template<class T >
casacore::String casa::ImageMetaDataRW< T >::_reffreqtype
mutableprivate

Definition at line 153 of file ImageMetaDataRW.h.

template<class T >
casacore::Vector<casacore::Double> casa::ImageMetaDataRW< T >::_refPixel
mutableprivate

Definition at line 160 of file ImageMetaDataRW.h.

template<class T >
std::vector<casacore::Quantity> casa::ImageMetaDataRW< T >::_refVal
mutableprivate

Definition at line 161 of file ImageMetaDataRW.h.

template<class T >
casacore::Quantity casa::ImageMetaDataRW< T >::_restFreq
mutableprivate

Definition at line 156 of file ImageMetaDataRW.h.

template<class T >
casacore::Record casa::ImageMetaDataRW< T >::_stats
mutableprivate

Definition at line 162 of file ImageMetaDataRW.h.

template<class T >
casacore::Vector<casacore::String> casa::ImageMetaDataRW< T >::_stokes
mutableprivate

Definition at line 157 of file ImageMetaDataRW.h.

template<class T >
casacore::String casa::ImageMetaDataRW< T >::_telescope
mutableprivate

Definition at line 153 of file ImageMetaDataRW.h.


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