@observerly/astrometry
Version:
observerly's lightweight, zero-dependency, type safe astrometry library written in Typescript for calculating the position of celestial objects in the sky.
46 lines (45 loc) • 1.58 kB
JavaScript
import { getCorrectionToEquatorialForAnnualAberration as z } from "./aberration.js";
import { getAngularSeparation as E } from "./astrometry.js";
import { convertEquatorialToHorizontal as m } from "./coordinates.js";
import { getLunarIllumination as C, getLunarEquatorialCoordinate as T } from "./moon.js";
import { getCorrectionToEquatorialForNutation as Q } from "./nutation.js";
import { getCorrectionToEquatorialForPrecessionOfEquinoxes as F } from "./precession.js";
import { getCorrectionToHorizontalForRefraction as f } from "./refraction.js";
import { getSolarEquatorialCoordinate as d } from "./sun.js";
import { g as x, d as I } from "./utilities-BM-rBPno.js";
// @license Copyright © 2021-2024 observerly
const N = (o, n, r, t, c) => {
if (r < 6 || t.alt > -18)
return -1;
const l = 1 - 2 * (o / 100), a = 2 * (n / 180) - 1;
let i = n >= 60 || o < 25 ? a : -(a * l);
c.alt <= 0 && (i = 1);
const e = r <= 6 ? r / 96 - 1 / 16 : r / 84 - 1 / 14, s = t.alt <= -18 ? -t.alt / 72 - 1 / 4 : -t.alt / 108 - 1 / 6;
return (i + e + s) / 3;
};
function P(o, n, r) {
const t = F(o, r), c = z(o, r), l = Q(o, r), a = x(r.ra + t.ra + c.ra + l.ra), i = I(r.dec + t.dec + c.dec + l.dec), { alt: e, az: s } = f(m(o, n, {
ra: a,
dec: i
})), p = C(o), g = f(m(o, n, d(o))), u = f(m(o, n, T(o))), q = E({
θ: u.az,
φ: u.alt
}, {
θ: s,
φ: e
});
return {
ra: a,
dec: i,
Q: N(p, q, e, g, u),
K: p,
φ: q,
A: s,
alt: g.alt
};
}
export {
P as getQIndex,
N as q
};
//# sourceMappingURL=q.js.map