Skip to main content

stargazing-core

PyPI version Python

Shared astronomical computation package for the stargazing toolchain — telescope optics, deep-sky catalog, and equipment presets used by both mcp-stargazing and stargazing-place-finder.

Installation

pip install stargazing-core

Requires Python ≥ 3.11.

Quick Start

from stargazing_core import TelescopeConfig, TelescopeOptics, TELESCOPE_PRESETS

# Look up a preset
config = TELESCOPE_PRESETS['seestar-s50']

# Compute derived optics
optics = config.compute_optics()
print(f'FOV: {optics.fov_width_deg:.1f}° × {optics.fov_height_deg:.1f}°')
# → FOV: 1.7° × 1.3°

Modules

Module Purpose
_catalog.py 10,000+ Messier/NGC deep-sky object catalog
_celestial_models.py Pydantic models: CelestialPosition, RiseSet, MoonInfo, VisiblePlanet
_constellation.py Constellation center lookup
_coord.py Coordinate validation (validate_coordinates)
_ephemeris.py Ephemeris calculations for observing windows
_filtering.py Deep-sky object filtering pipeline
_geo.py GeoBounds / GeoPoint shared geometry types
_moon.py Moon phase / altitude / illumination
_mosaic.py Mosaic grid computation for wide-field targets
_pagination.py Generic PaginatedResult[T]
_planets.py Solar-system planet visibility
_shooting_plan.py ShootingPlan / ShootingSlot — imaging schedule engine
_telescope.py TelescopeConfig, TELESCOPE_PRESETS, match_telescope_targets
_timegrid.py Altitude curve time-grid generation

Consumers

Project Usage
mcp-stargazing get_telescope_targets, get_shooting_plan tools; shared CelestialPosition/RiseSet/MoonInfo models
stargazing-place-finder TelescopeConfig, GeoPoint, telescope target matching endpoint

Public API

All symbols are importable from the top-level package:

from stargazing_core import (
    # Telescope
    TelescopeConfig, TelescopeOptics, TELESCOPE_PRESETS,
    # Deep-sky matching
    DeepSkyCatalog, load_objects,
    match_telescope_targets, filter_candidates_by_lst, score_deep_sky_objects,
    # Shooting plan
    ShootingPlan, ShootingSlot, generate_shooting_schedule,
    # Mosaic
    MosaicPanel, MosaicGrid, compute_mosaic_grid,
    # Celestial models
    CelestialPosition, RiseSet, MoonInfo, VisiblePlanet,
    # Astronomy
    calculate_moon_info, get_moon_altaz, get_visible_planets, identify_constellation,
    # Geometry
    GeoPoint, GeoBounds, TimeInfo, validate_coordinates,
    # Time grid
    generate_time_grid, find_rise_set_indices,
    # Pagination
    PaginatedResult,
)

Compatibility

generate_shooting_schedule interprets historical naive dusk/dawn strings as UTC. An explicit ISO UTC offset preserves the instant and is converted to UTC for scheduling, including altitude-curve alignment and moonset delay. The original input strings remain echoed in dusk/dawn; slot timestamps are UTC. A nonpositive interval yields an empty plan with zero duration and a warning. These source fixes need a package release before installed consumers receive them; no version publication is included in this change.

Target ranking computes positions for the requested observing night. Missing/non-finite photometry earns no surface-brightness bonus; telescope results represent unknown magnitudes as null and keep suitability scores finite. The filter matcher recognizes common SIMBAD type codes such as OpC, HII, G, and PN as well as English object types. These source corrections require a new core package release before installed consumers receive them.

Consumer Min version Status
mcp-stargazing >=0.1.0 ✅ Active
stargazing-place-finder >=0.1.0 ✅ Active

Cross-repository CI

Changes to core run both consumer suites against a locally built core wheel. The shared baseline/candidate policy is documented in mcp-stargazing/docs/dependency-chain-ci.md.

Release

Version: 0.2.3 (PyPI)

Release process:

  1. Bump version in pyproject.toml
  2. Merge to main → auto-tag workflow creates vX.Y.Z tag
  3. Tag push triggers release-pypi.yml → OIDC Trusted Publishing to PyPI
  4. GitHub Release auto-generated

Development

uv sync
uv run pytest -v
uv run ruff format --check . && uv run ruff check .

Imaging target ranking

Equipment presets live in TELESCOPE_PRESETS, including hope_d60_asi2600mc_air. MCP keeps its existing public preset IDs and projects the shared HOPE configuration; SPF exposes the same catalog at /api/telescope/presets and loads it in the browser. Preset dimensions describe the existing configured setup, not a fresh hardware measurement.

Imaging candidates must have at least 30 consecutive sampled minutes with altitude at least 25° and the Sun at or below −18°. Samples are 15 minutes apart; both ends of each interval must pass. A bright Moon within 15° excludes that sample when illumination exceeds 0.1 and the Moon is up. Midnight and dawn altitude no longer exclude otherwise usable targets. The visual-only NGC magnitude cutoff and visual aperture magnitude limit do not constrain sensor-equipped imaging.

The base score remains 40% FOV fit + 30% surface brightness + 20% filter match + 10% mean altitude over usable samples. Multiply by 0.5 + 0.5 × min(1, longest_run_minutes / 120), then subtract the Moon penalty (when illumination >0.3: illumination × fraction of usable samples with Moon above the horizon ×0.25), clamp to zero, and multiply by 100. Scores sort descending, then dawn altitude ascending. These are heuristic choices, not calibrated exposure, SNR, weather, or success estimates. Missing photometry gets zero brightness contribution. High-latitude nights without astronomical darkness produce no imaging recommendations.

FOV fit ramps to full credit at 10% area fill. Oversized axes divide that credit by max(1, target_long/sensor_long) × max(1, target_short/sensor_short), allowing camera rotation. Tiny targets below 1% area fill are excluded; large targets remain eligible as mosaic options. Civil dusk/dawn bounds and curve fields retain their existing meanings; usable imaging time is stricter than the plotted civil night.

Catalog data and attribution

src/stargazing_core/data/objects.json remains the generic catalog authority. Imaging alone overlays pure open-cluster optical sizes from data/imaging_cluster_sizes.json; this avoids treating large membership regions as bright photographic footprints. The overlay excludes cluster+nebula entries, so it does not shrink extended nebulae to their central cluster. A missing minor axis stays null; area calculations use the documented circular approximation. Other catalog classifications, dimensions and photometry still have source limitations. AGN/Seyfert galaxy codes use the galaxy filter category, rather than an unknown-type fallback.

The overlay is an adaptation of OpenNGC, © Mattia Verga and contributors, licensed CC BY-SA 4.0 separately from this project's code. It records the exact upstream commit URL and CSV SHA-256. Transformation: select Type == OCl with positive MajAx, retain arcminute major/minor axes (blank minor → null), normalize NGC/IC IDs, and add Messier aliases from M. No coordinates or photometry are imported. The complete license is distributed in data/OPENNGC-LICENSE.txt.

Metadata

Release files for stargazing-core 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stargazing-core 0.2.3
File Size Uploaded Provenance Actions
stargazing_core-0.2.3.tar.gz 275.9 kB With provenance Details for stargazing_core-0.2.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for stargazing-core 0.2.3
File Interpreter ABI Platform Actions
stargazing_core-0.2.3-py3-none-any.whl Python 3 none any Details for stargazing_core-0.2.3-py3-none-any.whl

Total release size: 552.3 kB

Release files / stargazing_core-0.2.3.tar.gz

Download URL stargazing_core-0.2.3.tar.gz
Size 275.9 kB
Tags Source
SHA-256 checksum
How to use checksums
74e510f881229364b217ec91fb5c8cfd5c893c32a45c3c738e830e22b4eaf5ea
BLAKE2b-256 checksum
How to use checksums
6f3879c8ab2fdcf94f5729951ec9c54d060f2789ff659d1e353a3c45c768a854
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / stargazing_core-0.2.3-py3-none-any.whl

Download URL stargazing_core-0.2.3-py3-none-any.whl
Size 276.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
09e278b829b1a6b6148b6c443773ef5293bebe51828da71cbd918eaa584a631e
BLAKE2b-256 checksum
How to use checksums
811cfbbd8ff649bc18c738a3a18dd11c9535bc176636190d5ec0e5017e5d8002
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Security for stargazing-core 0.2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for stargazing_core-0.2.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page