Skip to content

Commit

Permalink
Merge pull request #405 from observerly/fix/q/getQIndex
Browse files Browse the repository at this point in the history
fix: amend getQIndex() to calculate angular separation between target and moon in @observerly/astrometry
  • Loading branch information
michealroberts authored Nov 19, 2024
2 parents 65c91a3 + d232e0c commit 1ec8760
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/q.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ import { getCorrectionToEquatorialForAbberation } from './abberation'

import { getAngularSeparation } from './astrometry'

import type {
HorizontalCoordinate,
EquatorialCoordinate,
GeographicCoordinate
} from './common'
import type { EquatorialCoordinate, GeographicCoordinate, HorizontalCoordinate } from './common'

import { convertEquatorialToHorizontal } from './coordinates'

Expand Down Expand Up @@ -154,7 +150,7 @@ export function getQIndex(
)

// Convert the target's equatorial coordinates to horizontal coordinates:
const { alt: A } = getCorrectionToHorizontalForRefraction(
const { alt: a, az: A } = getCorrectionToHorizontalForRefraction(
convertEquatorialToHorizontal(datetime, observer, {
ra,
dec
Expand All @@ -180,16 +176,16 @@ export function getQIndex(
φ: moon.alt
},
{
θ: sun.az,
φ: sun.alt
θ: A,
φ: a
}
)

// Calculate the Q index, and return the parameters of the observation:
return {
ra,
dec,
Q: q(K, φ, A, sun, moon),
Q: q(K, φ, a, sun, moon),
K,
φ,
A,
Expand Down

0 comments on commit 1ec8760

Please sign in to comment.