casa
5.7.0-16
|
A component of a model of the sky. More...
#include <SkyComponent.h>
Public Member Functions | |
SkyComponent () | |
The default SkyComponent is a point source with a constant spectrum. More... | |
SkyComponent (const ComponentType::Shape &shape) | |
Construct a SkyCompRep of the specified shape. More... | |
SkyComponent (const ComponentType::Shape &shape, const ComponentType::SpectralShape &spectralModel) | |
Construct a SkyCompRep with the user specified model for the shape and spectrum. More... | |
SkyComponent (const Flux< casacore::Double > &flux, const ComponentShape &shape, const SpectralModel &spectrum) | |
Construct a SkyComponent with a fully specified model for the shape, spectrum and flux. More... | |
SkyComponent (const SkyComponent &other) | |
The copy Constructor uses reference semantics. More... | |
virtual | ~SkyComponent () |
the destructor does nothing obvious (its all done by the casacore::CountedPtr) More... | |
SkyComponent & | operator= (const SkyComponent &other) |
The assignment operator uses reference semantics. More... | |
virtual Flux< casacore::Double > & | flux () |
See the corresponding functions in the SkyCompBase class for a description of these functions. More... | |
virtual const Flux < casacore::Double > & | flux () const |
return a reference to the flux of the component. More... | |
virtual const ComponentShape & | shape () const |
See the corresponding functions in the SkyCompBase class for a description of these functions. More... | |
virtual ComponentShape & | shape () |
virtual void | setShape (const ComponentShape &newShape) |
virtual const SpectralModel & | spectrum () const |
See the corresponding functions in the SkyCompBase class for a description of these functions. More... | |
virtual SpectralModel & | spectrum () |
virtual void | setSpectrum (const SpectralModel &newSpectrum) |
virtual casacore::String & | label () |
See the corresponding functions in the SkyCompBase class for a description of these functions. More... | |
virtual const casacore::String & | label () 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::Double > | sample (const casacore::MDirection &direction, const casacore::MVAngle &pixelLatSize, const casacore::MVAngle &pixelLongSize, const casacore::MFrequency ¢erFrequency) const |
See the corresponding functions 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::Double > | visibility (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... | |
SkyComponent | copy () const |
Return a distinct copy of this component. More... | |
casacore::Bool | ok () const |
See the corresponding functions in the SkyCompBase class for a description of this function. More... | |
casacore::Vector < casacore::Double > | toPixel (const casacore::Unit &brightnessUnitIn, const casacore::GaussianBeam &restoringBeam, const casacore::CoordinateSystem &cSys, casacore::Stokes::StokesTypes stokes) const |
Convert from and to pixel vectors. More... | |
void | fromPixel (casacore::Double &fluxRatio, const casacore::Vector< casacore::Double > ¶meters, const casacore::Unit &brightnessUnitIn, const casacore::GaussianBeam &restoringBeam, const casacore::CoordinateSystem &cSys, ComponentType::Shape componentShape, casacore::Stokes::StokesTypes stokes) |
virtual casacore::String | summarize (const casacore::DirectionCoordinate *const &dc=0, casacore::Bool longErrOnGreatCircle=false) const |
Get a nicely formatted string summarizing the component. More... | |
casacore::String | positionToString (std::shared_ptr< casacore::Vector< casacore::Double >> &pixelCoords, const casacore::DirectionCoordinate *const &dc=nullptr, casacore::Bool longErrOnGreatCircle=false) const |
If the dc parameter is specified, also return the corresponding world coordinates, and the pixel coordinates will be returned in the pixelCoords parameter (otherwise it is set to nullptr). 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 String & | ident () const |
Specify the identification of the record (e.g. More... | |
Static Private Member Functions | |
static std::pair < casacore::String, casacore::String > | _axisLabels (const casacore::DirectionCoordinate *const &dc) |
Private Attributes | |
casacore::CountedPtr< SkyCompRep > | itsCompPtr |
A component of a model of the sky.
Public interface
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 SkyComponent 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 reference semantics for both the copy constructor and the assignment operator. Becuase of this the only way to make a true copy of a SkyComponent is to use the copy
member function.
These examples are coded in the tSkyCompRep.h file.
In this example a SkyCompRep object is created and used to calculate the ...
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.
Definition at line 130 of file SkyComponent.h.
casa::SkyComponent::SkyComponent | ( | ) |
The default SkyComponent 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::SkyComponent::SkyComponent | ( | 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.
casa::SkyComponent::SkyComponent | ( | const ComponentType::Shape & | shape, |
const ComponentType::SpectralShape & | spectralModel | ||
) |
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
casa::SkyComponent::SkyComponent | ( | const Flux< casacore::Double > & | flux, |
const ComponentShape & | shape, | ||
const SpectralModel & | spectrum | ||
) |
Construct a SkyComponent with a fully specified model for the shape, spectrum and flux.
casa::SkyComponent::SkyComponent | ( | const SkyComponent & | other | ) |
The copy Constructor uses reference semantics.
|
virtual |
the destructor does nothing obvious (its all done by the casacore::CountedPtr)
|
staticprivate |
SkyComponent casa::SkyComponent::copy | ( | ) | const |
Return a distinct copy of this component.
As both the assignment operator and the copy constructor use reference semantics this is the only way to get a real copy.
|
virtual |
See the corresponding functions in the SkyCompBase class for a description of these functions.
Implements casa::SkyCompBase.
|
virtual |
return a reference to the flux of the component.
Because this is a reference, manipulation of the flux values is performed through the functions in the Flux class. eg., comp.flux().setValue(newVal)
. If the component flux varies with frequency then the flux set using this function is the value at the reference frequency.
Implements casa::SkyCompBase.
void casa::SkyComponent::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 | ||
) |
|
virtual |
See the corresponding functions in the SkyCompBase class for a description of these functions.
Implements casa::SkyCompBase.
|
virtual |
See the corresponding function in the SkyCompBase class for a description of this function.
Implements casa::SkyCompBase.
|
virtual |
See the corresponding functions in the SkyCompBase class for a description of these functions.
Implements casa::SkyCompBase.
|
virtual |
Implements casa::SkyCompBase.
|
virtual |
See the corresponding functions in the SkyCompBase class for a description of this function.
Implements casa::SkyCompBase.
SkyComponent& casa::SkyComponent::operator= | ( | const SkyComponent & | other | ) |
The assignment operator uses reference semantics.
|
virtual |
See the corresponding functions in the SkyCompBase class for a description of these functions.
Implements casa::SkyCompBase.
|
virtual |
Implements casa::SkyCompBase.
casacore::String casa::SkyComponent::positionToString | ( | std::shared_ptr< casacore::Vector< casacore::Double >> & | pixelCoords, |
const casacore::DirectionCoordinate *const & | dc = nullptr , |
||
casacore::Bool | longErrOnGreatCircle = false |
||
) | const |
If the dc
parameter is specified, also return the corresponding world coordinates, and the pixel coordinates will be returned in the pixelCoords
parameter (otherwise it is set to nullptr).
If longErrOnGreatCircle is true, the longitude error is interpreted as lying along the great circle that is tangent to the center position, rather than along the circle of constant latitude. In this case, the longitude error presented as a time has been multiplied by 1/cos(latitude), but the associated angle reported as an angular measure will not have this factor applied to it, nor will the error reported in pixels.
|
virtual |
See the corresponding functions in the SkyCompBase class for a description of this function.
Implements casa::SkyCompBase.
|
virtual |
See the corresponding function in the SkyCompBase class for a description of this function.
Implements casa::SkyCompBase.
|
virtual |
Implements casa::SkyCompBase.
|
virtual |
Implements casa::SkyCompBase.
|
virtual |
See the corresponding functions in the SkyCompBase class for a description of these functions.
Implements casa::SkyCompBase.
|
virtual |
Implements casa::SkyCompBase.
|
virtual |
See the corresponding functions in the SkyCompBase class for a description of these functions.
Implements casa::SkyCompBase.
|
virtual |
Implements casa::SkyCompBase.
|
virtual |
Get a nicely formatted string summarizing the component.
If longErrOnGreatCircle is true, the longitude error is interpreted as lying along the great circle that is tangent to the center position, rather than along the circle of constant longitude. In this case, the longitude error presented as a time has been multiplied by 1/cos(latitude), but the associated angle reported as an angular measure will not have this factor applied to it, nor will the error reported in pixels.
casacore::Vector<casacore::Double> casa::SkyComponent::toPixel | ( | const casacore::Unit & | brightnessUnitIn, |
const casacore::GaussianBeam & | restoringBeam, | ||
const casacore::CoordinateSystem & | cSys, | ||
casacore::Stokes::StokesTypes | stokes | ||
) | const |
Convert from and to pixel vectors.
See the SkyCompRep class for details.
|
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.
|
virtual |
See the corresponding function in the SkyCompBase class for a description of this function.
Implements casa::SkyCompBase.
|
virtual |
See the corresponding function in the SkyCompBase class for a description of this function.
Implements casa::SkyCompBase.
|
private |
Definition at line 304 of file SkyComponent.h.