@@ -65,7 +65,7 @@ void AlignmentSubsystemForDrivers::SaveAlignmentConfigProperties(FILE *fp)
6565// Helper methods
6666
6767bool AlignmentSubsystemForDrivers::AddAlignmentEntryEquatorial (double actualRA, double actualDec, double mountRA,
68- double mountDec)
68+ double mountDec, double JD )
6969{
7070 IGeographicCoordinates location;
7171 if (!GetDatabaseReferencePosition (location))
@@ -77,7 +77,7 @@ bool AlignmentSubsystemForDrivers::AddAlignmentEntryEquatorial(double actualRA,
7777 AlignmentDatabaseEntry NewEntry;
7878 TelescopeDirectionVector TDV = TelescopeDirectionVectorFromEquatorialCoordinates (RaDec);
7979
80- NewEntry.ObservationJulianDate = ln_get_julian_from_sys () ;
80+ NewEntry.ObservationJulianDate = JD ;
8181 NewEntry.RightAscension = actualRA;
8282 NewEntry.Declination = actualDec;
8383 NewEntry.TelescopeDirection = TDV;
@@ -98,7 +98,7 @@ bool AlignmentSubsystemForDrivers::AddAlignmentEntryEquatorial(double actualRA,
9898}
9999
100100bool AlignmentSubsystemForDrivers::SkyToTelescopeEquatorial (double actualRA, double actualDec, double &mountRA,
101- double &mountDec)
101+ double &mountDec, double JD )
102102{
103103 INDI::IEquatorialCoordinates eq{0 , 0 };
104104 TelescopeDirectionVector TDV;
@@ -115,7 +115,7 @@ bool AlignmentSubsystemForDrivers::SkyToTelescopeEquatorial(double actualRA, dou
115115
116116 if (GetAlignmentDatabase ().size () >= 1 )
117117 {
118- if (TransformCelestialToTelescope (actualRA, actualDec, 0.0 , TDV))
118+ if (TransformCelestialToTelescopeJD (actualRA, actualDec, JD , TDV))
119119 {
120120 EquatorialCoordinatesFromTelescopeDirectionVector (TDV, eq);
121121 // and now we have to convert from lha back to RA
@@ -129,7 +129,7 @@ bool AlignmentSubsystemForDrivers::SkyToTelescopeEquatorial(double actualRA, dou
129129}
130130
131131bool AlignmentSubsystemForDrivers::TelescopeEquatorialToSky (double mountRA, double mountDec, double &actualRA,
132- double &actualDec)
132+ double &actualDec, double JD )
133133{
134134 INDI::IEquatorialCoordinates eq{0 , 0 };
135135 IGeographicCoordinates location;
@@ -150,14 +150,14 @@ bool AlignmentSubsystemForDrivers::TelescopeEquatorialToSky(double mountRA, doub
150150 eq.declination = mountDec;
151151
152152 TDV = TelescopeDirectionVectorFromEquatorialCoordinates (eq);
153- return TransformTelescopeToCelestial (TDV, actualRA, actualDec);
153+ return TransformTelescopeToCelestialJD (TDV, actualRA, actualDec, JD );
154154 }
155155
156156 return false ;
157157}
158158
159159bool AlignmentSubsystemForDrivers::AddAlignmentEntryAltAz (double actualRA, double actualDec, double mountAlt,
160- double mountAz)
160+ double mountAz, double JD )
161161{
162162 IGeographicCoordinates location;
163163 if (!GetDatabaseReferencePosition (location))
@@ -169,7 +169,7 @@ bool AlignmentSubsystemForDrivers::AddAlignmentEntryAltAz(double actualRA, doubl
169169 AlignmentDatabaseEntry NewEntry;
170170 TelescopeDirectionVector TDV = TelescopeDirectionVectorFromAltitudeAzimuth (AltAz);
171171
172- NewEntry.ObservationJulianDate = ln_get_julian_from_sys () ;
172+ NewEntry.ObservationJulianDate = JD ;
173173 NewEntry.RightAscension = actualRA;
174174 NewEntry.Declination = actualDec;
175175 NewEntry.TelescopeDirection = TDV;
@@ -189,7 +189,8 @@ bool AlignmentSubsystemForDrivers::AddAlignmentEntryAltAz(double actualRA, doubl
189189 return false ;
190190}
191191
192- bool AlignmentSubsystemForDrivers::SkyToTelescopeAltAz (double actualRA, double actualDec, double &mountAlt, double &mountAz)
192+ bool AlignmentSubsystemForDrivers::SkyToTelescopeAltAz (double actualRA, double actualDec, double &mountAlt,
193+ double &mountAz, double JD)
193194{
194195 INDI::IHorizontalCoordinates altAz{0 , 0 };
195196 TelescopeDirectionVector TDV;
@@ -202,7 +203,7 @@ bool AlignmentSubsystemForDrivers::SkyToTelescopeAltAz(double actualRA, double a
202203
203204 if (GetAlignmentDatabase ().size () >= 1 )
204205 {
205- if (TransformCelestialToTelescope (actualRA, actualDec, 0.0 , TDV))
206+ if (TransformCelestialToTelescopeJD (actualRA, actualDec, JD , TDV))
206207 {
207208 AltitudeAzimuthFromTelescopeDirectionVector (TDV, altAz);
208209 mountAz = range360 (altAz.azimuth );
@@ -214,7 +215,8 @@ bool AlignmentSubsystemForDrivers::SkyToTelescopeAltAz(double actualRA, double a
214215 return false ;
215216}
216217
217- bool AlignmentSubsystemForDrivers::TelescopeAltAzToSky (double mountAlt, double mountAz, double &actualRa, double &actualDec)
218+ bool AlignmentSubsystemForDrivers::TelescopeAltAzToSky (double mountAlt, double mountAz, double &actualRa,
219+ double &actualDec, double JD)
218220{
219221 INDI::IHorizontalCoordinates altaz{0 , 0 };
220222 IGeographicCoordinates location;
@@ -230,7 +232,7 @@ bool AlignmentSubsystemForDrivers::TelescopeAltAzToSky(double mountAlt, double m
230232 altaz.azimuth = range360 (mountAz);
231233 altaz.altitude = range360 (mountAlt);
232234 TDV = TelescopeDirectionVectorFromAltitudeAzimuth (altaz);
233- return TransformTelescopeToCelestial (TDV, actualRa, actualDec);
235+ return TransformTelescopeToCelestialJD (TDV, actualRa, actualDec, JD );
234236 }
235237
236238 return false ;
0 commit comments