casa
5.7.0-16
|
A shape where emission comes from only one direction. More...
#include <PointShape.h>
Public Member Functions | |
PointShape () | |
The default PointShape is at the J2000 North Pole. More... | |
PointShape (const casacore::MDirection &direction) | |
Construct a point shape at the specified direction. More... | |
PointShape (const PointShape &other) | |
The copy constructor uses copy semantics. More... | |
virtual | ~PointShape () |
The destructor does nothing special. More... | |
PointShape & | operator= (const PointShape &other) |
The assignment operator uses copy semantics. More... | |
virtual ComponentType::Shape | type () const |
Return the type of shape. More... | |
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 the specified size centered on 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 casacore::Bool | isSymmetric () const |
A point shape is symmetric so this function always returns true;. More... | |
virtual ComponentShape * | clone () const |
Return a pointer to a copy of this object upcast to a ComponentShape object. More... | |
virtual casacore::uInt | nParameters () const |
return the number of parameters in this shape and set/get them. 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 PointShape. 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 &, const casacore::RecordInterface &) |
Convert the parameters of the component to the specified units. More... | |
virtual casacore::Bool | ok () const |
casacore::Function which checks the internal data of this class for consistent values. More... | |
virtual const ComponentShape * | getPtr () const |
return a pointer to this object. More... | |
virtual casacore::String | sizeToString () const |
Public Member Functions inherited from casa::ComponentShape | |
virtual | ~ComponentShape () |
virtual const casacore::String & | ident () const |
Specify the identification of the record (e.g. More... | |
void | setRefDirection (const casacore::MDirection &newRefDir) |
const casacore::MDirection & | refDirection () 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) |
virtual casacore::Vector < casacore::Double > | toPixel (const casacore::DirectionCoordinate &dirCoord) const |
virtual casacore::Bool | fromPixel (const casacore::Vector< casacore::Double > ¶meters, const casacore::DirectionCoordinate &dirCoord) |
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 | dirIsInPixel (casacore::Double longSize, casacore::Double latSize, casacore::Double nearSize, const casacore::MDirection::MVType &dirValue, const casacore::MDirection::MVType *compDirValue) const |
FInd out if a direction is located within a pixel. More... | |
Additional Inherited Members | |
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::ComponentShape | |
ComponentShape () | |
ComponentShape (const casacore::MDirection &direction) | |
ComponentShape (const ComponentShape &other) | |
ComponentShape & | operator= (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) |
A shape where emission comes from only one direction.
Public interface
This class represents the shape of components where the emission comes from only one point in the sky.
This class like the other component shapes becomes more useful when used through the SkyComponent class, which incorporates the flux and spectral variation of the emission, or through the ComponentList class, which handles groups of SkyComponent objects.
For a point shape all the emission comes only from the reference direction which is specified in celestial co-ordinates, using a MDirection object. The direction can be specified both in the constructor or with the setRefDirection
function.
The sample
member functions are used to determine the proportion of flux the component at any point on the sky. For a point component this is either zero or one depending on whether the specified pixel contains the point source or not.
The visibility
functions return the Fourier transform of the component at a specified spatial frequency. For a point shape the Fourier transform is a constant value. Hence these functions return one, regardless of the input parameters.
This class also contains functions (toRecord
& fromRecord
) which perform the conversion between Records and PointShape objects. These functions define how a PointShape object is represented in glish. The format of the record that is generated and accepted by these functions is:
The direction field contains a record representation of a direction measure and its format is defined in the Measures module. Its refer field defines the reference frame for the direction and the m0 and m1 fields define the latitude and longitude in that frame.
Suppose I had an image of a region of the sky and we wanted to subtract a point source from it. This could be done as follows:
Shown below is the code to perform the first step in this process, ie construct the SkyComponent. This example is also available in the dPointShape.cc
file. Note that it is more accurate to do subtraction of point components in the (u,v) domain
Note how the member functions of the PointShape class (the setDirection function) are accessable through the shape function in the SkyComponent class. The printShape function is the example shown for the ComponentShape class.
Definition at line 156 of file PointShape.h.
casa::PointShape::PointShape | ( | ) |
The default PointShape is at the J2000 North Pole.
casa::PointShape::PointShape | ( | const casacore::MDirection & | direction | ) |
Construct a point shape at the specified direction.
casa::PointShape::PointShape | ( | const PointShape & | other | ) |
The copy constructor uses copy semantics.
|
virtual |
The destructor does nothing special.
|
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::ComponentShape.
|
virtual |
Convert the parameters of the component to the specified units.
As a point component has no parameters this function does nothing and always returns true.
Implements casa::ComponentShape.
|
private |
FInd out if a direction is located within a pixel.
|
virtual |
Implements casa::ComponentShape.
|
virtual |
This functions convert between a casacore::Record and a PointShape.
These functions define how a point shape is represented in glish and this is detailed in the synopsis above. They return false if the supplied casacore::Record is malformed and append an error message to the supplied casacore::String giving the reason.
Implements casa::ComponentShape.
|
virtual |
return a pointer to this object.
Implements casa::ComponentShape.
|
virtual |
A point shape is symmetric so this function always returns true;.
Implements casa::ComponentShape.
|
virtual |
return the number of parameters in this shape and set/get them.
As this is a point shape there are none. So calling setParameters
or setErrors
with anything other than a zero length casacore::Vector will throw an exception (when compiled in debug mode). The nParameters
will always return zero and the parameters
and errors
functions will always return zero length Vectors.
Implements casa::ComponentShape.
|
virtual |
casacore::Function which checks the internal data of this class for consistent values.
Returns true if everything is fine otherwise returns false.
Reimplemented from casa::ComponentShape.
PointShape& casa::PointShape::operator= | ( | const PointShape & | other | ) |
The assignment operator uses copy semantics.
|
virtual |
Implements casa::ComponentShape.
|
virtual |
Implements casa::ComponentShape.
|
virtual |
Calculate the proportion of the flux that is in a pixel of the specified size centered on the specified direction.
Because this is a point shape the returned value is either zero or one. It is one if the specified direction is less than half a pixelSize away from the reference direction.
Implements casa::ComponentShape.
|
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. This is a customised version.
Implements casa::ComponentShape.
|
virtual |
Implements casa::ComponentShape.
|
virtual |
Implements casa::ComponentShape.
|
virtual |
Implements casa::ComponentShape.
|
virtual |
Implements casa::ComponentShape.
|
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::ComponentShape.
|
virtual |
Return the type of shape.
This function always returns ComponentType::POINT.
Implements casa::ComponentShape.
|
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. Hence the returned value is always a constant real value of one. The input arguments are ignored except in debug mode where the length of the uvw casacore::Vector and sign of the frequency variable are checked.
Implements casa::ComponentShape.
|
virtual |
Same as the previous function except that many (u,v,w) points can be sampled at once.
As with the previous function the returned value is always a constant real vector of one. The input arguments are ignored except in debug mode where the shape of the uvw casacore::Matrix and the scale casacore::Vector are checked as is the sign of the frequency variable.
Implements casa::ComponentShape.
|
virtual |
Same as above except with many frequencies.
Implements casa::ComponentShape.