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

A disk model for the spatial distribution of emission. More...

#include <DiskShape.h>

Inheritance diagram for casa::DiskShape:
casa::TwoSidedShape casa::ComponentShape casacore::RecordTransformable

Public Member Functions

 DiskShape ()
 The default GaussianShape is at the J2000 North Pole with a width of 1 arc-min on both axes. More...
 
 DiskShape (const casacore::MDirection &direction, const casacore::Quantum< casacore::Double > &majorAxis, const casacore::Quantum< casacore::Double > &minorAxis, const casacore::Quantum< casacore::Double > &positionAngle)
 Construct a disk shape centred in the specified direction, specifying the widths & position angle. More...
 
 DiskShape (const casacore::MDirection &direction, const casacore::Quantum< casacore::Double > &width, const casacore::Double axialRatio, const casacore::Quantum< casacore::Double > &positionAngle)
 
 DiskShape (const DiskShape &other)
 The copy constructor uses copy semantics. More...
 
virtual ~DiskShape ()
 The destructor does nothing special. More...
 
DiskShapeoperator= (const DiskShape &other)
 The assignment operator uses copy semantics. More...
 
virtual ComponentType::Shape type () const
 get the type of the shape. More...
 
virtual void setWidthInRad (const casacore::Double majorAxis, const casacore::Double minorAxis, const casacore::Double positionAngle)
 set or return the width and orientation of the disk. More...
 
virtual casacore::Double majorAxisInRad () const
 
virtual casacore::Double minorAxisInRad () const
 
virtual casacore::Double positionAngleInRad () const
 
virtual casacore::Double sample (const casacore::MDirection &direction, const casacore::MVAngle &pixelLatSize, const casacore::MVAngle &pixelLongSize) const
 Calculate the proportion of the flux that is in a pixel of specified size centered in the specified direction. More...
 
virtual void sample (casacore::Vector< casacore::Double > &scale, const casacore::Vector< casacore::MDirection::MVType > &directions, const casacore::MDirection::Ref &refFrame, const casacore::MVAngle &pixelLatSize, const casacore::MVAngle &pixelLongSize) const
 Same as the previous function except that many directions can be sampled at once. More...
 
virtual casacore::DComplex visibility (const casacore::Vector< casacore::Double > &uvw, const casacore::Double &frequency) const
 Return the Fourier transform of the component at the specified point in the spatial frequency domain. More...
 
virtual void visibility (casacore::Vector< casacore::DComplex > &scale, const casacore::Matrix< casacore::Double > &uvw, const casacore::Double &frequency) const
 Same as the previous function except that many (u,v,w) points can be sampled at once. More...
 
virtual void visibility (casacore::Matrix< casacore::DComplex > &scale, const casacore::Matrix< casacore::Double > &uvw, const casacore::Vector< casacore::Double > &frequency) const
 same as above except with many frequencies More...
 
virtual ComponentShapeclone () const
 Return a pointer to a copy of this object upcast to a ComponentShape object. More...
 
virtual casacore::Bool ok () const
 casacore::Function which checks the internal data of this class for correct dimensionality and consistent values. More...
 
virtual const ComponentShapegetPtr () const
 return a pointer to this object. More...
 
virtual casacore::String sizeToString () const
 Get the string containing the various size quantities of a component. More...
 
- Public Member Functions inherited from casa::TwoSidedShape
virtual ~TwoSidedShape ()
 a virtual destructor is needed so that the actual destructor in the derived class will be used. More...
 
void setWidth (const casacore::Quantum< casacore::Double > &majorAxis, const casacore::Quantum< casacore::Double > &minorAxis, const casacore::Quantum< casacore::Double > &positionAngle)
 set/get the width and orientation of the Shape. More...
 
void setWidth (const casacore::Quantum< casacore::Double > &majorAxis, const casacore::Double axialRatio, const casacore::Quantum< casacore::Double > &positionAngle)
 
casacore::Quantum
< casacore::Double
majorAxis () const
 
casacore::Quantum
< casacore::Double
minorAxis () const
 
casacore::Quantum
< casacore::Double
positionAngle () const
 
casacore::Double axialRatio () const
 
void setErrors (const casacore::Quantum< casacore::Double > &majorAxisError, const casacore::Quantum< casacore::Double > &minorAxisError, const casacore::Quantum< casacore::Double > &positionAngleError)
 set/get the errors on the shape parameters. More...
 
const casacore::Quantum
< casacore::Double > & 
majorAxisError () const
 
const casacore::Quantum
< casacore::Double > & 
minorAxisError () const
 
const casacore::Quantum
< casacore::Double > & 
positionAngleError () const
 
casacore::Double axialRatioError () const
 
virtual casacore::Bool isSymmetric () const
 determine whether the shape is symmetric or not. More...
 
virtual casacore::uInt nParameters () const
 set/get the shape parameters associated with this shape. More...
 
virtual void setParameters (const casacore::Vector< casacore::Double > &newParms)
 
virtual casacore::Vector
< casacore::Double
parameters () const
 
virtual void setErrors (const casacore::Vector< casacore::Double > &newParms)
 
virtual casacore::Vector
< casacore::Double
errors () const
 
virtual casacore::Vector
< casacore::Double
optParameters () const
 
virtual void setOptParameters (const casacore::Vector< casacore::Double > &newOptParms)
 
virtual casacore::Bool fromRecord (casacore::String &errorMessage, const casacore::RecordInterface &record)
 This functions convert between a casacore::Record and a shape derived from this class. More...
 
virtual casacore::Bool toRecord (casacore::String &errorMessage, casacore::RecordInterface &record) const
 Convert the class to an Record representation. More...
 
virtual casacore::Bool convertUnit (casacore::String &errorMessage, const casacore::RecordInterface &record)
 Convert the parameters of the component to the specified units. More...
 
virtual casacore::Vector
< casacore::Double
toPixel (const casacore::DirectionCoordinate &dirCoord) const
 Convert component shape to absolute pixels (longitude, latitude, major axis, minor axis, position angle [positive +x -> +y ; rad]) More...
 
virtual casacore::Bool fromPixel (const casacore::Vector< casacore::Double > &parameters, const casacore::DirectionCoordinate &dirCoord)
 Fill the shape from the vector (longitude, latitude, major axis, minor axis, position angle [positive +x -> +y ; rad]). More...
 
- Public Member Functions inherited from casa::ComponentShape
virtual ~ComponentShape ()
 
virtual const casacore::Stringident () const
 Specify the identification of the record (e.g. More...
 
void setRefDirection (const casacore::MDirection &newRefDir)
 
const casacore::MDirectionrefDirection () const
 
void setRefDirectionError (const casacore::Quantum< casacore::Double > &newRefDirErrLat, const casacore::Quantum< casacore::Double > &newRefDirErrLong)
 
const casacore::Quantum
< casacore::Double > & 
refDirectionErrorLat () const
 
const casacore::Quantum
< casacore::Double > & 
refDirectionErrorLong () const
 
void copyDirectionInfo (const ComponentShape &that)
 
- 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...
 

Private Member Functions

casacore::Double _area () const
 area of disk More...
 
casacore::Double _calcSample (const casacore::MDirection::MVType &compDirValue, const casacore::MDirection::MVType &dirVal, const casacore::Double majRad, const casacore::Double minRad, const casacore::Double pixValue) const
 
casacore::Double _calcVis (casacore::Double u, casacore::Double v, const casacore::Double factor) const
 

Static Private Member Functions

static void _rotateVis (casacore::Double &u, casacore::Double &v, const casacore::Double cpa, const casacore::Double spa)
 

Private Attributes

casacore::Double _majorAxis
 The parameters of the disk. More...
 
casacore::Double _minorAxis
 
casacore::Double _pa
 
casacore::Double _recipArea
 

Additional Inherited Members

- Static Public Member Functions inherited from casa::TwoSidedShape
static casacore::String sizeToString (casacore::Quantity major, casacore::Quantity minor, casacore::Quantity posangle, casacore::Bool includeUncertainties=true, casacore::Quantity majorErr=0, casacore::Quantity minorErr=0, casacore::Quantity posanErr=0)
 casacore::Format the string containing the various size quantities of a component. More...
 
- Static Public Member Functions inherited from casa::ComponentShape
static ComponentType::Shape getType (casacore::String &errorMessage, const casacore::RecordInterface &record)
 
- Protected Member Functions inherited from casa::TwoSidedShape
 TwoSidedShape ()
 The constructors and assignment operator are protected as only derived classes should use them. More...
 
 TwoSidedShape (const casacore::MDirection &direction, const casacore::Unit &majorAxisUnit, const casacore::Unit &minorAxisUnit, const casacore::Unit &paUnit)
 
 TwoSidedShape (const TwoSidedShape &other)
 
TwoSidedShapeoperator= (const TwoSidedShape &other)
 
- Protected Member Functions inherited from casa::ComponentShape
 ComponentShape ()
 
 ComponentShape (const casacore::MDirection &direction)
 
 ComponentShape (const ComponentShape &other)
 
ComponentShapeoperator= (const ComponentShape &other)
 
- Static Protected Member Functions inherited from casa::ComponentShape
static casacore::Bool differentRefs (const casacore::MeasRef< casacore::MDirection > &ref1, const casacore::MeasRef< casacore::MDirection > &ref2)
 
static casacore::Bool badError (const casacore::Quantum< casacore::Double > &quantum)
 
static casacore::Bool fromAngQRecord (casacore::Quantum< casacore::Double > &returnValue, casacore::String &errorMessage, const casacore::String &fieldString, const casacore::RecordInterface &record)
 

Detailed Description

A disk model for the spatial distribution of emission.

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd
Test programs:
tDiskShape
Demo programs:
dTwoSidedShape

Prerequisite

Synopsis

A DiskShape models the spatial distribution of radiation from the sky as a using a uniform brightness elliptical disk with user specified major axis width, minor axis width and position angle.

This class like the other component shapes becomes more useful when used through the SkyComponent class, which incorperates the flux and spectral variation of the emission, or through the ComponentList class, which handles groups of SkyComponent objects.

The reference direction is defined in celestial co-ordinates, using a MDirection object. It indicates where the centre of the disk is on the sky. The direction can be specified both in the constructor or with the setRefDirection function.

The width of the disk is defined as the angular diameter along the specified axis. The major axis has the larger width and is aligned North-South when the position angle is zero. A positive position angle moves the Northern side of the disk to the East. The axial ratio is the ratio of the minor to major axis widths. The major axis MUST not be smaller than the minor axis otherwise an casacore::AipsError is thrown.

These parameters of the disk (width, position angle, direction etc.) can be specified at construction time, using the *inRad functions or through functions, in the base classes. The base classes also implement functions for inter-converting this object into a record representation.

The flux, or integrated intensity, is always normalised to one. This class does not model the actual flux or its variation with frequency. It solely models the way the emission varies with position on the sky.

The sample member function is used to sample the component at any point on the sky. The scale factor calculated by this function is the proportion of the flux that is within a specified pixel size centered on the specified direction. This is not accurate for pixels which are partially covered by the disk. Ultimately this function will integrate the emission from the disk over the entire pixel but currently the returned flux will be either zero or a constant value with the returned value depending on whether the centre of the pixel in within the disk or not. This inaccuracy becomes more important when the pixel size become large compared to the disk width.

This class contains functions that return the Fourier transform of the disk at a specified spatial frequency. There are described more fully in the description of the visibility functions below.

Example

Shown below is code to construct a disk shaped model whose direction is always centred on the disk of Jupiter. Note that it is necessary to specify the observation time in order for the DiskShape class to be able to do the conversion into J2000 coordinates. This example is also available in the dTwoSidedShape.cc file.

{ // construct a model for Jupiter.
casacore::Quantity clk_time; casacore::MVTime::read(clk_time, "01-10-2000/12:59");
casacore::MeasFrame obs_frame(obs_epoch);
DiskShape jupiter_shape;
jupiter_shape.setRefDirection(jupiter_dir);
jupiter_shape.setWidth(casacore::Quantity(4,"arcmin"), casacore::Quantity(3.9,"arcmin"),
casacore::Quantity(3, "deg"));
printShape(jupiter_shape);
if (jupiter_shape.sample(sample_dir, casacore::MVAngle(0.1)) > 0.0) {
cout << "The position in J2000 coordinates is near: "
<< sample_dir.getAngle("deg") << endl;
}
}

The printShape function is the example shown for the TwoSidedShape class.

To Do

Definition at line 149 of file DiskShape.h.

Constructor & Destructor Documentation

casa::DiskShape::DiskShape ( )

The default GaussianShape is at the J2000 North Pole with a width of 1 arc-min on both axes.

casa::DiskShape::DiskShape ( const casacore::MDirection direction,
const casacore::Quantum< casacore::Double > &  majorAxis,
const casacore::Quantum< casacore::Double > &  minorAxis,
const casacore::Quantum< casacore::Double > &  positionAngle 
)

Construct a disk shape centred in the specified direction, specifying the widths & position angle.

casa::DiskShape::DiskShape ( const casacore::MDirection direction,
const casacore::Quantum< casacore::Double > &  width,
const casacore::Double  axialRatio,
const casacore::Quantum< casacore::Double > &  positionAngle 
)
casa::DiskShape::DiskShape ( const DiskShape other)

The copy constructor uses copy semantics.

virtual casa::DiskShape::~DiskShape ( )
virtual

The destructor does nothing special.

Member Function Documentation

casacore::Double casa::DiskShape::_area ( ) const
private

area of disk

casacore::Double casa::DiskShape::_calcSample ( const casacore::MDirection::MVType compDirValue,
const casacore::MDirection::MVType dirVal,
const casacore::Double  majRad,
const casacore::Double  minRad,
const casacore::Double  pixValue 
) const
private
casacore::Double casa::DiskShape::_calcVis ( casacore::Double  u,
casacore::Double  v,
const casacore::Double  factor 
) const
private
static void casa::DiskShape::_rotateVis ( casacore::Double u,
casacore::Double v,
const casacore::Double  cpa,
const casacore::Double  spa 
)
staticprivate
virtual ComponentShape* casa::DiskShape::clone ( ) const
virtual

Return a pointer to a copy of this object upcast to a ComponentShape object.

The class that uses this function is responsible for deleting the pointer. This is used to implement a virtual copy constructor.

Implements casa::TwoSidedShape.

virtual const ComponentShape* casa::DiskShape::getPtr ( ) const
virtual

return a pointer to this object.

Implements casa::ComponentShape.

virtual casacore::Double casa::DiskShape::majorAxisInRad ( ) const
virtual

Implements casa::TwoSidedShape.

virtual casacore::Double casa::DiskShape::minorAxisInRad ( ) const
virtual

Implements casa::TwoSidedShape.

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

casacore::Function which checks the internal data of this class for correct dimensionality and consistent values.

Returns true if everything is fine otherwise returns false.

Reimplemented from casa::TwoSidedShape.

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

The assignment operator uses copy semantics.

virtual casacore::Double casa::DiskShape::positionAngleInRad ( ) const
virtual

Implements casa::TwoSidedShape.

virtual casacore::Double casa::DiskShape::sample ( const casacore::MDirection direction,
const casacore::MVAngle pixelLatSize,
const casacore::MVAngle pixelLongSize 
) const
virtual

Calculate the proportion of the flux that is in a pixel of specified size centered in the specified direction.

The returned value will always be between zero and one (inclusive).

Implements casa::TwoSidedShape.

virtual void casa::DiskShape::sample ( casacore::Vector< casacore::Double > &  scale,
const casacore::Vector< casacore::MDirection::MVType > &  directions,
const casacore::MDirection::Ref refFrame,
const casacore::MVAngle pixelLatSize,
const casacore::MVAngle pixelLongSize 
) const
virtual

Same as the previous function except that many directions can be sampled at once.

The reference frame and pixel size must be the same for all the specified directions.

Implements casa::TwoSidedShape.

virtual void casa::DiskShape::setWidthInRad ( const casacore::Double  majorAxis,
const casacore::Double  minorAxis,
const casacore::Double  positionAngle 
)
virtual

set or return the width and orientation of the disk.

All numerical values are in radians. There are also functions in the base class for doing this with other angular units.

Implements casa::TwoSidedShape.

virtual casacore::String casa::DiskShape::sizeToString ( ) const
virtual

Get the string containing the various size quantities of a component.

Implements casa::TwoSidedShape.

virtual ComponentType::Shape casa::DiskShape::type ( ) const
virtual

get the type of the shape.

This function always returns ComponentType::DISK.

Implements casa::TwoSidedShape.

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

Return the Fourier transform of the component at the specified point in the spatial frequency domain.

The point is specified by a 3 element vector (u,v,w) that has units of meters and the frequency of the observation, in Hertz. These two quantities can be used to derive the required spatial frequency (s = uvw*freq/c). The w component is not used in these functions.

The reference position for the transform is the direction of the component. As this component is symmetric about this point the transform is always a real value.

Implements casa::TwoSidedShape.

virtual void casa::DiskShape::visibility ( casacore::Vector< casacore::DComplex > &  scale,
const casacore::Matrix< casacore::Double > &  uvw,
const casacore::Double frequency 
) const
virtual

Same as the previous function except that many (u,v,w) points can be sampled at once.

The uvw casacore::Matrix must have a first dimension of three, and a second dimension that is the same as the length of the scale Vector. Otherwise and exception is thrown (when compiled in debug mode).

Implements casa::TwoSidedShape.

virtual void casa::DiskShape::visibility ( casacore::Matrix< casacore::DComplex > &  scale,
const casacore::Matrix< casacore::Double > &  uvw,
const casacore::Vector< casacore::Double > &  frequency 
) const
virtual

same as above except with many frequencies

Implements casa::TwoSidedShape.

Member Data Documentation

casacore::Double casa::DiskShape::_majorAxis
private

The parameters of the disk.

Definition at line 290 of file DiskShape.h.

casacore::Double casa::DiskShape::_minorAxis
private

Definition at line 291 of file DiskShape.h.

casacore::Double casa::DiskShape::_pa
private

Definition at line 292 of file DiskShape.h.

casacore::Double casa::DiskShape::_recipArea
private

Definition at line 293 of file DiskShape.h.


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