DiskShape.h

Classes

DiskShape -- A disk model for the spatial distribution of emission (full description)

class DiskShape: public TwoSidedShape

Interface

Public Members
DiskShape()
DiskShape(const MDirection& direction, const Quantum<Double>& majorAxis, const Quantum<Double>& minorAxis, const Quantum<Double>& positionAngle)
DiskShape(const MDirection& direction, const Quantum<Double>& width, const Double axialRatio, const Quantum<Double>& positionAngle)
DiskShape(const DiskShape& other)
virtual ~DiskShape()
DiskShape& operator=(const DiskShape& other)
virtual ComponentType::Shape type() const
virtual void setWidthInRad(const Double majorAxis, const Double minorAxis, const Double positionAngle)
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
virtual void sample(Vector<Double>& scale, const Vector<MDirection::MVType>& directions, const MDirection::Ref& refFrame, const Ref& pixelLatSize, const Ref& pixelLongSize) const
virtual DComplex visibility(const Vector<Double>& uvw, const Double& frequency) const
virtual void visibility(Vector<DComplex>& scale, const Matrix<Double>& uvw, const Double& frequency) const
virtual ComponentShape* clone() const
virtual Bool ok() const
Private Members
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 void rotateVis(Double& u, Double& v, const Double cpa, const Double spa)
See Also
GaussianShape - a Gaussian variation in the sky brightness
PointShape - a shape where emission comes from only one direction

Description

Review Status

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

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

Member Description

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)
DiskShape(const MDirection& direction, const Quantum<Double>& width, const Double axialRatio, const Quantum<Double>& positionAngle)

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

DiskShape(const DiskShape& other)

The copy constructor uses copy semantics.

virtual ~DiskShape()

The destructor does nothing special.

DiskShape& operator=(const DiskShape& other)

The assignment operator uses copy semantics.

virtual ComponentType::Shape type() const

get the type of the shape. This function always returns ComponentType::DISK.

virtual void setWidthInRad(const Double majorAxis, const Double minorAxis, const Double positionAngle)
virtual Double majorAxisInRad() const
virtual Double minorAxisInRad() const
virtual Double positionAngleInRad() const

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.

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. The returned value will always be between zero and one (inclusive).

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

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.

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

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

virtual ComponentShape* clone() const

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.

virtual Bool ok() const

Function which checks the internal data of this class for correct dimensionality and consistent values. Returns True if everything is fine otherwise returns False.

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 void rotateVis(Double& u, Double& v, const Double cpa, const Double spa)