SkyCompRep.h

Classes

SkyCompRep -- A model component of the sky brightness (full description)

class SkyCompRep: public SkyCompBase

Interface

Public Members
SkyCompRep()
SkyCompRep(const ComponentType::Shape& shape)
SkyCompRep(const ComponentType::Shape& shape, const ComponentType::SpectralShape& spectrum)
SkyCompRep(const Flux<Double>& flux, const ComponentShape& shape, const SpectralModel& spectrum)
SkyCompRep(const SkyCompRep& other)
virtual ~SkyCompRep()
SkyCompRep& operator=(const SkyCompRep& other)
virtual const Flux<Double>& flux() const
virtual Flux<Double>& flux()
virtual const ComponentShape& shape() const
virtual ComponentShape& shape()
virtual void setShape(const ComponentShape& newShape)
virtual const SpectralModel& spectrum() const
virtual SpectralModel& spectrum()
virtual void setSpectrum(const SpectralModel& newSpectrum)
virtual String& label()
virtual const String& label() const
virtual Bool isPhysical() const
virtual Flux<Double> sample(const MDirection& direction, const MVAngle& pixelLatSize, const MVAngle& pixelLongSize, const MFrequency& centerFrequency) const
virtual void sample(Cube<Double>& samples, const Unit& reqUnit, const Vector<MVDirection>& directions, const MeasRef<MDirection>& dirRef, const MVAngle& pixelLatSize, const MVAngle& pixelLongSize, const Vector<MVFrequency>& frequencies, const MeasRef<MFrequency>& freqRef) const
virtual Flux<Double> visibility(const Vector<Double>& uvw, const Double& frequency) const
virtual void visibility(Cube<DComplex>& visibilities, const Matrix<Double>& uvws, const Matrix<Double>& frequencies) const
virtual Bool fromRecord(String& errorMessage, const RecordInterface& record)
virtual Bool toRecord(String& errorMessage, RecordInterface& record) const
Vector<Double> toPixel (const Unit& brightnessUnitOut, const Vector<Quantum<Double> >& restoringBeam, const CoordinateSystem& cSys, Stokes::StokesTypes stokes) const
void fromPixel (Double& fluxRatio, const Vector<Double>& parameters, const Unit& brightnessUnitIn, const Vector<Quantum<Double> >& restoringBeam, const CoordinateSystem& cSys, ComponentType::Shape componentShape, Stokes::StokesTypes stokes)
virtual Bool ok() const
static Unit defineBrightnessUnits (LogIO& os, const Unit& brightnessUnitIn, const DirectionCoordinate& dirCoord, const Vector<Quantum<Double> >& restoringBeam, Bool integralIsJy)
static void undefineBrightnessUnits ()
static Double convertToJy (const Unit& brightnessUnit)
static Quantum<Double> peakToIntegralFlux (const DirectionCoordinate& dirCoord, ComponentType::Shape componentShape, const Quantum<Double>& peakFlux, const Quantum<Double>& majorAxis, const Quantum<Double>& minorAxis, const Vector<Quantum<Double> >& restoringBeam)
static Quantum<Double> integralToPeakFlux (const DirectionCoordinate& dirCoord, ComponentType::Shape componentShape, const Quantum<Double>& integralFlux, const Unit& brightnessUnit, const Quantum<Double>& majorAxis, const Quantum<Double>& minorAxis, const Unit<Quantum<Double> >& restoringBeam)
See Also
SkyComponent - Models the sky brightness (reference semantics)

Description

Review Status

Date Reviewed:
yyyy/mm/dd
Programs:
Tests:

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

Member Description

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.

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

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

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

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

SkyCompRep(const SkyCompRep& other)

The copy constructor uses copy semantics

virtual ~SkyCompRep()

The destructor does not appear to do much

SkyCompRep& operator=(const SkyCompRep& other)

The assignment operator uses copy semantics.

virtual const Flux<Double>& flux() const
virtual Flux<Double>& flux()

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

virtual const ComponentShape& shape() const
virtual ComponentShape& shape()
virtual void setShape(const ComponentShape& newShape)

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

virtual const SpectralModel& spectrum() const
virtual SpectralModel& spectrum()
virtual void setSpectrum(const SpectralModel& newSpectrum)

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

virtual String& label()
virtual const String& label() const

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

virtual Bool isPhysical() const

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

virtual Flux<Double> sample(const MDirection& direction, const MVAngle& pixelLatSize, const MVAngle& pixelLongSize, const MFrequency& centerFrequency) const

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

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

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

virtual Flux<Double> visibility(const Vector<Double>& uvw, const Double& frequency) const

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

virtual void visibility(Cube<DComplex>& visibilities, const Matrix<Double>& uvws, const Matrix<Double>& frequencies) const

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

virtual Bool fromRecord(String& errorMessage, const RecordInterface& record)
virtual Bool toRecord(String& errorMessage, RecordInterface& record) const

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

Vector<Double> toPixel (const Unit& brightnessUnitOut, const Vector<Quantum<Double> >& restoringBeam, const CoordinateSystem& cSys, Stokes::StokesTypes stokes) const

Convert the SkyComponent to a vector of Doubles for the specified Stokes type (others are lost). The first three elements of the returned vector are : flux for given 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 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.

void fromPixel (Double& fluxRatio, const Vector<Double>& parameters, const Unit& brightnessUnitIn, const Vector<Quantum<Double> >& restoringBeam, const CoordinateSystem& cSys, ComponentType::Shape componentShape, 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 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 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 Bool ok() const

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

static Unit defineBrightnessUnits (LogIO& os, const Unit& brightnessUnitIn, const DirectionCoordinate& dirCoord, const Vector<Quantum<Double> >& restoringBeam, Bool integralIsJy)

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

static void undefineBrightnessUnits ()

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

static Double convertToJy (const Unit& brightnessUnit)

Find the factor that converts whatever per whatevers (e.g. mJy per beam) to Jy per whatevers (e.g. Jy per beam)

static Quantum<Double> peakToIntegralFlux (const DirectionCoordinate& dirCoord, ComponentType::Shape componentShape, const Quantum<Double>& peakFlux, const Quantum<Double>& majorAxis, const Quantum<Double>& minorAxis, const Vector<Quantum<Double> >& restoringBeam)

Convert a peak flux density to integral flux density

static Quantum<Double> integralToPeakFlux (const DirectionCoordinate& dirCoord, ComponentType::Shape componentShape, const Quantum<Double>& integralFlux, const Unit& brightnessUnit, const Quantum<Double>& majorAxis, const Quantum<Double>& minorAxis, const Unit<Quantum<Double> >& restoringBeam)

Convert an integral flux density to peak flux density. The brightness unit of the output quantum (e.g. mJy/beam) is specified by brightnessUnit