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

A model component of the sky brightness. More...

#include <SkyCompRep.h>

Inheritance diagram for casa::SkyCompRep:
casa::SkyCompBase casacore::RecordTransformable

Public Member Functions

 SkyCompRep ()
 The default SkyCompRep is a point source with a constant spectrum. More...
 
 SkyCompRep (const ComponentType::Shape &shape)
 Construct a SkyCompRep of the specified shape. More...
 
 SkyCompRep (const ComponentType::Shape &shape, const ComponentType::SpectralShape &spectrum)
 Construct a SkyCompRep with the user specified model for the shape and spectrum. More...
 
 SkyCompRep (const Flux< casacore::Double > &flux, const ComponentShape &shape, const SpectralModel &spectrum)
 Construct a SkyCompRep with a fully specified model for the shape, spectrum and flux. More...
 
 SkyCompRep (const SkyCompRep &other)
 The copy constructor uses copy semantics. More...
 
virtual ~SkyCompRep ()
 The destructor does not appear to do much. More...
 
SkyCompRepoperator= (const SkyCompRep &other)
 The assignment operator uses copy semantics. More...
 
virtual const Flux
< casacore::Double > & 
flux () const
 See the corresponding functions in the SkyCompBase class for a description of these functions. More...
 
virtual Flux< casacore::Double > & flux ()
 
virtual const ComponentShapeshape () const
 See the corresponding functions in the SkyCompBase class for a description of these functions. More...
 
virtual ComponentShapeshape ()
 
virtual void setShape (const ComponentShape &newShape)
 
virtual const SpectralModelspectrum () const
 See the corresponding functions in the SkyCompBase class for a description of these functions. More...
 
virtual SpectralModelspectrum ()
 
virtual void setSpectrum (const SpectralModel &newSpectrum)
 
virtual casacore::Stringlabel ()
 See the corresponding functions in the SkyCompBase class for a description of these functions. More...
 
virtual const casacore::Stringlabel () const
 
virtual casacore::Vector
< casacore::Double > & 
optionalParameters ()
 See the corresponding functions in the SkyCompBase class for a description of these functions. More...
 
virtual const casacore::Vector
< casacore::Double > & 
optionalParameters () const
 
virtual casacore::Bool isPhysical () const
 See the corresponding function in the SkyCompBase class for a description of this function. More...
 
virtual Flux< casacore::Doublesample (const casacore::MDirection &direction, const casacore::MVAngle &pixelLatSize, const casacore::MVAngle &pixelLongSize, const casacore::MFrequency &centerFrequency) const
 See the corresponding function in the SkyCompBase class for a description of this function. More...
 
virtual void sample (casacore::Cube< casacore::Double > &samples, const casacore::Unit &reqUnit, const casacore::Vector< casacore::MVDirection > &directions, const casacore::MeasRef< casacore::MDirection > &dirRef, const casacore::MVAngle &pixelLatSize, const casacore::MVAngle &pixelLongSize, const casacore::Vector< casacore::MVFrequency > &frequencies, const casacore::MeasRef< casacore::MFrequency > &freqRef) const
 See the corresponding function in the SkyCompBase class for a description of this function. More...
 
virtual Flux< casacore::Doublevisibility (const casacore::Vector< casacore::Double > &uvw, const casacore::Double &frequency) const
 See the corresponding function in the SkyCompBase class for a description of this function. More...
 
virtual void visibility (casacore::Cube< casacore::DComplex > &visibilities, const casacore::Matrix< casacore::Double > &uvws, const casacore::Vector< casacore::Double > &frequencies) const
 See the corresponding function in the SkyCompBase class for a description of this function. More...
 
virtual casacore::Bool fromRecord (casacore::String &errorMessage, const casacore::RecordInterface &record)
 See the corresponding functions in the SkyCompBase class for a description of these functions. More...
 
virtual casacore::Bool toRecord (casacore::String &errorMessage, casacore::RecordInterface &record) const
 Convert the class to an Record representation. More...
 
casacore::Vector
< casacore::Double
toPixel (const casacore::Unit &brightnessUnitOut, const casacore::GaussianBeam &restoringBeam, const casacore::CoordinateSystem &cSys, casacore::Stokes::StokesTypes stokes) const
 Convert the SkyComponent to a vector of Doubles for the specified casacore::Stokes type (others are lost). More...
 
void fromPixel (casacore::Double &fluxRatio, const casacore::Vector< casacore::Double > &parameters, const casacore::Unit &brightnessUnitIn, const casacore::GaussianBeam &restoringBeam, const casacore::CoordinateSystem &cSys, ComponentType::Shape componentShape, casacore::Stokes::StokesTypes stokes)
 Take a vector Doubles and fill the SkyComponent from the values. More...
 
virtual casacore::Bool ok () const
 See the corresponding function in the SkyCompBase class for a description of this function. More...
 
- Public Member Functions inherited from casa::SkyCompBase
virtual ~SkyCompBase ()
 The destructor does not anything. More...
 
- Public Member Functions inherited from casacore::RecordTransformable
virtual ~RecordTransformable ()
 The destructor must be virtual so that the destructor of derived classes is actually used. More...
 
virtual Bool fromString (String &error, const String &inString)
 Initialise the class from a String representation. More...
 
virtual const Stringident () const
 Specify the identification of the record (e.g. More...
 

Static Public Member Functions

static casacore::Double convertToJy (const casacore::Unit &brightnessUnit)
 Find the factor that converts whatever per whatevers (e.g. More...
 
static casacore::Quantity peakToIntegralFlux (const casacore::DirectionCoordinate &dirCoord, const ComponentType::Shape componentShape, const casacore::Quantum< casacore::Double > &peakFlux, const casacore::Quantum< casacore::Double > &majorAxis, const casacore::Quantum< casacore::Double > &minorAxis, const casacore::GaussianBeam &restoringBeam)
 Convert a peak flux density to integral flux density. More...
 
static casacore::Quantity integralToPeakFlux (const casacore::DirectionCoordinate &dirCoord, const ComponentType::Shape componentShape, const casacore::Quantity &integralFlux, const casacore::Unit &brightnessUnit, const casacore::Quantity &majorAxis, const casacore::Quantity &minorAxis, const casacore::GaussianBeam &restoringBeam)
 Convert an integral flux density to peak flux density. More...
 

Static Private Member Functions

static casacore::Unit defineBrightnessUnits (casacore::LogIO &os, const casacore::Unit &brightnessUnitIn, const casacore::DirectionCoordinate &dirCoord, const casacore::GaussianBeam &restoringBeam, const casacore::Bool integralIsJy)
 Make definitions to handle "/beam" and "/pixel" units. More...
 
static void undefineBrightnessUnits ()
 Remove the user defined "/beam" and "/pixel" definitions. More...
 

Private Attributes

casacore::CountedPtr
< ComponentShape
itsShapePtr
 
casacore::CountedPtr
< SpectralModel
itsSpectrumPtr
 
Flux< casacore::DoubleitsFlux
 
casacore::String itsLabel
 
casacore::Vector
< casacore::Double
itsOptParms
 

Detailed Description

A model component of the sky brightness.

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd
Test programs:
tSkyCompRep

Prerequisite

Synopsis

This class is concrete implementation of a class that represents a component of a model of the sky brightness.

The base class (SkyCompBase) contains a description of components and all the member functions used to manipulate them and hence will not be discussed here. But the base class does not include any constructors or a description of the copy semantics. This will be discussed below.

A SkyCompRep is an "envelope" class in the sense that it can contain one of a variety of different component shapes and spectral models. It is necessary to specify the which shape and spectral model you want at construction time. This can be done either with enumerators or by constructing the classes derived from ComponentShape & SpectralModel and supplying them as construction arguments.

This class uses copy semantics for both the copy constructor and the assignment operator.

Example

These examples are coded in the tSkyCompRep.h file.

Example 1:

In this example a SkyCompRep object is created and used to calculate the ...

Motivation

Model fitting is an important part of astronomical data reduction/interpretation. This class defines a model component. Many components can be strung together (using the ComponentList class) to construct a model. It is expected that this class will eventually allow you to solve for parameters of the model.

Thrown Exceptions

To Do

Definition at line 133 of file SkyCompRep.h.

Constructor & Destructor Documentation

casa::SkyCompRep::SkyCompRep ( )

The default SkyCompRep is a point source with a constant spectrum.

See the default constructors in the PointShape, ConstantSpectrum and Flux classes for the default values for the flux, shape and spectrum.

casa::SkyCompRep::SkyCompRep ( const ComponentType::Shape shape)

Construct a SkyCompRep of the specified shape.

The resultant component has a constant spectrum and a shape given by the default constructor of the specified ComponentShape class.

Thrown Exceptions

casa::SkyCompRep::SkyCompRep ( const ComponentType::Shape shape,
const ComponentType::SpectralShape spectrum 
)

Construct a SkyCompRep with the user specified model for the shape and spectrum.

The resultant component has a shape given by the default constructor of the specified ComponentShape class and a spectrum given by the default constructor of the specified SpectralModel class

Thrown Exceptions

casa::SkyCompRep::SkyCompRep ( const Flux< casacore::Double > &  flux,
const ComponentShape shape,
const SpectralModel spectrum 
)

Construct a SkyCompRep with a fully specified model for the shape, spectrum and flux.

casa::SkyCompRep::SkyCompRep ( const SkyCompRep other)

The copy constructor uses copy semantics.

virtual casa::SkyCompRep::~SkyCompRep ( )
virtual

The destructor does not appear to do much.

Member Function Documentation

static casacore::Double casa::SkyCompRep::convertToJy ( const casacore::Unit brightnessUnit)
static

Find the factor that converts whatever per whatevers (e.g.

mJy per beam) to Jy per whatevers (e.g. Jy per beam)

static casacore::Unit casa::SkyCompRep::defineBrightnessUnits ( casacore::LogIO os,
const casacore::Unit brightnessUnitIn,
const casacore::DirectionCoordinate dirCoord,
const casacore::GaussianBeam restoringBeam,
const casacore::Bool  integralIsJy 
)
staticprivate

Make definitions to handle "/beam" and "/pixel" units.

The restoring beam is provided in a vector of quanta (major, minor, position angle). Should be length 0 or 3. It can be obtained from class ImageInfo

virtual const Flux<casacore::Double>& casa::SkyCompRep::flux ( ) const
virtual

See the corresponding functions in the SkyCompBase class for a description of these functions.

Implements casa::SkyCompBase.

virtual Flux<casacore::Double>& casa::SkyCompRep::flux ( )
virtual

Implements casa::SkyCompBase.

void casa::SkyCompRep::fromPixel ( casacore::Double fluxRatio,
const casacore::Vector< casacore::Double > &  parameters,
const casacore::Unit brightnessUnitIn,
const casacore::GaussianBeam restoringBeam,
const casacore::CoordinateSystem cSys,
ComponentType::Shape  componentShape,
casacore::Stokes::StokesTypes  stokes 
)

Take a vector Doubles and fill the SkyComponent from the values.

The first three elements of the given vector are : flux for given casacore::Stokes (in the units you specify), longitude location (absolute pixels), and latitude location (absolute pixels). For DISK and GAUSSIAN shapes, the next three elements are major axis (absolute pixels) minor axis (absolute pixels), and position angle (N->E; radians). You must specify the brightness units in which the flux is stored in the vector. It will be converted to an integral reprentation internally for the SkyComponent. So as to be able to handle /beam units, the restoring beam must also be supplied. It can be obtained from the casacore::ImageInfo class. It should be of length 3 or 0 (no beam). Multiplying by fluxRatio converts the brightness units to Jy/whatever (e.g. mJy/beam to Jy/beam). You must specify the type of shape to convert to. The SkyComponent is given a constant spectrum.

virtual casacore::Bool casa::SkyCompRep::fromRecord ( casacore::String errorMessage,
const casacore::RecordInterface record 
)
virtual

See the corresponding functions in the SkyCompBase class for a description of these functions.

Implements casa::SkyCompBase.

static casacore::Quantity casa::SkyCompRep::integralToPeakFlux ( const casacore::DirectionCoordinate dirCoord,
const ComponentType::Shape  componentShape,
const casacore::Quantity integralFlux,
const casacore::Unit brightnessUnit,
const casacore::Quantity majorAxis,
const casacore::Quantity minorAxis,
const casacore::GaussianBeam restoringBeam 
)
static

Convert an integral flux density to peak flux density.

The brightness unit of the output quantum (e.g. mJy/beam) is specified by brightnessUnit Throws an exception if the units of integralFlux do not conform to Jy.

virtual casacore::Bool casa::SkyCompRep::isPhysical ( ) const
virtual

See the corresponding function in the SkyCompBase class for a description of this function.

Implements casa::SkyCompBase.

virtual casacore::String& casa::SkyCompRep::label ( )
virtual

See the corresponding functions in the SkyCompBase class for a description of these functions.

Implements casa::SkyCompBase.

virtual const casacore::String& casa::SkyCompRep::label ( ) const
virtual

Implements casa::SkyCompBase.

virtual casacore::Bool casa::SkyCompRep::ok ( ) const
virtual

See the corresponding function in the SkyCompBase class for a description of this function.

Implements casa::SkyCompBase.

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

The assignment operator uses copy semantics.

virtual casacore::Vector<casacore::Double>& casa::SkyCompRep::optionalParameters ( )
virtual

See the corresponding functions in the SkyCompBase class for a description of these functions.

Implements casa::SkyCompBase.

virtual const casacore::Vector<casacore::Double>& casa::SkyCompRep::optionalParameters ( ) const
virtual

Implements casa::SkyCompBase.

static casacore::Quantity casa::SkyCompRep::peakToIntegralFlux ( const casacore::DirectionCoordinate dirCoord,
const ComponentType::Shape  componentShape,
const casacore::Quantum< casacore::Double > &  peakFlux,
const casacore::Quantum< casacore::Double > &  majorAxis,
const casacore::Quantum< casacore::Double > &  minorAxis,
const casacore::GaussianBeam restoringBeam 
)
static

Convert a peak flux density to integral flux density.

virtual Flux<casacore::Double> casa::SkyCompRep::sample ( const casacore::MDirection direction,
const casacore::MVAngle pixelLatSize,
const casacore::MVAngle pixelLongSize,
const casacore::MFrequency centerFrequency 
) const
virtual

See the corresponding function in the SkyCompBase class for a description of this function.

Implements casa::SkyCompBase.

virtual void casa::SkyCompRep::sample ( casacore::Cube< casacore::Double > &  samples,
const casacore::Unit reqUnit,
const casacore::Vector< casacore::MVDirection > &  directions,
const casacore::MeasRef< casacore::MDirection > &  dirRef,
const casacore::MVAngle pixelLatSize,
const casacore::MVAngle pixelLongSize,
const casacore::Vector< casacore::MVFrequency > &  frequencies,
const casacore::MeasRef< casacore::MFrequency > &  freqRef 
) const
virtual

See the corresponding function in the SkyCompBase class for a description of this function.

Implements casa::SkyCompBase.

virtual void casa::SkyCompRep::setShape ( const ComponentShape newShape)
virtual

Implements casa::SkyCompBase.

virtual void casa::SkyCompRep::setSpectrum ( const SpectralModel newSpectrum)
virtual

Implements casa::SkyCompBase.

virtual const ComponentShape& casa::SkyCompRep::shape ( ) const
virtual

See the corresponding functions in the SkyCompBase class for a description of these functions.

Implements casa::SkyCompBase.

virtual ComponentShape& casa::SkyCompRep::shape ( )
virtual

Implements casa::SkyCompBase.

virtual const SpectralModel& casa::SkyCompRep::spectrum ( ) const
virtual

See the corresponding functions in the SkyCompBase class for a description of these functions.

Implements casa::SkyCompBase.

virtual SpectralModel& casa::SkyCompRep::spectrum ( )
virtual

Implements casa::SkyCompBase.

casacore::Vector<casacore::Double> casa::SkyCompRep::toPixel ( const casacore::Unit brightnessUnitOut,
const casacore::GaussianBeam restoringBeam,
const casacore::CoordinateSystem cSys,
casacore::Stokes::StokesTypes  stokes 
) const

Convert the SkyComponent to a vector of Doubles for the specified casacore::Stokes type (others are lost).

The first three elements of the returned vector are : flux for given casacore::Stokes (in the units you specify), longitude location (absolute pixels), and latitude location (absolute pixels). For DISK and GAUSSIAN shapes, the next three elements are major axis (absolute pixels) minor axis (absolute pixels), and position angle (N->E; radians). You must specify the brightness units to which the integral flux stored in the SkyComponent should be converted. So as to be able to handle /beam units, the restoring beam must also be suppluied. It can be obtained from the casacore::ImageInfo class. It should be of length 3 or 0 (no beam). A constant spectrum is used so any spectral index information in the component is lost.

virtual casacore::Bool casa::SkyCompRep::toRecord ( casacore::String error,
casacore::RecordInterface outRecord 
) const
virtual

Convert the class to an Record representation.

The input record may already contain fields and these fields may be silently overridden. New fields may be added to the input Record. 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::SkyCompBase.

static void casa::SkyCompRep::undefineBrightnessUnits ( )
staticprivate

Remove the user defined "/beam" and "/pixel" definitions.

virtual Flux<casacore::Double> casa::SkyCompRep::visibility ( const casacore::Vector< casacore::Double > &  uvw,
const casacore::Double frequency 
) const
virtual

See the corresponding function in the SkyCompBase class for a description of this function.

Implements casa::SkyCompBase.

virtual void casa::SkyCompRep::visibility ( casacore::Cube< casacore::DComplex > &  visibilities,
const casacore::Matrix< casacore::Double > &  uvws,
const casacore::Vector< casacore::Double > &  frequencies 
) const
virtual

See the corresponding function in the SkyCompBase class for a description of this function.

Implements casa::SkyCompBase.

Member Data Documentation

Flux<casacore::Double> casa::SkyCompRep::itsFlux
private

Definition at line 343 of file SkyCompRep.h.

casacore::String casa::SkyCompRep::itsLabel
private

Definition at line 344 of file SkyCompRep.h.

casacore::Vector<casacore::Double> casa::SkyCompRep::itsOptParms
private

Definition at line 345 of file SkyCompRep.h.

casacore::CountedPtr<ComponentShape> casa::SkyCompRep::itsShapePtr
private

Definition at line 341 of file SkyCompRep.h.

casacore::CountedPtr<SpectralModel> casa::SkyCompRep::itsSpectrumPtr
private

Definition at line 342 of file SkyCompRep.h.


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