casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
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 casa::RecordTransformable

List of all members.

Public Member Functions

 DiskShape ()
 The default GaussianShape is at the J2000 North Pole with a width of 1 arc-min on both axes.
 DiskShape (const MDirection &direction, const Quantum< Double > &majorAxis, const Quantum< Double > &minorAxis, const Quantum< Double > &positionAngle)
 Construct a disk shape centred in the specified direction, specifying the widths & position angle.
 DiskShape (const MDirection &direction, const Quantum< Double > &width, const Double axialRatio, const Quantum< Double > &positionAngle)
 DiskShape (const DiskShape &other)
 The copy constructor uses copy semantics.
virtual ~DiskShape ()
 The destructor does nothing special.
DiskShapeoperator= (const DiskShape &other)
 The assignment operator uses copy semantics.
virtual ComponentType::Shape type () const
 get the type of the shape.
virtual void setWidthInRad (const Double majorAxis, const Double minorAxis, const Double positionAngle)
 set or return the width and orientation of the disk.
virtual Double majorAxisInRad () const
virtual Double minorAxisInRad () const
virtual Double positionAngleInRad () const
virtual Double sample (const MDirection &direction, const MVAngle &pixelLatSize, const MVAngle &pixelLongSize) const
 Calculate the proportion of the flux that is in a pixel of specified size centered in the specified direction.
virtual void sample (Vector< Double > &scale, const Vector< MDirection::MVType > &directions, const MDirection::Ref &refFrame, const MVAngle &pixelLatSize, const MVAngle &pixelLongSize) const
 Same as the previous function except that many directions can be sampled at once.
virtual DComplex visibility (const Vector< Double > &uvw, const Double &frequency) const
 Return the Fourier transform of the component at the specified point in the spatial frequency domain.
virtual void visibility (Vector< DComplex > &scale, const Matrix< Double > &uvw, const Double &frequency) const
 Same as the previous function except that many (u,v,w) points can be sampled at once.
virtual void visibility (Matrix< DComplex > &scale, const Matrix< Double > &uvw, const Vector< Double > &frequency) const
 same as above except with many frequencies
virtual ComponentShapeclone () const
 Return a pointer to a copy of this object upcast to a ComponentShape object.
virtual Bool ok () const
 Function which checks the internal data of this class for correct dimensionality and consistent values.
virtual const ComponentShapegetPtr () const
 return a pointer to this object.
virtual String sizeToString () const
 Get the string containing the various size quantities of a component.

Private Member Functions

Double calcSample (const MDirection::MVType &compDirValue, const MDirection::MVType &dirVal, const Double majRad, const Double minRad, const Double pixValue) const
Double calcVis (Double u, Double v, const Double factor) const

Static Private Member Functions

static void rotateVis (Double &u, Double &v, const Double cpa, const Double spa)

Private Attributes

Double itsMajValue
Double itsMinValue
Double itsPaValue
Double itsHeight

Detailed Description

A disk model for the spatial distribution of emission.

Intended use:

Public interface

 <h3>Review Status</h3><dl><dt>Date Reviewed:<dd>yyyy/mm/dd<dt>Test programs:<dd>tDiskShape<dt>Demo programs:<dd>dTwoSidedShape</dl> 

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 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.
      Quantity clk_time; MVTime::read(clk_time, "01-10-2000/12:59");
      MEpoch obs_epoch(clk_time, MEpoch::UTC);
      MeasFrame obs_frame(obs_epoch);
      MDirection jupiter_dir(MVDirection(0), 
                             MDirection::Ref(MDirection::JUPITER, obs_frame));
      DiskShape jupiter_shape;
      jupiter_shape.setRefDirection(jupiter_dir);
      jupiter_shape.setWidth(Quantity(4,"arcmin"), Quantity(3.9,"arcmin"),
                             Quantity(3, "deg"));
      printShape(jupiter_shape);
      MDirection sample_dir(MVDirection(1.218, 0.37), MDirection::J2000);
      if (jupiter_shape.sample(sample_dir, 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 145 of file DiskShape.h.


Constructor & Destructor Documentation

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

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

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

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

The copy constructor uses copy semantics.

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

The destructor does nothing special.


Member Function Documentation

Double casa::DiskShape::calcSample ( const MDirection::MVType compDirValue,
const MDirection::MVType dirVal,
const Double  majRad,
const Double  minRad,
const Double  pixValue 
) const [private]
Double casa::DiskShape::calcVis ( Double  u,
Double  v,
const Double  factor 
) const [private]
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 Double casa::DiskShape::majorAxisInRad ( ) const [virtual]

Implements casa::TwoSidedShape.

virtual Double casa::DiskShape::minorAxisInRad ( ) const [virtual]

Implements casa::TwoSidedShape.

virtual Bool casa::DiskShape::ok ( ) const [virtual]

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 Double casa::DiskShape::positionAngleInRad ( ) const [virtual]

Implements casa::TwoSidedShape.

static void casa::DiskShape::rotateVis ( Double u,
Double v,
const Double  cpa,
const Double  spa 
) [static, private]
virtual Double casa::DiskShape::sample ( const MDirection direction,
const MVAngle pixelLatSize,
const 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 ( Vector< Double > &  scale,
const Vector< MDirection::MVType > &  directions,
const MDirection::Ref refFrame,
const MVAngle pixelLatSize,
const 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 Double  majorAxis,
const Double  minorAxis,
const 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 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 DComplex casa::DiskShape::visibility ( const Vector< Double > &  uvw,
const 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 ( Vector< DComplex > &  scale,
const Matrix< Double > &  uvw,
const Double frequency 
) const [virtual]

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

The uvw 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 ( Matrix< DComplex > &  scale,
const Matrix< Double > &  uvw,
const Vector< Double > &  frequency 
) const [virtual]

same as above except with many frequencies

Implements casa::TwoSidedShape.


Member Data Documentation

Definition at line 258 of file DiskShape.h.

Definition at line 255 of file DiskShape.h.

Definition at line 256 of file DiskShape.h.

Definition at line 257 of file DiskShape.h.


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