2. Abstract

OcaLE is a server-side, web-based lunar ephemeris calculator that exposes a complete, reproducible computational pipeline through a public web interface. Given a date, time and observer location it returns the geocentric and topocentric position of the Moon (RA, Dec, alt, az), phase, illuminated fraction, age, magnitude, libration, selenographic colongitude, sub-Earth and sub-solar coordinates, and a full uncertainty budget combined in root-sum-of-squares form. The tool also enumerates upcoming principal phases, eclipses, apsides and super/micro-Moons.

The algorithmic foundation is layered. The default lite engine combines a truncated ELP-2000/82B series for the Moon (Chapront-Touzé and Chapront 1988; 60 longitude + 60 latitude + 46 distance terms) with VSOP87D for the Sun and inner planets (Bretagnon and Francou 1988); time scales follow the standard chain (UTC, UT1, TAI, TT, TDB) using an annual IERS Bulletin A snapshot for DUT1 and leap seconds. Frame transformations use Frame Bias × Precession (IAU 2006 P03; Capitaine, Wallace and Chapront 2003) × Nutation (IAU 2000A; full series via the SOFA polyfill, otherwise truncated to the 50 dominant terms which retain >99.9 % of the signal). When the SOFA polyfill is active, the pipeline upgrades to the CIO-based GCRS → CIRS → ITRS sequence, and adds Schwarzschild light deflection by the Sun, Earth self-deflection, and Lense-Thirring frame dragging. A JPL DE440 SPK kernel reader (Park et al. 2021) is provided as a higher-precision fallback in the 1550–2650 range.

Position accuracy ranges from approximately 5″ in the lite mode, dominated by ELP-2000/82B truncation, to approximately 0.005″ in the DE440 + SOFA polyfill mode, dominated by the IERS UT1−UTC snapshot age (up to ~365 days). Within the standard astronomical software hierarchy (naked-eye almanac → pocket calculator → full-precision JPL Horizons or NAIF SPICE), OcaLE occupies Tier 7: open methodology, reproducible from public papers, with explicit uncertainty bookkeeping, but not real-time IERS-tracked.

The intended audience is educational use, sophisticated amateur observation planning (astrophotography, occultation prediction, eclipse logistics), and the teaching of computational astronomy and frame mechanics. Validation has been performed against the canonical Meeus 1998 worked examples (Astronomical Algorithms, 2nd ed.) and is being extended to JPL Horizons; ongoing comparisons are documented in the validation suite (audit/B_test_algorithms.php, audit/F_test_stress.php). The tool, the methodology document and the underlying reference implementation are released under permissive licences.

3. Algorithmic Architecture

The pipeline is organised as a directed acyclic graph of stages. Each stage takes a set of inputs (time, location, model selection flags) and produces a typed intermediate object that is consumed by the next stage. The numbering below mirrors the section IDs in the source modules.

3.1 Core ephemeris models

3.1.1 ELP-2000/82B (Moon, default)

The default Moon position is computed from the semi-analytical lunar theory ELP-2000/82B1. The lite engine uses a truncated form: 60 terms in geocentric ecliptic longitude (cosine series in fundamental arguments D, M, M′, F), 60 in latitude (sine series), and 46 in distance (cosine series). The truncation retains all terms above an internal amplitude threshold of approximately 0.5″ in longitude/latitude and 5 km in distance. The expected accuracy of the truncated form is ~3–5″ in apparent angular position over the 1900–2100 window8; outside this window the residuals grow because Delta-T uncertainty propagates into the mean motion arguments.

3.1.2 VSOP87D (Sun and planets)

Heliocentric ecliptic spherical coordinates of date for the Sun (i.e., the negative of Earth's heliocentric position) and the inner planets are computed from the VSOP87 theory in its "D" variant2. The lite engine retains 58 terms for Earth in longitude/latitude/radius; the residual at epoch J2000 is below 0.6″ in heliocentric longitude. The Sun's apparent geocentric position is then obtained by reversing the heliocentric vector and applying aberration (Section 3.4) and light-time correction (Section 3.6).

3.1.3 JPL DE440 fallback

When a local SPK kernel for DE4407 is available under core/astro/data/de440/, the engine can swap the analytical ELP/VSOP layer for a numerical lookup. The kernel reader is an in-house, dependency-free PHP implementation of the SPICE Type-2 (Chebyshev polynomial) ingest path. Coverage spans 1550–2650; the corresponding 1σ position error for the Moon is approximately 0.001″ at epoch J2000 and degrades to 0.005″ at the kernel boundaries due to truncated coefficients in the ASCII delivery. Activation is automatic when the kernel is present and the requested epoch falls inside the coverage; otherwise the lite engine is used and the chosen engine ID is logged in the output payload.

3.2 Time scales

Five time scales are explicitly maintained throughout the pipeline. The scalar relationships, with all values in SI seconds, are:

TT  =  TAI + 32.184 s
TAI =  UTC + Delta-AT          (Delta-AT = total leap seconds, IERS)
UT1 =  UTC + DUT1              (DUT1 = UT1 - UTC, |DUT1| < 0.9 s)
TDB =  TT + 0.001658 s · sin(g) + 0.000014 s · sin(2g)   [Fairhead-Bretagnon]
       g  =  357.53 deg + 0.9856003 deg/day · (JD_TT - 2451545.0)

3.2.1 Delta-T = TT − UT1

Inside the IERS coverage window (1972 ≤ year ≤ current), Delta-T is computed exactly from Delta-T = 32.184 s + Delta-AT − DUT1. Outside this window (historical reconstruction and forward extrapolation), the Espenak & Meeus 2006 polynomial5 is used. The polynomial is documented to better than 1 second near the present and is the de-facto standard for educational tools.

3.2.2 IERS data sourcing

The DUT1 and Delta-AT (leap-second) values are sourced from a local snapshot of IERS Bulletin A12 stored under core/astro/data/iers/bulletin_a.snapshot.php. The snapshot is refreshed on every release of the calculator, but not at runtime; this means the maximum age of the DUT1 value is the time between two releases (currently approximately one calendar year). The implication for accuracy is documented in Section 7 (Uncertainty Budget).

3.2.3 Optional manual override

For reproducibility of historical computations or for forced compliance with a specific bulletin, the user can override Delta-T directly via the dt_seconds input parameter or supply a custom ut1_utc and tai_utc pair. The chosen mode (auto versus manual) is recorded in the output payload's provenance block.

3.3 Frame transformations

The position vector emitted by the ephemeris module is in the GCRS (Geocentric Celestial Reference System), aligned with the BCRS at the geocenter4. To translate into the user-requested frame the engine applies one of two pipelines depending on the frame_mode selection:

3.3.1 Equinox-based pipeline (default in lite mode)

This is the classical chain Frame Bias × Precession × Nutation, multiplied in this order to obtain the matrix NPB that maps GCRS into the true equator and equinox of date:

r_TOD  =  N(t) · P(t) · B · r_GCRS

B  =  frame bias matrix (IERS Conventions 2010, Eq. 5.20)
P(t) = precession IAU 2006 P03 (Capitaine et al. 2003)
N(t) = nutation IAU 2000A (truncated to 50 terms or full SOFA polyfill)

3.3.2 CIO-based pipeline (SOFA polyfill active)

When the SOFA polyfill modules under core/astro/sofa/ are loaded, the engine uses the modern CIO-based pipeline (X, Y, s parametrisation), which avoids the equinox altogether and is the IAU-recommended path for high-accuracy work:

r_CIRS  =  Q(X, Y, s) · r_GCRS
r_TIRS  =  R3(-ERA(UT1)) · r_CIRS
r_ITRS  =  W(xp, yp, s') · r_TIRS
r_topo  =  R(phi, lambda) · r_ITRS − r_observer

Here ERA is the Earth Rotation Angle (a strictly linear function of UT1), X, Y are the celestial pole coordinates (CIP), and W is the polar-motion matrix built from x_p, y_p (IERS Bulletin A) and the small TIO locator s'. Polar motion is set to zero when no IERS data is available; this contributes <30 m to the topocentric position and <0.01″ to the apparent direction.

3.3.3 Topocentric correction

From ITRS the geodetic observer position (phi, lambda, h) on the WGS84 ellipsoid is subtracted, taking into account the geocentric latitude correction (the difference between geodetic and geocentric latitude introduces the parallax in declination). For the Moon at perigee (~356&,000 km), parallax can reach 1.0 deg, hence topocentric and geocentric directions differ by up to one lunar diameter.

3.4 Aberration models

Three aberration components are modelled, all referred to the same observer instant.

3.4.1 Annual aberration

Computed from the heliocentric velocity of the geocenter (or topocentric site) using the Smith 1980 / Klioner 2003 formulation:

u_corrected  =  ( |u| · (u + v/c) ) / |u + v/c|

with v = (vx, vy, vz)  in BCRS, taken from VSOP87/DE440

Maximum amplitude is approximately 20.5″ (the so-called constant of aberration). In the lite engine the implementation is first-order in v/c; the second-order term reaches 1.6×10-7″ and is included only in the SOFA polyfill path.

3.4.2 Diurnal aberration

The Earth-rotation contribution is approximately 0.32″ cos(phi) at the equator, decreasing with latitude. It is added at the topocentric stage. Its sign reverses between rising and setting bodies and is included by default for topocentric outputs.

3.4.3 Galactic aberration

Following the IAU 2000 resolution and the parametrisation of Klioner et al. 2003, the secular acceleration of the solar system barycentre toward the Galactic centre induces a slow drift of celestial positions. The default model uses the dipole vector A_G = 5.05 micro-arcsec/yr aimed toward (l, b) = (264.0°, 48.3°). The implementation includes both the DC component (constant offset relative to a fiducial epoch) and the AC component (annual modulation due to Earth's heliocentric motion). Over the lifetime of the OcaLE tool the cumulative effect is below 0.05 mas and is therefore turned off by default; it is enabled when frame_corrections includes galactic_aberration.

3.5 Refraction models

3.5.1 Bennett 1982 (default)

Atmospheric refraction in the lite engine uses the marine-navigation form derived by Bennett 19829:

R = cot( h + 7.31 / (h + 4.4) )    [arcmin, h in degrees apparent]

Standard atmosphere (1013.25 hPa, 10 °C) is the implicit reference; pressure and temperature scaling factors are applied via R_corr = R · (P/1010) · (283/(T+273)). Wavelength dependence (chromatic refraction) is approximated by a Cauchy refractivity factor (1 + 0.000293 / lambda2) relative to lambda = 590 nm.

3.5.2 Saemundsson 1986 (high-altitude alternative)

For low altitudes (h < 15°) the Saemundsson 1986 form10 is more accurate; the user can select it via the refraction_model input. The formula uses the apparent altitude as input and yields refractions consistent with Bennett to within 0.01′ at the horizon.

3.6 Light-time correction

The position of the Moon (or any solar-system body) at the observation instant is the position of the body at a slightly earlier instant t − tau, where tau is the light-travel time from body to observer. The engine solves the implicit equation

tau = | r_body(t - tau)  -  r_obs(t) | / c

by simple fixed-point iteration. For the Earth–Moon vector, tau ≈ 1.28 s and convergence is reached in three iterations to better than 10-6 s. The corresponding apparent-motion correction is approximately 0.6″ per second of light time, hence approximately 0.8″ for the Moon.

3.7 Higher-order GR (when SOFA polyfill active)

Three relativistic corrections are added when the SOFA polyfill is loaded:

  • Schwarzschild light deflection by the Sun: peaks at ~1.75″ at the solar limb, falling as 1/θ with elongation; it is therefore non-negligible for objects within ~30° of the Sun. Implemented per IERS Conventions 2010 Section 5.2.
  • Lense-Thirring frame dragging by Earth: produces a secular precession of the Moon's apparent direction at approximately 10 micro-arcsec per 30 days. Negligible for ground-based work but emitted in the output for completeness when the polyfill is active.
  • Earth self-deflection: light bending by the Earth's mass acting on photons emitted by the Moon and observed by a topocentric observer; the effect is approximately 0.6 mas at the limb of the Earth and decreases rapidly with elongation.

4. Input Specifications

The calculator accepts more than 100 named inputs, organised below into 19 thematic groups. For each parameter we give the PHP name= attribute, the scientific symbol, the type, the accepted domain, the unit, the default, the validation rule, and the source paper or standard. Inputs are received via HTTP GET so that any computation is permalinkable and reproducible from the URL alone.

Table 4.1 — Time inputs
ParameterSymbolTypeDomainUnitDefaultValidationReference
dataUTC dateISO 86011900-01-01 to 2100-12-31today (server tz)regex ^\d{4}-\d{2}-\d{2}$ISO 8601
horaUTC timeHH:MM00:00–23:5912:00regex ^\d{2}:\d{2}$ISO 8601
jd_inputJDUTCdecimal1721057.5–2500000.5day(none, overrides data+hora)numeric, rangeMeeus 1998
mjd_inputMJDdecimal−179000 to 100000day(none)numeric, rangeSOFA
jd_tt_inputJDTTdecimal1721057.5–2500000.5day(none)numeric, rangeIERS 2010
jd_ut1_inputJDUT1decimal1721057.5–2500000.5day(none)numeric, rangeIERS 2010
jd_tai_inputJDTAIdecimal1721057.5–2500000.5day(none)numeric, rangeBIPM
cjd_inputCJDdecimal±1e7day(none)numericchronological JD
calendar_systemenumgregorian | juliangregorianwhitelistISO 8601 / Calendar Reform 1582
Table 4.2 — Time corrections
ParameterSymbolTypeDomainUnitDefaultValidationReference
dt_modeenumauto | manualautowhitelistEspenak & Meeus 2006
dt_secondsΔTdecimal−500 to 5000s69.0numericEspenak & Meeus 2006
ut1_utcDUT1decimal−0.9 to 0.9s0.0numeric, |x| < 0.9IERS Bulletin A
tai_utcΔATdecimal0 to 60s37.0 (epoch 2026)numericBIPM, IERS
polar_motion_xp_arcsecxpdecimal−1 to 1arcsec0.0numericIERS Conventions 2010
polar_motion_yp_arcsecypdecimal−1 to 1arcsec0.0numericIERS Conventions 2010
Table 4.3 — Observer location
ParameterSymbolTypeDomainUnitDefaultValidationReference
latφdecimal−90 to 90degvia IP geo / Brasilia −15.78numeric, clampWGS84
lonλdecimal−180 to 180degvia IP geo / Brasilia −47.93numeric, clampWGS84
althdecimal−500 to 9000m0numericWGS84 ellipsoidal height
tzIANA tzany IANA zoneinfo stringAmerica/Sao_PauloDateTimeZoneIANA tzdata
observer_modeenumtopocentric | geocentrictopocentricwhitelistMeeus 1998
Table 4.4 — Atmosphere (basic)
ParameterSymbolTypeDomainUnitDefaultValidationReference
refractionboolean0 / 11parsed as 0/1Bennett 1982
pressurePdecimal500–1100hPa1013.25numericICAO Standard Atmosphere
tempTdecimal−80 to 60°C20.0numericICAO Standard Atmosphere
humidityRHdecimal0–100%60.0numericICAO Standard Atmosphere
refraction_modelenumbennett | saemundsson | nonebennettwhitelistBennett 1982 / Saemundsson 1986
wavelength_nmλobsdecimal300–1100nm550numeric, clampCauchy refractivity
Table 4.5 — Atmosphere (advanced)
ParameterSymbolTypeDomainUnitDefaultValidationReference
lapse_rateΓdecimal0–15K/km6.5numericICAO Standard Atmosphere
ozone_duO3decimal100–600DU300numericWMO standard
water_vapor_mmPWVdecimal0–100mm10numericradiosonde climatology
aod_550AODdecimal0–50.15numericAERONET reference
cloud_cover_pctdecimal0–100%0numericMETAR convention
Table 4.6 — Engine and model selection
ParameterTypeValuesDefaultReference
engine_modeenumlite | de440 | autoautointernal
apparent_modeenumapparent | geometricapparentMeeus 1998
nutation_modelenumiau1980 | iau2000aiau2000aWahr 1981 / Mathews 2002
precession_modelenumiau1976 | iau2006iau2006Capitaine 2003
aberration_modelenumannual | annual_diurnalannual_diurnalSmith 1980
frame_modeenumequinox | cioequinoxIERS 2010
Table 4.7 — Frame extras and Earth model
ParameterTypeValues / domainDefaultReference
frame_originenumequinox | cioequinoxIERS 2010
frame_epochenumj2000 | mean_of_date | true_of_date | icrsj2000IERS 2010
frame_versionenumiau1976 | iau2006iau2006Capitaine 2003
frame_corrections[]setany of nutation, precession, aberration, parallax, deflection, galactic_aberrationall but galacticSOFA polyfill
earth_modelenumwgs84 | grs80 | iers2010wgs84WGS84 / IERS 2010
geoid_modelenumegm2008 | egm96 | nonenoneNGA EGM2008
Table 4.8 — Astrometric corrections
ParameterTypeDomainDefaultReference
catalogenumicrf3 | icrf2icrf3IAU 2018
proper_motion_pmradecimal±100,0000mas/yr (target object only)
proper_motion_pmdecdecimal±100,0000mas/yr (target object only)
parallax_masdecimal0–10000mas (target object only)
gravitational_deflectionboolean0 / 11 (when SOFA polyfill loaded)IERS 2010 Section 5.2
Table 4.9 — Search refinements (eclipse, conjunctions, occultations)
ParameterTypeDomainDefaultReference
eclipse_yearsinteger1–505internal search window
apsides_monthsinteger1–3612internal search window
special_monthsinteger1–6024super/micro-Moon window
upcoming_phasesinteger1–124principal phases ahead
alt_hoursinteger6–7224altitude timeline span
alt_stepinteger5–12030min between altitude samples
occultation_threshold_arcsecdecimal0–72001800limit angular separation
conjunction_threshold_degdecimal0–305limit elongation
Table 4.10 — Equipment (informational, used only by astrophotography view)
ParameterTypeUnitDefaultNotes
aperture_mmdecimalmm0not used by science engine
focal_mmdecimalmm0plate scale only
sensor_w_mmdecimalmm0FOV only
sensor_h_mmdecimalmm0FOV only
pixel_umdecimalµm0plate-scale only
Table 4.11 — Output formatting
ParameterTypeValuesDefault
output_angle_formatenumdecimal | sexagesimaldecimal
output_unit_distanceenumkm | au | earth_radii | thousand_kmkm
output_frameenumj2000 | icrs | mean_of_date | true_of_datej2000
languageenumpt_br | en | espt_br
show_formulasboolean0 / 10
Table 4.12 — Display filters (qty_*) — JPL-Horizons-style on/off toggles
ParameterCard it controls
qty_positionRA/Dec/elongation card
qty_topocentricAlt/Az/HA topocentric card
qty_distanceDistance, parallax, light-time card
qty_phasePhase, age, illumination, magnitude card
qty_librationOptical libration card
qty_selenographicSub-Earth, sub-solar, colongitude card
qty_extendedExtended phases / Brown lunation
qty_state_vectorPosition + velocity ICRS state vector
qty_uncertaintyRSS uncertainty budget table
qty_de440DE440 vs lite engine comparison
qty_ephemeris30-day monthly ephemeris table
qty_bibliographyAPA bibliography card
qty_tracking_ratesRA/Dec rates, az/alt rates
qty_anomalisticAnomalistic position card
qty_apparent_correctionsPer-correction breakdown
qty_active_modelsList of active models for this run
qty_solar_referenceSolar reference frame card
qty_tidesTidal acceleration / lunar perigee shift
qty_snapshotJSON snapshot of all inputs
qty_equation_of_timeEquation of time card
qty_sidereal_timeGMST/GAST/LST card
qty_kinematicsVelocity vector decomposition
qty_advanced_correctionsSchwarzschild, Lense-Thirring, galactic aberration breakdown

Three further input groups exist but are documented in the live tool itself rather than reproduced here, since they are auxiliary: (i) cookie/session (preferred location, language preference); (ii) UTM tracking (passed through unchanged); (iii) API output mode (handled by the /api/fases-da-lua-cientifica/v1 endpoint). All three groups are not part of the scientific contract and have no impact on numerical results.

5. Output Specifications

Each output card in the calculator has a stable, machine-readable name. The table below lists all cards documented at the time of writing and gives, for each, the quantities it provides, their units, the 1σ uncertainty (where defined), and the engine module that produces them.

Card nameQuantities (symbol — unit)1σ precisionEngine moduleReference
spotlightphase name, illuminated fraction (k — %), age (τ — days), distance (Δ — km), magnitude (m — mag), apparent diameter (s — arcmin)k: 0.1%; τ: 30 s; Δ: 1 km; m: 0.1; s: 0.5"Moon::geocentricMeeus 1998 Ch. 47
position-equatorialRA (α), Dec (δ), elongation (ε)~5"Moon::apparentEquatorialELP-2000/82B
position-topocentricazimuth (A), altitude (h), hour angle (H), refraction~6"Frames::gcrsToTopocentricIERS 2010 Ch. 5
distancegeocentric Δ, topocentric Δtopo, R/R, light-time1 km / 30 mMoon::distanceELP-2000/82B
phase-extendedilluminated fraction k, age τ, brown lunation N, sub-solar lonk: 0.1%Moon::phaseMeeus 1998 Ch. 49
librationlibration in longitude (L), libration in latitude (b), bright limb angle χ0.5° / 0.5° / 1°LibrationPhysicalEckhardt 1981
selenographicselenographic colongitude (C), sub-Earth lat/lon, sub-solar lat/lon0.1°SelenographicIAU WGCCRE 2009
state-vectorrx, ry, rz (km); vx, vy, vz (km/s) ICRS J2000~3 km / 2 m/sMoon::stateVectorMeeus 1998
de440-comparisonΔRA (mas), ΔDec (mas), Δrange (km) lite vs DE4401 mas (DE440 reference)De440ReaderPark et al. 2021
uncertaintyRSS angular (mas), RSS distance (km), per-source breakdownself-quotedUncertaintyBudgetthis document, Section 7
monthly-ephemeris30-day table of date, JD, RA, Dec, distance, phase, illuminationmatches engineEphemerisTableMeeus 1998 Ch. 47
events-rise-setmoonrise, transit, moonset (HH:MM:SS local)30 sRiseSet::moonMeeus 1998 Ch. 15
events-eclipses-lunarlist of next eclipses (date, magnitude, type, visibility)~1 minEclipses::lunarEspenak & Meeus 2006
events-eclipses-solarlist of next eclipses (date, magnitude, type, central path)~1 minEclipses::solarEspenak & Meeus 2006
events-apsidesperigee/apogee (date, distance, lunation)1 km / 1 minApsidesMeeus 1998 Ch. 50
events-supermoonssuper/micro-Moons (date, distance, illumination)1 kmSpecialMoonsNolle 1979 / IAU informal
tracking-ratesdα/dt, dδ/dt (arcsec/min); dA/dt, dh/dt0.05"/minMoon::velocitynumerical differentiation
active-modelslist of model IDs in use (engine, nutation, precession, ...)EngineProvenanceinternal
solar-referenceSun RA, Dec, elongation; declination of Sun on date~13"Sun::apparentVSOP87D
tidestidal recession of the Moon (mm/yr), nodal regression (deg/yr)0.1 mm/yrTidesWilliams & Boggs 2016
snapshotJSON snapshot of all inputsInputSnapshotinternal
equation-of-timeEoT (minutes), Sun true-mean anomaly difference30 sSun::equationOfTimeMeeus 1998 Ch. 28
sidereal-timeGMST (h), GAST (h), LST (h)1 msSiderealTimeIAU 2006 / Capitaine 2003
kinematicsv_radial, v_transverse, v_total; |v|; angle to ecliptic2 m/sMoon::kinematicsnumerical differentiation
advanced-correctionsSchwarzschild, Lense-Thirring, galactic aberration components in arcsec0.001"HigherOrderGRIERS 2010 Section 5.2; Klioner 2003
frame-bias3x3 matrix B1e-12 (machine)Frames::BIERS 2010 Eq. 5.20
precession-matrix3x3 matrix P1e-12 (machine)Frames::PCapitaine 2003
nutation-matrix3x3 matrix N1e-12 (machine)Frames::NIAU 2000A
npb-matrix3x3 matrix NPB1e-12 (machine)Frames::NPBIERS 2010
polar-motion3x3 matrix W (xp, yp, s')0.1 masFrames::WIERS 2010
eraERA(UT1) (rad)1e-9SiderealTime::ERACapitaine 2003
delta-t-infoΔT (s), source (auto/manual), bulletin date0.1 sTimeScales::deltaTEspenak & Meeus 2006
iers-snapshotDUT1 (s), ΔAT (s), bulletin issue date0.001 sIersBulletinAIERS Bulletin A
magnitudeapparent V magnitude0.1 magMoon::magnitudeAllen 1976
angular-diametertopocentric apparent diameter (arcmin)0.5"Moon::angularDiameterMeeus 1998 Ch. 47
parallaxhorizontal parallax π (deg)0.5"Moon::parallaxMeeus 1998 Ch. 47
brown-lunationBrown lunation numberintegerBrownLunationBrown 1933
elongationelongation Moon–Sun (deg), phase angle (deg)0.01°Geometry::elongationMeeus 1998
moonrise-azimuthazimuth of rise/set (deg)0.1°RiseSet::moonMeeus 1998 Ch. 15
night-illuminated-fractionfraction of nighttime with Moon above horizon1 minNightFractioninternal
twilight-contextcivil/nautical/astronomical twilight times30 sTwilightUSNO standard
upcoming-phasesnext 4 principal phases (date, lunation, illumination)30 sPrincipalPhasesMeeus 1998 Ch. 49
year-distance-curveweekly Moon distance over 12 months (km)1 kmYearDistanceinternal sampling
altitude-timelinealtitude vs time over user-specified window0.1°AltitudeTimelineinternal sampling
brightness-historymagnitude vs phase angle0.1 magBrightnessHistoryAllen 1976
provenanceengine ID, model IDs, input hash, versionEngineProvenanceinternal
permalinkcanonical URL with current inputsPermalinkinternal
hashSHA-256 of canonical-sorted inputs + engine name@versionRepHashthis document, Section 10
json-exportfull structured payloadJsonExportinternal

The list above counts 50 cards. Cards are typed: each value carries a unit and a quoted 1σ uncertainty (where applicable) so that downstream consumers do not have to re-derive precision from context.

6. Coordinate Systems & Frames

6.1 ICRS / J2000.0

The International Celestial Reference System is the kinematically non-rotating reference system aligned with the directions to a set of extragalactic radio sources defining the ICRF (currently ICRF3). Its z-axis is approximately the J2000.0 mean equator pole; its x-axis points to the J2000.0 mean equinox to within a small frame bias (Section 6.2). All ephemerides emitted in ICRS / J2000.0 are independent of the Earth's orientation and rotation and are therefore the natural archival frame.

6.2 Frame Bias

The constant rotation that aligns the ICRS axes onto the J2000.0 mean equator and equinox of date t = J2000 is the frame-bias matrix B. Its three elementary angles are tiny (~0.041" in ξ0, ~−0.017" in η0, ~−0.078" in dα0). It is computed once per session.

6.3 Mean of date / true of date / of date

Mean of date applies precession only (rotation by IAU 2006 P03 from J2000 to t); true of date applies precession then nutation (IAU 2000A); the loose phrase of date is here taken to mean true of date unless explicitly modified. The product matrix NPB = N(t) · P(t) · B implements GCRS → true equator and equinox of date.

6.4 ITRS / WGS84

The International Terrestrial Reference System is the Earth-fixed, co-rotating frame; WGS84 is the de-facto realisation used by GPS. Latitude/longitude/height inputs are interpreted in WGS84. Conversion ICRS → ITRS is done either equinox-based (multiplying by NPB then by the Greenwich apparent sidereal time and polar motion) or CIO-based (multiplying by Q(X, Y, s), then by R3(−ERA), then by W(xp, yp, s')).

6.5 Topocentric horizontal (alt/az)

Final user-facing frame for ground observation. Built from ITRS by translating to the observer position (from geodetic phi, lambda, h) and rotating by R3(−LST) · R2(phi − 90°). Refraction, parallax and diurnal aberration are all applied in this frame.

6.6 Selenographic

The IAU 2009 (Archinal et al. 2011) recommendations define the lunar mean rotation axis and prime meridian. The selenographic colongitude C is the longitude of the morning terminator measured eastward from the prime meridian; it advances by approximately 12.2°/day. The sub-Earth and sub-solar points are reported in selenographic latitude and longitude.

7. Uncertainty Budget (RSS analysis)

For a topocentric apparent direction the angular uncertainty is dominated by ephemeris truncation in the lite mode, and by the IERS UT1 snapshot age in the DE440 + SOFA mode. The table below is the canonical breakdown; the RSS column is the root-sum-of-squares combination, which is the conservative way to combine independent Gaussian sources.

Table 7.1 — Per-source 1σ uncertainty for the apparent topocentric direction of the Moon at epoch 2026, lite engine
Source1σ magnitudeOriginContribution to RSS (mas)
ELP-2000/82B truncation (60+60+46 terms)5"Chapront-Touzé & Chapront 198815000
VSOP87D truncation for Earth/Sun13"Bretagnon & Francou 198821300 (acts on Sun direction; impacts Moon–Sun elongation only)
Nutation IAU 2000A truncated to 50 terms0.5 masMathews et al. 200260.5
Precession IAU 2006 P030.1 masCapitaine et al. 200330.1
Frame bias0.01 masIERS Conventions 201040.01
Annual aberration (first order in v/c)0.16 µasSmith 1980negligible
Topocentric parallax (Moon)5 masMeeus 1998 Ch. 4785
Atmospheric refraction (Bennett, h > 15°)1"Bennett 198291000
Polar motion (xp, yp = 0)0.5 masIERS Bulletin A120.5
UT1−UTC snapshot age (1 yr)up to 5 masIERS Bulletin A5
ΔT (Espenak & Meeus extrapolation)0.5 s ↔ 7"Espenak & Meeus 200657000 (dominant outside 1972–present)
RSS total (1σ) — lite, present epoch~5"~5000 mas
RSS total (1σ) — DE440 + SOFA polyfill, present epoch~5 mas~5 mas

For the geocentric distance the budget is dominated by ELP-2000/82B truncation (~1 km) plus DE440 ASCII coefficient quantisation when the kernel is used (~10 m). For phase, the relevant quantity is the elongation Moon–Sun, whose uncertainty is at most ~6" in lite mode.

8. Validation

8.1 Against canonical Meeus 1998 worked examples

Meeus's Astronomical Algorithms, 2nd ed., contains a set of worked examples for the Moon, the Sun and the time-scale conversions. Each example is a numerical case with input epoch, expected outputs and quoted residual. The OcaLE test suite (audit/B_test_algorithms.php) reproduces 38 of these examples; at the time of writing the residuals are below 0.5" in apparent direction and below 0.1 km in distance for all 38 cases, well inside the published tolerance.

8.2 Against historical eclipses

Twelve total solar eclipses spanning 1900–2026 (selected from the NASA Espenak Five Millennium Canon database) are used as integration tests. The OcaLE eclipse module produces the start, maximum and end UT times of the umbra event; the test passes when all three are within ±1 minute of the canon. All 12 cases pass at the time of writing.

8.3 Against JPL Horizons

Cross-validation against JPL Horizons for the 2020–2030 window is in progress. A first-pass batch of 1000 random epochs (uniform in JD) shows residuals of approximately 5" in topocentric direction (lite mode) and 1 mas (DE440 + SOFA mode), consistent with the uncertainty budget. The residual log will be published as part of the next versioned release; this entry is currently marked ongoing — to be published.

8.4 Test suite reference

The full validation suite lives in the repository at audit/B_test_algorithms.php (canonical examples), audit/F_test_stress.php (extreme epochs and high-latitude observers) and lua/calculadora-lunar/test_phase11_*.php (phase-by-phase regression). All tests are pure-PHP and run without external dependencies.

9. Limitations

An honest statement of what OcaLE does not do:

  • No DE441. Only DE440 is supported as numerical fallback (1550–2650). DE441's extended ranges (−13200 to +17191) require a different kernel format and are out of scope.
  • No daily IERS update. DUT1 and Delta-AT are sourced from a per-release snapshot of IERS Bulletin A. The maximum age of the snapshot is approximately one calendar year; the implied position error is up to ~5 mas (Section 7).
  • No asteroid perturbations. The four largest asteroids (Ceres, Pallas, Vesta, Hygiea) introduce ~10 µas effects on the Moon's position and are not modelled.
  • Truncated nutation. The default nutation series is truncated to the 50 dominant terms (out of 1365), which retains 99.9% of the power. The full series is used only when the SOFA polyfill is loaded.
  • No catalog of stars. Only the Moon, the Sun and the five classical planets via VSOP87D are computed. Stellar occultations require the Hipparcos / Gaia catalogue, which is provided only by the parallel laboratorio/atlas tool.
  • Not real-time. The HTTP request/response lifecycle adds ~50 ms of latency; this is unsuitable for spacecraft navigation. Use NAIF SPICE for that.
  • Not for sub-millimetre science. Lunar Laser Ranging, gravitational-wave clock corrections and relativistic geodesy require femtosecond-grade timing and are out of scope.
  • No DE440 outside coverage. Requests outside 1550–2650 silently fall back to the lite engine; this is logged in the provenance block.
  • No partial date/time computations. A full date+time (or full JD) must be provided; ranges and astropy-style "approximate" inputs are not accepted.

10. Reproducibility

10.1 Permalink format

Every computed result is reachable by a stable URL. The permalink is the canonical tool URL with all non-default inputs included as query-string parameters, sorted lexicographically by key. For example:

https://www.ocalendario.com.br/calculadora-lunar-cientifica?data=2026-04-29&hora=00:00&lat=-15.78&lon=-47.93
  &engine_mode=auto&nutation_model=iau2000a&precession_model=iau2006
  &refraction_model=bennett&output_frame=j2000

This permalink survives session boundaries and is what the JSON output's self_url field returns.

10.2 Reproducibility hash

The reproducibility hash is a SHA-256 fingerprint of the inputs and the engine identification. It is built from the canonical-sorted list of name=value pairs (URL-decoded UTF-8), separated by line feed (0x0A), with the engine name and version appended on the final line:

canonical_blob =
  sort_lex(filter(default_drop(_GET))).join("\n")
  + "\nengine=ocale-lite@" + assets_version

hash = sha256(canonical_blob)

If two requests return the same hash, the underlying numerical computation is guaranteed to be byte-for-byte identical (modulo non-determinism in concurrent IERS snapshots, which is ruled out by the same-version constraint).

10.3 JSON output schema

The JSON output payload (returned by the API and downloadable from the calculator UI) follows a versioned schema. The top-level structure is:

{
  "$schema": "https://www.ocalendario.com.br/schema/ocale-output.v1.json",
  "version": "81.13.0.0.0",
  "inputs": { ... canonical-sorted GET params ... },
  "provenance": {
      "engine": "ocale-lite",
      "engine_version": "81.13.0.0.0",
      "models": { "nutation": "iau2000a-truncated", ... },
      "iers_snapshot": { "issue_date": "...", "delta_at": 37, "dut1": ... },
      "hash": "sha256:..."
  },
  "time_scales": { "utc": ..., "ut1": ..., "tai": ..., "tt": ..., "tdb": ... },
  "moon": { "ra_deg": ..., "dec_deg": ..., "distance_km": ..., ... },
  "topocentric": { "az_deg": ..., "alt_deg": ..., ... },
  "phase": { "name": "...", "illumination_pct": ..., "age_days": ..., ... },
  "uncertainty": { "angular_mas_1sigma": ..., "components": { ... } },
  "events": { "next_phases": [...], "next_eclipses": [...], ... },
  "self_url": "https://...permalink..."
}

10.4 Versioning policy

The site-wide assets_version field at core/site-config.php follows a five-segment scheme: MAJOR.MINOR.PATCH.BUILD.HOTFIX. Numerical results are guaranteed identical for fixed values of MAJOR.MINOR.PATCH; BUILD increments cover non-scientific patches (CSS, copywriting); HOTFIX covers emergency security or routing patches. Any change that alters a numerical output increments at least PATCH and is recorded in the changelog (Section 13).

11. References (Bibliography)

The list below is APA 7 formatted; each entry has a stable anchor (#bib-*) used by the inline footnote markers in the rest of the document. DOIs are linked when available.

  1. Chapront-Touze, M., & Chapront, J. (1988). ELP 2000-85: a semi-analytical lunar ephemeris adequate for historical times. Astronomy and Astrophysics, 190(1-2), 342-352.
  2. Bretagnon, P., & Francou, G. (1988). Planetary theories in rectangular and spherical variables: VSOP87 solution. Astronomy and Astrophysics, 202, 309-315.
  3. Capitaine, N., Wallace, P. T., & Chapront, J. (2003). Expressions for IAU 2000 precession quantities. Astronomy and Astrophysics, 412(2), 567-586. DOI: https://doi.org/10.1051/0004-6361:20031539.
  4. Petit, G., & Luzum, B. (Eds.) (2010). IERS Conventions (2010). IERS Technical Note 36, Verlag des Bundesamts fuer Kartographie und Geodaesie.
  5. Espenak, F., & Meeus, J. (2006). Five Millennium Canon of Solar Eclipses: -1999 to +3000. NASA Technical Publication TP-2006-214141.
  6. Wahr, J. M. (1981). The forced nutations of an elliptical, rotating, elastic and oceanless Earth. Geophysical Journal of the Royal Astronomical Society, 64(3), 705-727. DOI: https://doi.org/10.1111/j.1365-246X.1981.tb02691.x.
  7. Park, R. S., Folkner, W. M., Williams, J. G., & Boggs, D. H. (2021). The JPL Planetary and Lunar Ephemerides DE440 and DE441. The Astronomical Journal, 161(3), 105. DOI: https://doi.org/10.3847/1538-3881/abd414.
  8. Meeus, J. (1998). Astronomical Algorithms (2nd ed.). Willmann-Bell, Richmond, Virginia.
  9. Bennett, G. G. (1982). The calculation of astronomical refraction in marine navigation. The Journal of Navigation, 35(2), 255-259. DOI: https://doi.org/10.1017/S0373463300022037.
  10. Saemundsson, T. (1986). Astronomical refraction. Sky and Telescope, 72, 70.
  11. IAU SOFA Board (2021). IAU SOFA Software Collection: standards of fundamental astronomy. International Astronomical Union, http://www.iausofa.org.
  12. International Earth Rotation and Reference Systems Service (2024). IERS Bulletin A: rapid service / prediction of UT1-UTC and polar motion. U.S. Naval Observatory, weekly issues, https://www.iers.org.
  13. Archinal, B. A., A'Hearn, M. F., Bowell, E., Conrad, A., Consolmagno, G. J., Courtin, R., Fukushima, T., Hestroffer, D., Hilton, J. L., Krasinsky, G. A., Neumann, G., Oberst, J., Seidelmann, P. K., Stooke, P., Tholen, D. J., Thomas, P. C., & Williams, I. P. (2011). Report of the IAU Working Group on Cartographic Coordinates and Rotational Elements: 2009. Celestial Mechanics and Dynamical Astronomy, 109(2), 101–135. DOI: https://doi.org/10.1007/s10569-010-9320-4.
  14. Eckhardt, D. H. (1981). Theory of the libration of the Moon. The Moon and the Planets, 25(1), 3–49. DOI: https://doi.org/10.1007/BF00911807.
  15. Klioner, S. A. (2003). A practical relativistic model for microarcsecond astrometry in space. The Astronomical Journal, 125(3), 1580–1597. DOI: https://doi.org/10.1086/367593.
  16. Mathews, P. M., Herring, T. A., & Buffett, B. A. (2002). Modeling of nutation and precession: New nutation series for nonrigid Earth and insights into the Earth's interior. Journal of Geophysical Research, 107(B4), ETG 3-1–ETG 3-26. DOI: https://doi.org/10.1029/2001JB000390.

12. Citation

Three citation formats are provided. The DOI placeholder will be replaced by a Zenodo-issued identifier upon the next versioned release.

12.1 BibTeX

@misc{ocale_81_13_0_0_0,
  author       = {{ocalendario.com.br Astronomy Project}},
  title        = {{OcaLE: A Web-Based Lunar Ephemeris Calculator}},
  year         = {2026},
  version      = {81.13.0.0.0},
  url          = {https://www.ocalendario.com.br/calculadora-lunar-cientifica},
  howpublished = {Methodology document: \url{https://www.ocalendario.com.br/calculadora-lunar-cientifica/methodology}},
  note         = {DOI to be assigned via Zenodo upon next release}
}

12.2 APA 7

ocalendario.com.br Astronomy Project. (2026). OcaLE: A Web-Based Lunar Ephemeris Calculator (Version 81.13.0.0.0) [Software]. Methodology document: https://www.ocalendario.com.br/calculadora-lunar-cientifica/methodology. https://www.ocalendario.com.br

12.3 Plain text

ocalendario.com.br Astronomy Project (2026). OcaLE Lunar Ephemeris Calculator, version 81.13.0.0.0. Available at https://www.ocalendario.com.br/calculadora-lunar-cientifica. Methodology: https://www.ocalendario.com.br/calculadora-lunar-cientifica/methodology. DOI: pending Zenodo registration.

Citing intermediate algorithms. When citing OcaLE in a peer-reviewed paper, please also cite the underlying algorithms (ELP-2000/82B, VSOP87, IAU 2006 P03, IAU 2000A, DE440, IERS Conventions 2010) directly — OcaLE is a faithful re-implementation, not a primary source.

13. Changelog

Recent versioned releases (most-recent first). Numerical-result-changing entries are marked [NUMERIC]; pure UI/copy releases are marked [UI].

VersionDateTypeNotes
81.13.0.0.0 2026-04-30 [UI] Methodology document published in English at the canonical URL /calculadora-lunar-cientifica/methodology; sitemap, navigation and tool registry updated; hreflang alternates emitted.
81.8.x.x.x 2026-04-28 [NUMERIC] SOFA polyfill modules under core/astro/sofa/ introduced; CIO-based pipeline available behind a flag; Schwarzschild light deflection added; Lense-Thirring frame dragging added; full IAU 2000A nutation behind polyfill flag.
81.7.x.x.x 2026-04-26 [NUMERIC] DE440 SPK kernel reader added; engine selection switched to auto by default with kernel detection.
81.6.x.x.x 2026-04-22 [NUMERIC] IAU 2006 P03 precession adopted as default (replacing IAU 1976 in the lite engine); IAU 2000A nutation truncated to 50 terms made default.
81.5.x.x.x 2026-04-15 [UI] JPL-Horizons-style qty_* output filters introduced; uncertainty budget card added; reproducibility hash exposed in the JSON output.

14. Contact / Repository

Reuse encouragement. If you build a derivative work using OcaLE, you are welcome to do so under CC BY-SA. We ask that you (i) keep a link to this methodology document, (ii) cite the underlying algorithms in your output, and (iii) preserve the reproducibility-hash and version fields in any JSON exported from your derivative.

A. Glossary of Terms

The terms below are also exposed as a DefinedTermSet in the JSON-LD graph at the top of this page.

ICRS
International Celestial Reference System; the kinematically non-rotating reference system aligned with extragalactic radio sources (IAU 1997).
ICRF
International Celestial Reference Frame; realisation of ICRS by quasar positions (IERS).
GCRS
Geocentric Celestial Reference System; geocentric counterpart of ICRS (IERS Conventions 2010 Section 5.3).
ITRS
International Terrestrial Reference System; Earth-fixed, co-rotating frame (IERS Conventions 2010 Chapter 4).
CIO
Celestial Intermediate Origin; reference origin used in the new "CIO-based" Earth-rotation transformation (Capitaine 2003).
CIP
Celestial Intermediate Pole; instantaneous pole of Earth rotation (IAU 2000).
ERA
Earth Rotation Angle; the angle between the CIO and the Terrestrial Intermediate Origin, linear function of UT1.
UT1
Universal Time, Earth-rotation-based; differs from UTC by DUT1 (less than 0.9 s by definition).
TAI
International Atomic Time; the proper-time scale of the SI second realised at the geoid.
TT
Terrestrial Time; TT = TAI + 32.184 s; the independent variable for terrestrial ephemerides.
TDB
Barycentric Dynamical Time; differs from TT by periodic terms below ~2 ms.
Delta-T
Delta-T = TT - UT1; tabulated by IERS, modelled by Espenak and Meeus 2006 outside the IERS coverage window.
ELP-2000/82B
Semi-analytical lunar ephemeris by Chapront-Touze and Chapront (1988); a truncated form (60 longitude + 60 latitude + 46 distance terms) is used in the lite engine.
VSOP87D
Planetary theory by Bretagnon and Francou (1988) in heliocentric ecliptic spherical coordinates of date.
DE440
JPL Development Ephemeris 440 (Park et al. 2021); covers 1550-2650; used as fallback when the local SPK kernel is available.
NPB
Frame-Bias x Precession x Nutation matrix; transforms vectors from GCRS to the true equator and equinox of date.
IAU 2006 P03
Precession model of Capitaine, Wallace and Chapront (2003), adopted by the IAU in 2006.
IAU 2000A
Nutation model with 1365 luni-solar and planetary terms (Mathews, Herring and Buffett 2002).
SOFA
Standards of Fundamental Astronomy: the IAU-endorsed reference implementation of these models.

This document is licensed CC BY-SA 4.0. The underlying calculator code, when released, will be MIT-licensed. The document was last modified on and corresponds to OcaLE software version 81.13.0.0.0.

Hreflang alternates: this page is the canonical English entry. A Portuguese translation is planned and will be advertised at the same path with a ?lang=pt query string. The Portuguese-language calculator UI itself is reachable at /calculadora-lunar-cientifica.

📧 Found a methodology issue? Want to cite this work?

Email us at rcgwebsites@gmail.com for:

  • Errors in algorithm description, equations, or references
  • Missing citations or methodology gaps
  • Validation data against JPL Horizons / SPICE / Skyfield (we welcome cross-validation reports)
  • Citation requests (BibTeX, APA, plaintext blocks above)
  • Suggestions for additional algorithmic models (e.g., DE441, asteroid perturbations, IERS daily updates)

We reply within ~5 business days. For peer-review collaboration or independent code audit, please indicate institutional affiliation.