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

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

#include <SkyCompRep.h>

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

List of all members.

Public Member Functions

 SkyCompRep ()
 The default SkyCompRep is a point source with a constant spectrum.
 SkyCompRep (const ComponentType::Shape &shape)
 Construct a SkyCompRep of the specified shape.
 SkyCompRep (const ComponentType::Shape &shape, const ComponentType::SpectralShape &spectrum)
 Construct a SkyCompRep with the user specified model for the shape and spectrum.
 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.
SkyCompRepoperator= (const SkyCompRep &other)
 The assignment operator uses copy semantics.
virtual const Flux< Double > & flux () const
 See the corresponding functions in the SkyCompBase class for a description of these functions.
virtual Flux< Double > & flux ()
virtual const ComponentShapeshape () const
 See the corresponding functions in the SkyCompBase class for a description of these functions.
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.
virtual SpectralModelspectrum ()
virtual void setSpectrum (const SpectralModel &newSpectrum)
virtual Stringlabel ()
 See the corresponding functions in the SkyCompBase class for a description of these functions.
virtual const Stringlabel () const
virtual Vector< Double > & optionalParameters ()
 See the corresponding functions in the SkyCompBase class for a description of these functions.
virtual const Vector< Double > & optionalParameters () const
virtual Bool isPhysical () const
 See the corresponding function in the SkyCompBase class for a description of this function.
virtual Flux< Doublesample (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< Doublevisibility (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 Vector< 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)
 See the corresponding functions in the SkyCompBase class for a description of these functions.
virtual Bool toRecord (String &errorMessage, RecordInterface &record) const
 Convert the class to an Record representation.
Vector< DoubletoPixel (const Unit &brightnessUnitOut, const GaussianBeam &restoringBeam, const CoordinateSystem &cSys, Stokes::StokesTypes stokes) const
 Convert the SkyComponent to a vector of Doubles for the specified Stokes type (others are lost).
void fromPixel (Double &fluxRatio, const Vector< Double > &parameters, const Unit &brightnessUnitIn, const GaussianBeam &restoringBeam, const CoordinateSystem &cSys, ComponentType::Shape componentShape, Stokes::StokesTypes stokes)
 Take a vector Doubles and fill the SkyComponent from the values.
virtual Bool ok () const
 See the corresponding function in the SkyCompBase class for a description of this function.

Static Public Member Functions

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

Static Private Member Functions

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

Private Attributes

CountedPtr< ComponentShapeitsShapePtr
CountedPtr< SpectralModelitsSpectrumPtr
Flux< DoubleitsFlux
String itsLabel
Vector< DoubleitsOptParms

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 129 of file SkyCompRep.h.


Constructor & Destructor Documentation

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.

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

  • AipsError - if the shape is UNKNOWN_SHAPE or NUMBER_SHAPES

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

  • AipsError - if the shape is UNKNOWN_SHAPE or NUMBER_SHAPES
  • AipsError - if the spectrum is UNKNOWN_SPECTRAL_SHAPE or NUMBER_SPECTRAL_SHAPES
casa::SkyCompRep::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.

The copy constructor uses copy semantics.

virtual casa::SkyCompRep::~SkyCompRep ( ) [virtual]

The destructor does not appear to do much.


Member Function Documentation

static Double casa::SkyCompRep::convertToJy ( const 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 Unit casa::SkyCompRep::defineBrightnessUnits ( LogIO os,
const Unit brightnessUnitIn,
const DirectionCoordinate dirCoord,
const GaussianBeam restoringBeam,
const Bool  integralIsJy 
) [static, private]

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<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<Double>& casa::SkyCompRep::flux ( ) [virtual]

Implements casa::SkyCompBase.

void casa::SkyCompRep::fromPixel ( Double fluxRatio,
const Vector< Double > &  parameters,
const Unit brightnessUnitIn,
const GaussianBeam 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 casa::SkyCompRep::fromRecord ( String errorMessage,
const RecordInterface record 
) [virtual]

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

Implements casa::SkyCompBase.

static Quantity casa::SkyCompRep::integralToPeakFlux ( const DirectionCoordinate dirCoord,
const ComponentType::Shape  componentShape,
const Quantity integralFlux,
const Unit brightnessUnit,
const Quantity majorAxis,
const Quantity minorAxis,
const 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 Bool casa::SkyCompRep::isPhysical ( ) const [virtual]

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

Implements casa::SkyCompBase.

virtual String& casa::SkyCompRep::label ( ) [virtual]

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

Implements casa::SkyCompBase.

virtual const String& casa::SkyCompRep::label ( ) const [virtual]

Implements casa::SkyCompBase.

virtual 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.

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

Implements casa::SkyCompBase.

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

Implements casa::SkyCompBase.

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

Convert a peak flux density to integral flux density.

virtual Flux<Double> casa::SkyCompRep::sample ( const MDirection direction,
const MVAngle pixelLatSize,
const MVAngle pixelLongSize,
const 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 ( 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]

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.

Vector<Double> casa::SkyCompRep::toPixel ( const Unit brightnessUnitOut,
const GaussianBeam 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.

virtual Bool casa::SkyCompRep::toRecord ( String error,
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 ( ) [static, private]

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

virtual Flux<Double> casa::SkyCompRep::visibility ( const Vector< Double > &  uvw,
const 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 ( Cube< DComplex > &  visibilities,
const Matrix< Double > &  uvws,
const Vector< Double > &  frequencies 
) const [virtual]

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

Implements casa::SkyCompBase.


Member Data Documentation

Definition at line 339 of file SkyCompRep.h.

Definition at line 340 of file SkyCompRep.h.

Definition at line 341 of file SkyCompRep.h.

Definition at line 337 of file SkyCompRep.h.

Definition at line 338 of file SkyCompRep.h.


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