Skip to content

Commit 1ec8760

Browse files
Merge pull request #405 from observerly/fix/q/getQIndex
fix: amend getQIndex() to calculate angular separation between target and moon in @observerly/astrometry
2 parents 65c91a3 + d232e0c commit 1ec8760

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/q.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@ import { getCorrectionToEquatorialForAbberation } from './abberation'
1010

1111
import { getAngularSeparation } from './astrometry'
1212

13-
import type {
14-
HorizontalCoordinate,
15-
EquatorialCoordinate,
16-
GeographicCoordinate
17-
} from './common'
13+
import type { EquatorialCoordinate, GeographicCoordinate, HorizontalCoordinate } from './common'
1814

1915
import { convertEquatorialToHorizontal } from './coordinates'
2016

@@ -154,7 +150,7 @@ export function getQIndex(
154150
)
155151

156152
// Convert the target's equatorial coordinates to horizontal coordinates:
157-
const { alt: A } = getCorrectionToHorizontalForRefraction(
153+
const { alt: a, az: A } = getCorrectionToHorizontalForRefraction(
158154
convertEquatorialToHorizontal(datetime, observer, {
159155
ra,
160156
dec
@@ -180,16 +176,16 @@ export function getQIndex(
180176
φ: moon.alt
181177
},
182178
{
183-
θ: sun.az,
184-
φ: sun.alt
179+
θ: A,
180+
φ: a
185181
}
186182
)
187183

188184
// Calculate the Q index, and return the parameters of the observation:
189185
return {
190186
ra,
191187
dec,
192-
Q: q(K, φ, A, sun, moon),
188+
Q: q(K, φ, a, sun, moon),
193189
K,
194190
φ,
195191
A,

0 commit comments

Comments
 (0)