Cover image
Try Now
2025-04-07

3 years

Works with Finder

1

Github Watches

0

Github Forks

0

Github Stars

mcp-stargazing

Calculate the altitude, rise, and set times of celestial objects (Sun, Moon, planets, stars, and deep-space objects) for any location on Earth, with optional light pollution analysis.

Features

  • Altitude/Azimuth Calculation: Get elevation and compass direction for any celestial object.
  • Rise/Set Times: Determine when objects appear/disappear above the horizon.
  • Light Pollution Analysis: Load and analyze light pollution maps (GeoTIFF format).
  • Supports:
    • Solar system objects (Sun, Moon, planets)
    • Stars (e.g., "sirius")
    • Deep-space objects (e.g., "andromeda", "orion_nebula")
  • Time Zone Aware: Works with local or UTC times.

Installation

pip install astropy pytz numpy astroquery rasterio geopy

Usage

Calculate Altitude/Azimuth

from src.celestial import celestial_pos
from astropy.coordinates import EarthLocation
import pytz
from datetime import datetime

# Observer location (New York)
location = EarthLocation(lat=40.7128, lon=-74.0060)

# Time (local timezone-aware)
local_time = pytz.timezone("America/New_York").localize(datetime(2023, 10, 1, 12, 0))
altitude, azimuth = celestial_pos("sun", location, local_time)
print(f"Sun Position: Altitude={altitude:.1f}°, Azimuth={azimuth:.1f}°")

Calculate Rise/Set Times

from src.celestial import celestial_rise_set

rise, set_ = celestial_rise_set("andromeda", location, local_time.date())
print(f"Andromeda: Rise={rise.iso}, Set={set_.iso}")

Load Light Pollution Map

from src.light_pollution import load_map

# Load a GeoTIFF light pollution map
vriis_data, bounds, crs, transform = load_map("path/to/map.tif")
print(f"Map Bounds: {bounds}")

API Reference

celestial_pos(celestial_object, observer_location, time) (src/celestial.py)

  • Inputs:
    • celestial_object: Name (e.g., "sun", "andromeda").
    • observer_location: EarthLocation object.
    • time: datetime (timezone-aware) or Astropy Time.
  • Returns: (altitude_degrees, azimuth_degrees).

celestial_rise_set(celestial_object, observer_location, date, horizon=0.0) (src/celestial.py)

  • Inputs:
    • date: Timezone-aware datetime.
    • horizon: Horizon elevation (default: 0°).
  • Returns: (rise_time, set_time) as UTC Time objects.

load_map(map_path) (src/light_pollution.py)

  • Inputs:
    • map_path: Path to GeoTIFF file.
  • Returns: Tuple (vriis_data, bounds, crs, transform) for light pollution analysis.

Testing

Run tests with:

pytest tests/

Key Test Cases (tests/test_celestial.py)

def test_calculate_altitude_deepspace():
    """Test deep-space object resolution."""
    altitude, _ = celestial_pos("andromeda", NYC, Time.now())
    assert -90 <= altitude <= 90

def test_calculate_rise_set_sun():
    """Validate Sun rise/set times."""
    rise, set_ = celestial_rise_set("sun", NYC, datetime(2023, 10, 1))
    assert rise < set_

Project Structure

.
├── src/
│   ├── celestial.py          # Core celestial calculations
│   ├── light_pollution.py    # Light pollution map utilities
│   ├── utils.py              # Time/location helpers
│   └── main.py               # CLI entry point
├── tests/
│   ├── test_celestial.py
│   └── test_utils.py
└── README.md

Future Work

  • Add support for comets/asteroids.
  • Optimize SIMBAD queries for offline use.
  • Integrate light pollution data into visibility predictions.

Key Updates:

  1. Light Pollution: Added light_pollution.py to features and API reference.
  2. Dependencies: Added rasterio and geopy to installation instructions.
  3. Project Structure: Clarified file roles and test coverage.

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Yasir Eryilmaz
  • AI scriptwriting assistant for short, engaging video content.

  • J. DE HARO OLLE
  • Especialista en juegos de palabras en varios idiomas.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • apappascs
  • Découvrez la collection la plus complète et la plus à jour de serveurs MCP sur le marché. Ce référentiel sert de centre centralisé, offrant un vaste catalogue de serveurs MCP open-source et propriétaires, avec des fonctionnalités, des liens de documentation et des contributeurs.

  • ShrimpingIt
  • Manipulation basée sur Micropython I2C de l'exposition GPIO de la série MCP, dérivée d'Adafruit_MCP230XX

  • huahuayu
  • Une passerelle API unifiée pour intégrer plusieurs API d'explorateur de blockchain de type étherscan avec la prise en charge du protocole de contexte modèle (MCP) pour les assistants d'IA.

  • deemkeen
  • Contrôlez votre MBOT2 avec un combo d'alimentation: MQTT + MCP + LLM

  • zhaoyunxing92
  • 本项目是一个钉钉 MCP (Protocole de connecteur de message) 服务 , 提供了与钉钉企业应用交互的 API 接口。项目基于 Go 语言开发 , 支持员工信息查询和消息发送等功能。

  • pontusab
  • La communauté du curseur et de la planche à voile, recherchez des règles et des MCP

    Reviews

    2 (1)
    Avatar
    user_Z68o4vZh
    2025-04-16

    mcp-stargazing by StarGazer1995 is a fantastic tool for all astronomy enthusiasts. Its user-friendly interface and extensive feature set make exploring the night sky both fun and educational. The GitHub page is well-documented, ensuring a smooth setup process. Highly recommended for anyone looking to enhance their stargazing experience. Check it out here: https://github.com/StarGazer1995/mcp-stargazing.