@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.
308 lines (307 loc) • 12.6 kB
JavaScript
import { getCorrectionToEquatorialForAberration as x, getCorrectionToEquatorialForAnnualAberration as y, getCorrectionToEquatorialForDiurnalAberration as C } from "./aberration.js";
import { GST as N, LST as P, getAngularSeparation as O, getAntipodeCoordinate as h, getGreenwhichSiderealTime as M, getHourAngle as H, getLocalSiderealTime as I, getNormalisedSphericalCoordinate as _, getObliquityOfTheEcliptic as R, getParallacticAngle as q } from "./astrometry.js";
import { isEquatorialCoordinate as v, isHorizontalCoordinate as J } from "./common.js";
import { findConjunction as F, findPlanetaryConjunction as z, findPlanetaryConjunctions as B, isConjunction as w, isPlanetaryConjunction as U } from "./conjunction.js";
import { EARTH_RADIUS as l } from "./constants.js";
import { AU_IN_METERS as Y, J1900 as k, J1970 as V, J2000 as X, SECONDS_IN_DAY as Q, SECONDS_IN_HOUR as W, SECONDS_IN_YEAR as K, SPEED_OF_LIGHT as Z, c as $ } from "./constants.js";
import { constellations as te, getConstellation as re } from "./constellations.js";
import { convertEclipticToEquatorial as ie, convertEquatorialToHorizontal as ne, convertGalacticToEquatorial as ae, convertHorizontalToEquatorial as le } from "./coordinates.js";
import { B as ce, L as ue, R as se, earth as me, getCoefficientOfEccentricity as pe, getEccentricityOfOrbit as Te, getObliquityOfEcliptic as de } from "./earth.js";
import { EclipseType as Ee, getLunarEclipse as Le, getSolarEclipse as Se, isLunarEclipse as Ae, isSolarEclipse as xe } from "./eclipse.js";
import { getEclipticPlane as Ce } from "./ecliptic.js";
import { g, a as c } from "./epoch-nmyjNjKp.js";
import { b as Ne } from "./epoch-nmyjNjKp.js";
import { formatDegreeToDMSHumanized as Oe, formatDegreeToHMSHumanized as he } from "./humanize.js";
import { LEAP_SECONDS as n } from "./iers.js";
import { CURRENT_EXPIRY_UNIX_TIMESTAMP as He } from "./iers.js";
import { interpolate as _e, interpolateGeodesic as Re, interpolateRank2DArray as qe, interpolateRank2DGeodesicCoordinateArray as be } from "./maths.js";
import { LUNAR_SYNODIC_MONTH as Je, LUNATION_BASE_JULIAN_DAY as Ge, Phases as Fe, getLunarAge as ze, getLunarAngularDiameter as Be, getLunarAnnualEquationCorrection as we, getLunarArgumentOfLatitude as Ue, getLunarBrownLunationNumber as je, getLunarCorrectedEclipticLongitudeOfTheAscendingNode as Ye, getLunarDistance as ke, getLunarEclipticCoordinate as Ve, getLunarEclipticLatitude as Xe, getLunarEclipticLongitude as Qe, getLunarElongation as We, getLunarEquatorialCoordinate as Ke, getLunarEvectionCorrection as Ze, getLunarIllumination as $e, getLunarMeanAnomaly as et, getLunarMeanAnomalyCorrection as tt, getLunarMeanEclipticLongitude as rt, getLunarMeanEclipticLongitudeOfTheAscendingNode as ot, getLunarMeanGeometricLongitude as it, getLunarPhase as nt, getLunarPhaseAngle as at, getLunarTrueAnomaly as lt, getLunarTrueEclipticLongitude as gt, getNextFullMoon as ct, getNextNewMoon as ut, isBlueMoon as st, isFullMoon as mt, isNewMoon as pt, names as Tt } from "./moon.js";
import { getGeneralizedSolarTransit as ft, getNight as Et, getSolarTransit as Lt, isNight as St } from "./night.js";
import { getCorrectionToEquatorialForNutation as xt } from "./nutation.js";
import { Observation as Ct } from "./observation.js";
import { e as u } from "./utilities-BM-rBPno.js";
import { getFieldOfView as Nt, getFocalRatio as Pt } from "./optics.js";
import { getFOrbitalParameter as ht } from "./orbit.js";
import { getPlanetaryEquationOfCenter as Ht, getPlanetaryGeocentricEclipticCoordinate as It, getPlanetaryHeliocentricDistance as _t, getPlanetaryHeliocentricEclipticLatitude as Rt, getPlanetaryHeliocentricEclipticLongitude as qt, getPlanetaryMeanAnomaly as bt, getPlanetaryPositions as vt, getPlanetaryTrueAnomaly as Jt, jupiter as Gt, mars as Ft, mercury as zt, neptune as Bt, planets as wt, saturn as Ut, uranus as jt, venus as Yt } from "./planets.js";
import { getCorrectionToEquatorialForPrecessionOfEquinoxes as Vt } from "./precession.js";
import { convertHorizontalToStereo as Qt, convertStereoToHorizontal as Wt } from "./projection.js";
import { getQIndex as Zt, q as $t } from "./q.js";
import { getAirmass as tr, getCorrectionToHorizontalForRefraction as rr, getRefraction as or } from "./refraction.js";
import { getAirmassPickering as nr } from "./seeing.js";
import { getHeliocentricJulianDate as s } from "./sun.js";
import { SOLAR_TROPICAL_YEAR as lr, getSolarAngularDiameter as gr, getSolarDistance as cr, getSolarEclipticCoordinate as ur, getSolarEclipticLongitude as sr, getSolarEquationOfCenter as mr, getSolarEquatorialCoordinate as pr, getSolarMeanAnomaly as Tr, getSolarMeanGeometricLongitude as dr, getSolarTrueAnomaly as fr, getSolarTrueGeometricLongitude as Er } from "./sun.js";
import { convertGreenwhichSiderealTimeToUniversalTime as Sr, convertJulianDateToUTC as Ar, convertLocalSiderealTimeToGreenwhichSiderealTime as xr } from "./temporal.js";
import { doesBodyRiseOrSet as Cr, getBodyNextRise as Dr, getBodyNextSet as Nr, getBodyTransit as Pr, isBodyAboveHorizon as Or, isBodyCircumpolar as hr, isBodyVisible as Mr, isBodyVisibleForNight as Hr, isTransitInstance as Ir } from "./transit.js";
import { Twilight as Rr, getTwilightBandsForDay as qr } from "./twilight.js";
import { convertPixelToWorldCoordinateSystem as vr, parseSIPTerm as Jr } from "./wcs.js";
// @license Copyright © 2021-2024 observerly
const E = (o, r = 0.167) => {
let e = 0;
return typeof o != "number" && o.elevation && (e = o.elevation), typeof o == "number" && (e = o), u(Math.sqrt(2 * (1 - r) * e / l));
};
// @license Copyright © 2021-2024 observerly
const a = (o, r) => {
let e = 0, t = 0;
for (let i = 0; i < n.length && (r > n[i].unix && (e = n[i].dtai), o >= n[i].unix); i++)
t = n[i].dtai;
return t - e;
};
class L extends Date {
/**
*
* @returns the International Atomic Time (TAI) of the given date.
*
*/
getInternationalAtomicTime() {
const r = (/* @__PURE__ */ new Date("1972-01-01T00:00:00.000+00:00")).getTime();
let e = 0;
const t = super.getTime();
return t < r ? t : (e = a(t, r), t + e * 1e3);
}
/**
*
* @returns the International Atomic Time (TAI) of the given date.
*
*/
getTAI() {
return this.getInternationalAtomicTime();
}
/**
*
* @returns the Terrestrial Time (TT) of the given date.
*
*/
getTerrestrialTime() {
return this.getInternationalAtomicTime() + 32.184 * 1e3;
}
/**
*
* @returns the Terrestrial Time (TT) of the given date.
*
*/
getTT() {
return this.getTerrestrialTime();
}
getGlobalPositioningSystemTime() {
const r = (/* @__PURE__ */ new Date("1980-01-06T00:00:00.000+00:00")).getTime();
let e = 0;
const t = super.getTime();
return t < r ? t : (e = a(t, r), t + e * 1e3);
}
getGPS() {
return this.getGlobalPositioningSystemTime();
}
/**
*
*
* @returns Julian Date as number - the Julian Date (JD) of the given date.
*
*/
getJulianDate() {
return g(this);
}
/**
*
*
* @returns Julian Date as number - the Julian Date (JD) of the given date.
*
*/
getJD() {
return this.getJulianDate();
}
/**
*
*
* @returns Modified Julian Date as number - the Modified Julian Date (MJD) of the given date.
*
*/
getModifiedJulianDate() {
return c(this);
}
/**
*
*
* @returns Modified Julian Date as number - the Modified Julian Date (MJD) of the given date.
*
*/
getMJD() {
return this.getModifiedJulianDate();
}
/**
*
*
* @returns Heliocentric Julian Date as number - the Heliocentric Julian Date (HJD) of the given date.
*
*/
getHeliocentricJulianDate() {
return s(this);
}
/**
*
*
* @returns Heliocentric Julian Date as number - the Heliocentric Julian Date (HJD) of the given date.
*
*/
getHJD() {
return this.getHeliocentricJulianDate();
}
}
export {
Y as AU_IN_METERS,
ce as B,
He as CURRENT_EXPIRY_UNIX_TIMESTAMP,
L as DateTime,
l as EARTH_RADIUS,
Ee as EclipseType,
N as GST,
k as J1900,
V as J1970,
X as J2000,
ue as L,
n as LEAP_SECONDS,
P as LST,
Je as LUNAR_SYNODIC_MONTH,
Ge as LUNATION_BASE_JULIAN_DAY,
Ct as Observation,
Fe as Phases,
se as R,
Q as SECONDS_IN_DAY,
W as SECONDS_IN_HOUR,
K as SECONDS_IN_YEAR,
lr as SOLAR_TROPICAL_YEAR,
Z as SPEED_OF_LIGHT,
Rr as Twilight,
$ as c,
te as constellations,
ie as convertEclipticToEquatorial,
ne as convertEquatorialToHorizontal,
ae as convertGalacticToEquatorial,
Sr as convertGreenwhichSiderealTimeToUniversalTime,
le as convertHorizontalToEquatorial,
Qt as convertHorizontalToStereo,
Ar as convertJulianDateToUTC,
xr as convertLocalSiderealTimeToGreenwhichSiderealTime,
vr as convertPixelToWorldCoordinateSystem,
Wt as convertStereoToHorizontal,
Cr as doesBodyRiseOrSet,
me as earth,
F as findConjunction,
z as findPlanetaryConjunction,
B as findPlanetaryConjunctions,
Oe as formatDegreeToDMSHumanized,
he as formatDegreeToHMSHumanized,
tr as getAirmass,
nr as getAirmassPickering,
O as getAngularSeparation,
h as getAntipodeCoordinate,
Dr as getBodyNextRise,
Nr as getBodyNextSet,
Pr as getBodyTransit,
pe as getCoefficientOfEccentricity,
re as getConstellation,
x as getCorrectionToEquatorialForAberration,
y as getCorrectionToEquatorialForAnnualAberration,
C as getCorrectionToEquatorialForDiurnalAberration,
xt as getCorrectionToEquatorialForNutation,
Vt as getCorrectionToEquatorialForPrecessionOfEquinoxes,
rr as getCorrectionToHorizontalForRefraction,
Te as getEccentricityOfOrbit,
Ce as getEclipticPlane,
ht as getFOrbitalParameter,
Nt as getFieldOfView,
Pt as getFocalRatio,
ft as getGeneralizedSolarTransit,
M as getGreenwhichSiderealTime,
s as getHeliocentricJulianDate,
H as getHourAngle,
g as getJulianDate,
E as getLocalHorizon,
I as getLocalSiderealTime,
ze as getLunarAge,
Be as getLunarAngularDiameter,
we as getLunarAnnualEquationCorrection,
Ue as getLunarArgumentOfLatitude,
je as getLunarBrownLunationNumber,
Ye as getLunarCorrectedEclipticLongitudeOfTheAscendingNode,
ke as getLunarDistance,
Le as getLunarEclipse,
Ve as getLunarEclipticCoordinate,
Xe as getLunarEclipticLatitude,
Qe as getLunarEclipticLongitude,
We as getLunarElongation,
Ke as getLunarEquatorialCoordinate,
Ze as getLunarEvectionCorrection,
$e as getLunarIllumination,
et as getLunarMeanAnomaly,
tt as getLunarMeanAnomalyCorrection,
rt as getLunarMeanEclipticLongitude,
ot as getLunarMeanEclipticLongitudeOfTheAscendingNode,
it as getLunarMeanGeometricLongitude,
nt as getLunarPhase,
at as getLunarPhaseAngle,
lt as getLunarTrueAnomaly,
gt as getLunarTrueEclipticLongitude,
c as getModifiedJulianDate,
ct as getNextFullMoon,
ut as getNextNewMoon,
Et as getNight,
_ as getNormalisedSphericalCoordinate,
Ne as getNumberOfCenturiesSinceJ2000,
de as getObliquityOfEcliptic,
R as getObliquityOfTheEcliptic,
q as getParallacticAngle,
Ht as getPlanetaryEquationOfCenter,
It as getPlanetaryGeocentricEclipticCoordinate,
_t as getPlanetaryHeliocentricDistance,
Rt as getPlanetaryHeliocentricEclipticLatitude,
qt as getPlanetaryHeliocentricEclipticLongitude,
bt as getPlanetaryMeanAnomaly,
vt as getPlanetaryPositions,
Jt as getPlanetaryTrueAnomaly,
Zt as getQIndex,
or as getRefraction,
gr as getSolarAngularDiameter,
cr as getSolarDistance,
Se as getSolarEclipse,
ur as getSolarEclipticCoordinate,
sr as getSolarEclipticLongitude,
mr as getSolarEquationOfCenter,
pr as getSolarEquatorialCoordinate,
Tr as getSolarMeanAnomaly,
dr as getSolarMeanGeometricLongitude,
Lt as getSolarTransit,
fr as getSolarTrueAnomaly,
Er as getSolarTrueGeometricLongitude,
qr as getTwilightBandsForDay,
_e as interpolate,
Re as interpolateGeodesic,
qe as interpolateRank2DArray,
be as interpolateRank2DGeodesicCoordinateArray,
st as isBlueMoon,
Or as isBodyAboveHorizon,
hr as isBodyCircumpolar,
Mr as isBodyVisible,
Hr as isBodyVisibleForNight,
w as isConjunction,
v as isEquatorialCoordinate,
mt as isFullMoon,
J as isHorizontalCoordinate,
Ae as isLunarEclipse,
pt as isNewMoon,
St as isNight,
U as isPlanetaryConjunction,
xe as isSolarEclipse,
Ir as isTransitInstance,
Gt as jupiter,
Ft as mars,
zt as mercury,
Tt as names,
Bt as neptune,
Jr as parseSIPTerm,
wt as planets,
$t as q,
Ut as saturn,
jt as uranus,
Yt as venus
};
//# sourceMappingURL=index.js.map