Instrument Neutral Distributed Interface INDI 2.2.5
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
INDI::AlignmentSubsystem::MathPlugin Class Referenceabstract

Provides alignment subsystem functions to INDI alignment math plugins. More...

#include <MathPlugin.h>

Inheritance diagram for INDI::AlignmentSubsystem::MathPlugin:
INDI::AlignmentSubsystem::AlignmentSubsystemForMathPlugins INDI::AlignmentSubsystem::MathPluginManagement INDI::AlignmentSubsystem::SPKMathPlugin INDI::AlignmentSubsystem::BasicMathPlugin INDI::AlignmentSubsystem::DummyMathPlugin INDI::AlignmentSubsystem::NearestMathPlugin INDI::AlignmentSubsystem::AlignmentSubsystemForDrivers INDI::AlignmentSubsystem::BuiltInMathPlugin INDI::AlignmentSubsystem::SVDMathPlugin AstroTrac DSC Scope ScopeSim ScopeSim SkywatcherAPIMount

Public Member Functions

 MathPlugin (MountAlignment_t ApproximateAlignment=ZENITH)
 Default constructor.
 
virtual ~MathPlugin ()
 Virtual destructor.
 
virtual MountAlignment_t GetApproximateMountAlignment ()
 Get the approximate alignment of the mount.
 
virtual bool Initialise (InMemoryDatabase *pInMemoryDatabase)
 Initialise or re-initialise the math plugin. Re-reading the in memory database as necessary.
 
virtual void SetApproximateMountAlignment (MountAlignment_t ApproximateAlignment)
 Set the approximate alignment of the mount.
 
virtual bool TransformCelestialToTelescopeJD (double RightAscension, double Declination, double JulianDate, TelescopeDirectionVector &ApparentTelescopeDirectionVector)
 Get the alignment corrected telescope pointing direction for the supplied celestial coordinates.
 
virtual bool TransformTelescopeToCelestialJD (const TelescopeDirectionVector &ApparentTelescopeDirectionVector, double &RightAscension, double &Declination, double JulianDate)
 Get the true celestial coordinates for the supplied telescope pointing direction.
 
virtual bool TransformCelestialToTelescope (const double RightAscension, const double Declination, double JulianOffset, TelescopeDirectionVector &ApparentTelescopeDirectionVector)=0
 Get the alignment corrected telescope pointing direction for the supplied celestial coordinates.
 
virtual bool TransformTelescopeToCelestial (const TelescopeDirectionVector &ApparentTelescopeDirectionVector, double &RightAscension, double &Declination, double JulianOffset=0)=0
 Get the true celestial coordinates for the supplied telescope pointing direction.
 

Static Public Member Functions

static void SanitizePolarEntries (InMemoryDatabase *pInMemoryDatabase, MountAlignment_t mountAlignment)
 Sanitize alignment database entries that are near the pole (EQ) or zenith (altaz). At these singularities the roll-axis (HA or Az) component of the TDV is unconstrained, making any pointing model ill-conditioned.
 

Protected Attributes

MountAlignment_t ApproximateMountAlignment
 Describe the approximate alignment of the mount. This information is normally used in a one star alignment calculation.
 
InMemoryDatabase * pInMemoryDatabase
 

Detailed Description

Provides alignment subsystem functions to INDI alignment math plugins.

Note
This class is intended to be implemented within an external plugin. If the implementation of this class uses a standard 3 by 3 transformation matrix to convert between coordinate systems then it will not normally need to know the handedness of either the celestial or telescope coordinate systems, as the necessary rotations and scaling will be handled in the derivation of the matrix coefficients. This will normally be done using the three reference (sync) points method. Knowledge of the handedness of the coordinate systems is needed when only two reference points are available and a third reference point has to artificially generated in order to derive the matrix coefficients.

Definition at line 30 of file MathPlugin.h.

Constructor & Destructor Documentation

◆ MathPlugin()

INDI::AlignmentSubsystem::MathPlugin::MathPlugin ( MountAlignment_t  ApproximateAlignment = ZENITH)
inline

Default constructor.

Definition at line 34 of file MathPlugin.h.

◆ ~MathPlugin()

virtual INDI::AlignmentSubsystem::MathPlugin::~MathPlugin ( )
inlinevirtual

Virtual destructor.

Definition at line 40 of file MathPlugin.h.

Member Function Documentation

◆ GetApproximateMountAlignment()

virtual MountAlignment_t INDI::AlignmentSubsystem::MathPlugin::GetApproximateMountAlignment ( )
inlinevirtual

Get the approximate alignment of the mount.

Returns
the approximate alignment

Reimplemented in INDI::AlignmentSubsystem::MathPluginManagement.

Definition at line 45 of file MathPlugin.h.

◆ Initialise()

bool INDI::AlignmentSubsystem::MathPlugin::Initialise ( InMemoryDatabase *  pInMemoryDatabase)
virtual

Initialise or re-initialise the math plugin. Re-reading the in memory database as necessary.

Returns
True if successful

Reimplemented in INDI::AlignmentSubsystem::MathPluginManagement, INDI::AlignmentSubsystem::BasicMathPlugin, INDI::AlignmentSubsystem::DummyMathPlugin, INDI::AlignmentSubsystem::NearestMathPlugin, and INDI::AlignmentSubsystem::SPKMathPlugin.

Definition at line 34 of file MathPlugin.cpp.

◆ SanitizePolarEntries()

void INDI::AlignmentSubsystem::MathPlugin::SanitizePolarEntries ( InMemoryDatabase *  pInMemoryDatabase,
MountAlignment_t  mountAlignment 
)
static

Sanitize alignment database entries that are near the pole (EQ) or zenith (altaz). At these singularities the roll-axis (HA or Az) component of the TDV is unconstrained, making any pointing model ill-conditioned.

The method shifts such entries to a moderate pitch by applying the same delta to both the TDV encoder position and the celestial declination, preserving the pointing correction while breaking the degeneracy. The encoder HA/Az is reconstructed from the celestial coordinates, implicitly assuming zero roll-index error.

Call this before processing the database in Initialise().

Definition at line 41 of file MathPlugin.cpp.

◆ SetApproximateMountAlignment()

virtual void INDI::AlignmentSubsystem::MathPlugin::SetApproximateMountAlignment ( MountAlignment_t  ApproximateAlignment)
inlinevirtual

Set the approximate alignment of the mount.

Parameters
[in]ApproximateAlignment- the approximate alignment of the mount

Reimplemented in INDI::AlignmentSubsystem::MathPluginManagement.

Definition at line 56 of file MathPlugin.h.

◆ TransformCelestialToTelescope()

virtual bool INDI::AlignmentSubsystem::MathPlugin::TransformCelestialToTelescope ( const double  RightAscension,
const double  Declination,
double  JulianOffset,
TelescopeDirectionVector &  ApparentTelescopeDirectionVector 
)
pure virtual

Get the alignment corrected telescope pointing direction for the supplied celestial coordinates.

Parameters
[in]RightAscensionRight Ascension (Decimal Hours).
[in]DeclinationDeclination (Decimal Degrees).
[in]JulianOffsetOffset (days) added to ln_get_julian_from_sys() to form the Julian Date.
[out]ApparentTelescopeDirectionVectorParameter to receive the corrected telescope direction
Returns
True if successful
Note
Built-in plugins implement this as a thin shim that resolves the absolute JD and calls TransformCelestialToTelescopeJD. New callers should use TransformCelestialToTelescopeJD directly.

Implemented in INDI::AlignmentSubsystem::MathPluginManagement, INDI::AlignmentSubsystem::BasicMathPlugin, INDI::AlignmentSubsystem::DummyMathPlugin, INDI::AlignmentSubsystem::NearestMathPlugin, and INDI::AlignmentSubsystem::SPKMathPlugin.

◆ TransformCelestialToTelescopeJD()

bool INDI::AlignmentSubsystem::MathPlugin::TransformCelestialToTelescopeJD ( double  RightAscension,
double  Declination,
double  JulianDate,
TelescopeDirectionVector &  ApparentTelescopeDirectionVector 
)
virtual

Get the alignment corrected telescope pointing direction for the supplied celestial coordinates.

Parameters
[in]RightAscensionRight Ascension (Decimal Hours).
[in]DeclinationDeclination (Decimal Degrees).
[in]JulianDateAbsolute Julian Date (days).
[out]ApparentTelescopeDirectionVectorParameter to receive the corrected telescope direction
Returns
True if successful
Note
Built-in plugins override this method and use JulianDate directly without reading the system clock. External plugins that have not yet adopted this interface use the default implementation, which computes JulianOffset = JulianDate - ln_get_julian_from_sys() and delegates to TransformCelestialToTelescope, so the plugin recovers the correct absolute JD internally.

Reimplemented in INDI::AlignmentSubsystem::MathPluginManagement, INDI::AlignmentSubsystem::BasicMathPlugin, INDI::AlignmentSubsystem::DummyMathPlugin, INDI::AlignmentSubsystem::NearestMathPlugin, and INDI::AlignmentSubsystem::SPKMathPlugin.

Definition at line 20 of file MathPlugin.cpp.

◆ TransformTelescopeToCelestial()

virtual bool INDI::AlignmentSubsystem::MathPlugin::TransformTelescopeToCelestial ( const TelescopeDirectionVector &  ApparentTelescopeDirectionVector,
double &  RightAscension,
double &  Declination,
double  JulianOffset = 0 
)
pure virtual

Get the true celestial coordinates for the supplied telescope pointing direction.

Parameters
[in]ApparentTelescopeDirectionVectorthe telescope direction
[out]RightAscensionParameter to receive the Right Ascension (Decimal Hours).
[out]DeclinationParameter to receive the Declination (Decimal Degrees).
[in]JulianOffsetOffset (days) added to ln_get_julian_from_sys() to form the Julian Date (default 0).
Returns
True if successful
Note
Built-in plugins implement this as a thin shim that resolves the absolute JD and calls TransformTelescopeToCelestialJD. New callers should use TransformTelescopeToCelestialJD directly.

Implemented in INDI::AlignmentSubsystem::MathPluginManagement, INDI::AlignmentSubsystem::BasicMathPlugin, INDI::AlignmentSubsystem::DummyMathPlugin, INDI::AlignmentSubsystem::NearestMathPlugin, and INDI::AlignmentSubsystem::SPKMathPlugin.

◆ TransformTelescopeToCelestialJD()

bool INDI::AlignmentSubsystem::MathPlugin::TransformTelescopeToCelestialJD ( const TelescopeDirectionVector &  ApparentTelescopeDirectionVector,
double &  RightAscension,
double &  Declination,
double  JulianDate 
)
virtual

Get the true celestial coordinates for the supplied telescope pointing direction.

Parameters
[in]ApparentTelescopeDirectionVectorthe telescope direction
[out]RightAscensionParameter to receive the Right Ascension (Decimal Hours).
[out]DeclinationParameter to receive the Declination (Decimal Degrees).
[in]JulianDateAbsolute Julian Date (days).
Returns
True if successful
Note
Built-in plugins override this method and use JulianDate directly without reading the system clock. External plugins that have not yet adopted this interface use the default implementation, which ignores JulianDate and delegates to TransformTelescopeToCelestial with JulianOffset=0.

Reimplemented in INDI::AlignmentSubsystem::MathPluginManagement, INDI::AlignmentSubsystem::BasicMathPlugin, INDI::AlignmentSubsystem::DummyMathPlugin, INDI::AlignmentSubsystem::NearestMathPlugin, and INDI::AlignmentSubsystem::SPKMathPlugin.

Definition at line 27 of file MathPlugin.cpp.

Member Data Documentation

◆ ApproximateMountAlignment

MountAlignment_t INDI::AlignmentSubsystem::MathPlugin::ApproximateMountAlignment
protected

Describe the approximate alignment of the mount. This information is normally used in a one star alignment calculation.

Definition at line 128 of file MathPlugin.h.

◆ pInMemoryDatabase

InMemoryDatabase* INDI::AlignmentSubsystem::MathPlugin::pInMemoryDatabase
protected

Definition at line 129 of file MathPlugin.h.


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