FastAPI-based astronomical service for real-time comet tracking
1.1K
A high-performance, FastAPI-based astronomical engine designed to calculate real-time ephemerides, visibility, and guiding rates for comets.
This service automates the complex math required to track comets. It downloads data from the Minor Planet Center (MPC) and provides precise orbital calculations adjusted for your specific location on Earth.
99.0 mag if the object is below the horizon).To run the server on your local machine or server:
docker run -d -p 8000:8000 --name comet-service <dein-nutzername>/comet-server:latest
The API will be available at http://localhost:8000.
Current position of Comet 12P (Pons-Brooks):
http://localhost:8000/calculate?designation=12P&lat=49.39&lon=10.88&output=html
This project is provided for educational and amateur astronomy purposes.
The API is accessible via HTTP on port 8000. It supports both JSON for programmatic use and HTML for visual inspection.
GET /calculate
Calculates the current position and visibility of a specific comet.
| Parameter | Type | Required | Description |
|---|---|---|---|
designation | String | Yes | Comet ID (e.g., 12P, C/2023 A3). |
lat | Float | Yes | Observer latitude (e.g., 49.39). |
lon | Float | Yes | Observer longitude (e.g., 10.88). |
datetime_str | String | No | ISO format date. Defaults to Now. |
output | String | No | json (default) or html. |
GET http://localhost:8000/calculate?designation=12P&lat=49.3&lon=11.1&output=json
GET /daily_table
Generates a 24-hour schedule for a comet at a specific location.
| Parameter | Type | Required | Description |
|---|---|---|---|
designation | String | Yes | Comet ID. |
date | String | Yes | Target date (YYYY-MM-DD). |
lat / lon | Float | Yes | Observer coordinates. |
tz | String | No | Timezone (default: UTC). |
GET /calculate_batch
Request data for multiple comets in a single call.
| Parameter | Type | Required | Description |
|---|---|---|---|
designations | String | Yes | Comma-separated list (e.g., 12P,240P). |
lat / lon | Float | Yes | Observer coordinates. |
When requesting output=json, the service returns:
magnitude_vis: Apparent magnitude adjusted for airmass/extinction. Returns 99.0 if below horizon.altitude / azimuth**: Topocentric position in degrees.ra_hms / dec_dms**: Right Ascension and Declination (formatted).guiding_ra / guiding_dec**: Tracking rates in arcsec/min for telescope mounts.earth_distance_au: Distance from Earth in Astronomical Units.Content type
Image
Digest
sha256:3bbec4238…
Size
155.2 MB
Last updated
7 months ago
docker pull klemenswal/comet-server