PCL
Astrometry Support Classes

This group of classes implement the core astrometry support on the PixInsight platform. More...

Classes

class  pcl::AstrometricMetadata
 Astrometric metadata. More...
 
class  pcl::GnomonicProjection
 Gnomonic projection system. More...
 
class  pcl::HammerAitoffProjection
 Hammer-Aitoff projection system. More...
 
class  pcl::LinearTransformation
 A linear geometric transformation on the plane defined as a 2x3 matrix of 64-bit floating point scalars. More...
 
class  pcl::LinearWorldTransformation
 WCS linear world coordinate transformation. More...
 
class  pcl::MercatorProjection
 Mercator projection system. More...
 
class  pcl::OrthographicProjection
 Orthographic projection system. More...
 
class  pcl::PlateCarreeProjection
 Plate-Carree projection system. More...
 
class  pcl::ProjectionBase
 Base class of all projection systems. More...
 
class  pcl::ProjectionFactory
 Selectable projection system. More...
 
class  pcl::SphericalRotation
 Rotation in spherical coordinates. More...
 
class  pcl::SplineWorldTransformation
 Surface spline world coordinate transformation. More...
 
class  pcl::StereographicProjection
 Stereographic projection system. More...
 
class  pcl::WCSKeywords
 A structure for management of WCS FITS header keywords and associated image properties. More...
 
class  pcl::WorldTransformation
 Abstract base class of world coordinate transformations. More...
 
class  pcl::ZenithalEqualAreaProjection
 Zenithal equal-area projection system. More...
 
class  pcl::ZenithalProjectionBase
 Base class of zenithal projection systems. More...
 

Functions

bool pcl::ImageWindow::CelestialToImage (double &ra, double &dec) const
 
bool pcl::ImageWindow::CelestialToImage (DPoint &pI, const DPoint &pRD) const
 
void pcl::ImageWindow::ClearAstrometricSolution (bool notify=true)
 
bool pcl::ImageWindow::CopyAstrometricSolution (const ImageWindow &source, bool notify=true)
 
bool pcl::ImageWindow::HasAstrometricSolution () const
 
bool pcl::ImageWindow::ImageToCelestial (double &x, double &y, bool rawRA=false) const
 
template<typename T >
bool pcl::ImageWindow::ImageToCelestial (DPoint &pRD, const GenericPoint< T > &pI, bool rawRA=false) const
 
bool pcl::ImageWindow::RegenerateAstrometricSolution (bool allowGUIMessages=true, bool notify=true)
 
void pcl::ImageWindow::UpdateAstrometryMetadata (bool notify=true)
 

Detailed Description

The original implementation of these classes has been contributed by Spanish software developer and PTeam member Andrés del Pozo, who is also the author of all astrometry scripts available in the standard PixInsight distribution, including the ImageSolver and AnnotateImage scripts, among others.

Function Documentation

◆ CelestialToImage() [1/2]

bool pcl::ImageWindow::CelestialToImage ( double &  ra,
double &  dec 
) const

Converts the specified ra and dec coordinates, expressed in degrees, from celestial equatorial coordinates to the image coordinate system.

If the window has a valid astrometric solution and the celestial-to-image coordinate transformation succeeds, the values of the specified ra and dec variables are replaced with the corresponding x and y image coordinates, respectively, expressed in pixels. Note that both input equatorial and output image coordinates can legally be outside image bounds. Input equatorial coordinates are assumed to be referred to the reference system of the astrometric solution associated with this image window (ICRS or GCRS).

If the window has no valid astrometric solution, or if the coordinate transformation cannot be performed, the ra and dec variables are not modified and the function returns false.

See also
AstrometricMetadata

◆ CelestialToImage() [2/2]

bool pcl::ImageWindow::CelestialToImage ( DPoint pI,
const DPoint pRD 
) const
inline

Converts the specified point pRD from celestial equatorial coordinates in degrees to the image coordinate system.

If the conversion is successful, the computed x and y image coordinates in pixels are stored in the pI.x and pI.y members, respectively, and the function returns true. Otherwise the point pI is not modified and the function returns false.

See CelestialToImage( double&, double& ) const for detailed information.

See also
AstrometricMetadata

Definition at line 1526 of file ImageWindow.h.

References pcl::GenericPoint< T >::x, and pcl::GenericPoint< T >::y.

◆ ClearAstrometricSolution()

void pcl::ImageWindow::ClearAstrometricSolution ( bool  notify = true)

Removes an existing astrometric solution and its associated metadata from this image window.

Parameters
notifyWhether to notify the platform on the property changes. This is true by default.

This function removes a number of special view properties associated with an astrometric solution if they exist for the main view in this window, irrespective of whether there is a valid astrometric solution or not. The following XISF properties will be removed:

Observation:CelestialReferenceSystem Observation:Equinox PCL:AstrometricSolution:Catalog PCL:AstrometricSolution:CelestialPoleNativeCoordinates PCL:AstrometricSolution:CreationTime PCL:AstrometricSolution:CreatorApplication PCL:AstrometricSolution:CreatorModule PCL:AstrometricSolution:CreatorOS PCL:AstrometricSolution:LinearTransformationMatrix PCL:AstrometricSolution:ProjectionSystem PCL:AstrometricSolution:ReferenceCelestialCoordinates PCL:AstrometricSolution:ReferenceImageCoordinates PCL:AstrometricSolution:ReferenceNativeCoordinates PCL:AstrometricSolution:SplineWorldTransformation

Besides removing the above properties, if the image has an astrometric solution defined it will be destroyed and deallocated.

See also
AstrometricMetadata

◆ CopyAstrometricSolution()

bool pcl::ImageWindow::CopyAstrometricSolution ( const ImageWindow source,
bool  notify = true 
)

Copies an astrometric solution from another image window.

Parameters
sourceThe image window with the astrometric solution that will be copied to this window.
notifyWhether to notify the platform on the property changes. This is true by default.

If the source image window has a valid and compatible astrometric solution, it will be copied to this window along with all of its associated metadata. This function returns true upon successful completion. The source image must have the same pixel dimensions as this image; otherwise, the existing solution is incompatible, and this function will fail without taking any action, returning false.

If the source image window has no valid astrometric solution, calling this function has no effect, and false is returned.

See also
AstrometricMetadata

◆ HasAstrometricSolution()

bool pcl::ImageWindow::HasAstrometricSolution ( ) const

Returns true iff this image window has a valid astrometric solution.

See also
AstrometricMetadata

◆ ImageToCelestial() [1/2]

bool pcl::ImageWindow::ImageToCelestial ( double &  x,
double &  y,
bool  rawRA = false 
) const

Converts the specified x and y coordinates from the image coordinate system to celestial equatorial coordinates.

If the window has a valid astrometric solution and the image-to-celestial coordinate transformation succeeds, the values of the specified x and y variables are replaced with the corresponding right ascension and declination, respectively, and the function returns true. Right ascension and declination are provided expressed in degrees in the ranges [0,360) (if rawRA is false; see below) and [-90,+90], respectively. Note that both input image coordinates and output equatorial coordinates can legally be outside image bounds. Output equatorial coordinates will be referred to the reference system of the astrometric solution associated with this image window (ICRS or GCRS).

If rawRA is true, the output right ascension is not constrained to the [0,360) range. This is useful for interpolation schemes where discontinuities caused by zero crossings in right ascension, i.e. abrupt changes from 360 to 0 degrees, are not admissible numerically. Right ascensions returned by this function when rawRA = true is specified can be larger than 360 degrees or less than zero, ensuring smooth transitions.

If the window has no valid astrometric solution, or if the coordinate transformation cannot be performed, the x and y variables are not modified and the function returns false.

See also
AstrometricMetadata

◆ ImageToCelestial() [2/2]

template<typename T >
bool pcl::ImageWindow::ImageToCelestial ( DPoint pRD,
const GenericPoint< T > &  pI,
bool  rawRA = false 
) const
inline

Converts the specified point pI from the image coordinate system to celestial equatorial coordinates.

If the conversion is successful, the computed right ascension and declination in degrees are stored in the pRD.x and pRD.y coordinates, respectively, and the function returns true. Otherwise the point pRD is not modified and the function returns false.

See ImageToCelestial( double&, double&, bool ) const for complete information.

See also
AstrometricMetadata

Definition at line 1478 of file ImageWindow.h.

References pcl::GenericPoint< T >::x, and pcl::GenericPoint< T >::y.

◆ RegenerateAstrometricSolution()

bool pcl::ImageWindow::RegenerateAstrometricSolution ( bool  allowGUIMessages = true,
bool  notify = true 
)

Attempts to reconstruct the astrometric solution associated with this image from existing metadata and image properties.

Parameters
allowGUIMessagesWhether to report possible error and warning messages through message boxes and other graphical resources that may block the core application's event loop. If this parameter is false, warning and error messages will only be shown on the process console. True by default.
notifyWhether to notify the platform on the property changes. This is true by default.

Returns true iff a valid astrometric solution has been built for this image window.

See also
AstrometricMetadata

◆ UpdateAstrometryMetadata()

void pcl::ImageWindow::UpdateAstrometryMetadata ( bool  notify = true)

Updates the set of FITS header keywords and image properties of this image with metadata defining its current astrometric solution.

Parameters
notifyWhether to notify the platform on the property changes. This is true by default.

If the image has no valid astrometric solution, calling this member function has no effect.

See also
AstrometricMetadata