Solar local circumstances
Calculate C1–C4 contacts, local maximum, magnitude, disc-overlap obscuration, solar altitude and azimuth.
A modular Python toolkit for calculating, analysing, mapping and validating solar and lunar eclipses.
Numerical astronomy separated from application runtime code. Structured Python results, explicit model assumptions and reproducible validation workflows.
EclipseKit is a Python library, not a graphical eclipse simulator. It has no built-in GUI; developers use its API and command-line validation tools inside their own workflows.
from eclipsekit import EclipseEngine, Observer
engine = EclipseEngine.from_jpl("de440s")
observer = Observer(
latitude=42.6,
longitude=-5.5703,
name="León",
)
result = engine.calculate_local(
observer, "2026-08-12"
)
if result is not None:
print(result.to_dict())EclipseKit combines local solar-eclipse circumstances, geocentric and topocentric lunar-eclipse calculations, direct JPL-ephemeris shadow geometry, Besselian-element calculations, lunar-topography interfaces, observation planning, geospatial exports and scientific-reference validation.
*Recorded validation result for version 0.1.0a1 and the specific fixtures, kernel, time-scale settings and tolerances described in the README. It is not a universal accuracy or scientific-certification claim.
The package exposes reusable Python objects and keeps its numerical assumptions explicit.
Calculate C1–C4 contacts, local maximum, magnitude, disc-overlap obscuration, solar altitude and azimuth.
Compute WGS84 shadow-axis intersections, central paths, umbral and penumbral corridor boundaries.
Classify penumbral, partial and total eclipses, calculate P1/U1/U2/maximum/U3/U4/P4 contacts and local visibility.
Run a separate calculation path from explicitly supplied published polynomial elements.
Use lunar-limb models and tiled PDS3/PDS4, GeoTIFF or JPEG 2000 DEM readers, with optional adapters.
Export GeoJSON, CSV and KML, compare observation sites and search caller-supplied city catalogues.
Propagate explicit covariance budgets using finite differences or seeded Monte Carlo sampling.
Compare named reference fixtures, shadow paths and Besselian results while recording configuration and provenance.
Use the curated eclipsekit.api surface, runtime diagnostics, strict JSON helpers and explicit extension loading.
Solar workflows range from observer-specific circumstances to global track and corridor calculations. Geometry is tied to explicit ephemeris and reference-model choices.
Calculate a central shadow path and corridor on the WGS84 reference ellipsoid, then export geometry for GIS workflows. Terrain clipping, atmospheric effects and lunar-limb topography are not implicitly applied.
Search local events and caller-supplied city catalogues, or compare candidate observing sites using transparent, weather-agnostic heuristic scores.
from eclipsekit import EclipseEngine, Observer
engine = EclipseEngine.from_jpl("de440s")
observer = Observer(
latitude=42.6,
longitude=-5.5703,
name="León",
)
result = engine.calculate_local(observer, "2026-08-12")
if result is not None:
print(engine.format_report(result))
print("C1:", result.contacts.c1)
print("Obscuration:", result.obscuration_percent)
print(result.to_dict())The named JPL kernel is downloaded on first use when it is not already cached. A local BSP/SPK path can also be supplied.
The lunar workflow includes geocentric contacts and classification, then a separate observer-specific visibility calculation that clips phase intervals at moonrise and moonset.
Supports the P1, U1, U2, maximum, U3, U4 and P4 events where applicable, with penumbral, partial and total classification. The default Herald–Sinnott shadow prescription includes an empirical atmospheric layer; it is not a resolved atmospheric-opacity model.
Accounts for observer location, elevation, optional refraction and a caller-supplied horizon profile. Local moonrise and moonset determine visibility boundaries, not replacements for global eclipse contacts.
Provides tiled access to supported lunar DEM products, virtual frame-aware queries and coverage-aware mosaic routing without silently rewriting source rasters.
Requires source frame, longitude convention, reference radius and vertical datum to be explicit. Optional neural lunar-limb correction is experimental and needs independent evidence.
EclipseKit is published on PyPI. The --pre flag allows pip to select the current Alpha pre-release.
python -m pip install --pre eclipsekit
python -m pip install eclipsekit==0.1.0a1
Core dependencies are installed automatically:
# GeoTIFF and JPEG 2000 DEM adapters (Rasterio/GDAL) python -m pip install --pre "eclipsekit[raster]" # Neural lunar-limb integration (PyTorch; checkpoint not included) python -m pip install --pre "eclipsekit[limb]"
Check the installed package and dependencies:
python -m pip show eclipsekit python -m pip check
New integrations can group numerical assumptions into immutable configuration objects. Ephemeris, Earth orientation, contact radii, solver tolerances and atmospheric refraction remain explicit and serializable.
from eclipsekit import (
EclipseEngine, EclipseConfig, EphemerisConfig,
EarthOrientationConfig, ContactModelConfig,
SolverConfig, AtmosphereConfig, Observer,
)
config = EclipseConfig(
ephemeris=EphemerisConfig.jpl(
"de440s",
earth_orientation=EarthOrientationConfig.iers(),
),
contacts=ContactModelConfig(),
solver=SolverConfig(
root_tolerance_seconds=1e-5,
root_max_iterations=100,
minimum_tolerance_seconds=0.05,
),
atmosphere=AtmosphereConfig(
refraction_enabled=True,
pressure_mbar=1013.25,
temperature_c=15.0,
),
)
engine = EclipseEngine(config=config)
result = engine.calculate_local(Observer(42.6, -5.5703), "2026-08-12")Legacy constructor keywords remain available for compatibility. Do not combine config= with legacy constructor overrides.
| Configuration | Purpose |
|---|---|
EphemerisConfig.jpl("de440s") | Select a named JPL kernel; local BSP/SPK paths are also supported. |
EarthOrientationConfig.builtin() | Use Skyfield's bundled time-scale tables for an offline-friendly default. |
EarthOrientationConfig.iers() | Use the IERS table workflow; first use may require network access. |
ContactModelConfig() | Use the current spherical-disc contact model. |
SolverConfig(...) | Set root-solver tolerances and iteration limits. |
AtmosphereConfig(...) | Make refraction and station atmosphere assumptions explicit. |
The README documents package-level smoke tests and a bundled reference-validation run using a stated environment, kernel, fixture set, time-scale source and tolerances.
eclipsekit 0.1.0a1Reported subsets include local solar circumstances, geocentric maximum times, NASA central-line path samples and a 1999 Besselian regression.
Validation is tied to named fixtures and configured tolerances. The repository records the source references, model settings and execution environment so results can be reproduced and interpreted in context.
A passing fixture set does not imply that every feature, location, epoch or physical model is independently validated.
eclipsekit-validate --kernel de440s \ --path-samples 301 \ --json-out reports/reference-validation.json \ --markdown-out reports/reference-validation.md
The complete validation workflow and required fixture paths are described in the repository README and documentation.
New integrations should prefer eclipsekit.api. Existing imports from eclipsekit remain supported. The package includes a PEP 561 py.typed marker.
The project documents pytest, Ruff, compile checks, wheel building and CI across Python 3.10–3.12 on Ubuntu, Windows and macOS.
Detailed equations, methodology, schemas, API contracts, validation and known limitations are maintained in the repository's docs/ directory.
The project intentionally distinguishes software tests, reference agreement and scientific certification.
For detailed release gates, consult the Alpha release requirements and scientific 1.0 certification criteria.
Install the package, inspect the source or read the detailed scientific and API documentation.