22
33// @author Michael Roberts <[email protected] > 44// @package @observerly /astrometry/abberation
5- // @license Copyright © 2021-2023 observerly
5+ // @license Copyright © 2021-2025 observerly
66
77/*****************************************************************************************************************/
88
9- import { getObliquityOfTheEcliptic } from './astrometry'
9+ import { getHourAngle , getObliquityOfTheEcliptic } from './astrometry'
1010
11- import type { EquatorialCoordinate } from './common'
11+ import type { EquatorialCoordinate , GeographicCoordinate } from './common'
12+
13+ import { EARTH_RADIUS , c } from './constants'
1214
1315import { getEccentricityOfOrbit } from './earth'
1416
@@ -82,14 +84,14 @@ export const getCorrectionToEquatorialForAnnualAbberation = (
8284 // Get the true geometric longitude of the sun (in degrees):
8385 const S = radians ( getSolarTrueGeometricLongitude ( datetime ) )
8486
85- // Calculate the abberation correction in right ascension (in degrees ):
87+ // Calculate the abberation correction in right ascension (in radians ):
8688 const Δra =
8789 - κ * ( Math . cos ( ra ) * Math . cos ( S ) * Math . cos ( ε ) + ( Math . sin ( ra ) * Math . sin ( S ) ) / Math . cos ( dec ) ) +
8890 e *
8991 κ *
9092 ( Math . cos ( ra ) * Math . cos ( ϖ ) * Math . cos ( ε ) + ( Math . sin ( ra ) * Math . sin ( ϖ ) ) / Math . cos ( dec ) )
9193
92- // Calculate the abberation correction in declination (in degrees ):
94+ // Calculate the abberation correction in declination (in radians ):
9395 const Δdec =
9496 - κ *
9597 ( Math . cos ( S ) * Math . cos ( ε ) * ( Math . tan ( ε ) * Math . cos ( dec ) - Math . sin ( ra ) * Math . sin ( dec ) ) +
@@ -106,3 +108,48 @@ export const getCorrectionToEquatorialForAnnualAbberation = (
106108}
107109
108110/*****************************************************************************************************************/
111+
112+ /**
113+ *
114+ * getCorrectionToEquatorialForDiurnalAbberation()
115+ *
116+ * Corrects the equatorial coordinate of a target for abberation in
117+ * longitude and obliquity due to the apparent motion of the Earth.
118+ *
119+ * @param date - The date to correct the equatorial coordinate for.
120+ * @param target - The equatorial J2000 coordinate of the target.
121+ * @returns The corrected equatorial coordinate of the target.
122+ *
123+ */
124+ export const getCorrectionToEquatorialForDiurnalAbberation = (
125+ datetime : Date ,
126+ observer : GeographicCoordinate ,
127+ target : EquatorialCoordinate
128+ ) : EquatorialCoordinate => {
129+ const dec = radians ( target . dec )
130+
131+ const phi = radians ( observer . latitude )
132+
133+ // Get the hour angle for the target:
134+ const ha = getHourAngle ( datetime , observer . longitude , target . ra )
135+
136+ // Earth's angular velocity (in rad/s):
137+ const Ω = 7.292115e-5
138+
139+ // Calculate the observer's tangential velocity due to Earth's rotation (in m/s):
140+ const v = Ω * EARTH_RADIUS * Math . cos ( phi )
141+
142+ // Calculate the abberation correction in right ascension (in radians):
143+ const Δra = ( ( v / c ) * ( Math . cos ( phi ) * Math . sin ( ha ) ) ) / Math . cos ( dec )
144+
145+ // Calculate the abberation correction in declination (in radians):
146+ const Δdec =
147+ ( v / c ) * ( Math . sin ( phi ) * Math . cos ( dec ) - Math . cos ( phi ) * Math . sin ( dec ) * Math . cos ( ha ) )
148+
149+ return {
150+ ra : degrees ( Δra ) ,
151+ dec : degrees ( Δdec )
152+ }
153+ }
154+
155+ /*****************************************************************************************************************/
0 commit comments