Skip to main content
Glama

mcp-stargazing

mcp观星

计算地球上任何位置的天体(太阳、月亮、行星、恒星和深空天体)的高度、升起和落下时间,并可选择进行光污染分析。

特征

  • 高度/方位角计算:获取任何天体的海拔和罗盘方向。

  • 上升/下降时间:确定物体何时出现/消失在地平线以上。

  • 光污染分析:加载和分析光污染地图(GeoTIFF 格式)。

  • 支持

    • 太阳系天体(太阳、月亮、行星)

    • 星星(例如“天狼星”)

    • 深空天体(例如“仙女座”、“猎户座星云”)

  • 时区感知:使用当地时间或 UTC 时间。

安装

pip install astropy pytz numpy astroquery rasterio geopy

用法

计算高度/方位角

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}°")

计算上升/设置时间

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}")

加载光污染地图

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 参考

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

  • 输入

    • celestial_object :名称(例如, "sun""andromeda" )。

    • observer_locationEarthLocation对象。

    • timedatetime (时区感知)或 Astropy Time

  • 返回(altitude_degrees, azimuth_degrees)

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

  • 输入

    • date :时区感知的datetime

    • horizon :地平线高度(默认值:0°)。

  • 返回(rise_time, set_time)作为 UTC Time对象。

load_map(map_path)src/light_pollution.py

  • 输入

    • map_path :GeoTIFF 文件的路径。

  • 返回:光污染分析的元组(vriis_data, bounds, crs, transform)

测试

使用以下方式运行测试:

pytest tests/

关键测试用例( 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_

项目结构

. ├── 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

未来工作

  • 增加对彗星/小行星的支持。

  • 优化 SIMBAD 查询以供离线使用。

  • 将光污染数据整合到能见度预测中。

重要更新:

  1. 光污染:将light_pollution.py添加到功能和 API 参考中。

  2. 依赖项:将rasteriogeopy添加到安装说明中。

  3. 项目结构:明确文件角色和测试覆盖率。

-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

计算地球上任何位置的天体(太阳、月亮、行星、恒星和深空天体)的高度、升起和落下时间。

  1. 特征
    1. 安装
      1. 用法
        1. 计算高度/方位角
        2. 计算上升/设置时间
        3. 加载光污染地图
      2. API 参考
        1. celestial_pos(celestial_object, observer_location, time) ( src/celestial.py )
        2. celestial_rise_set(celestial_object, observer_location, date, horizon=0.0) ( src/celestial.py )
        3. load_map(map_path) ( src/light_pollution.py )
      3. 测试
        1. 关键测试用例( tests/test_celestial.py )
      4. 项目结构
        1. 未来工作
          1. 重要更新:

        Related MCP Servers

        • A
          security
          A
          license
          A
          quality
          Fetches tide information for any location using latitude and longitude, providing detailed tide data including high/low tides and station information with automatic UTC time zone handling.
          Last updated -
          1
          15
          MIT License
          • Apple
        • A
          security
          F
          license
          A
          quality
          Provides altitude-azimuth coordinates for celestial objects including planets, over 117,000 stars, and 14,000 deep sky objects based on system time and configurable location.
          Last updated -
          3
          1
          • Apple
        • A
          security
          A
          license
          A
          quality
          Provides comprehensive time manipulation capabilities including timezone conversions, date arithmetic, business day calculations, duration calculations, and recurring event handling. Enables natural language time queries with high performance and intelligent caching.
          Last updated -
          11
          1
          MIT License
        • A
          security
          F
          license
          A
          quality
          Enables users to perform tarot card readings and generate horoscopes based on specified dates, times, and locations. Provides mystical divination services through tarot draws and astrological calculations.
          Last updated -
          2

        View all related MCP servers

        MCP directory API

        We provide all the information about MCP servers via our MCP API.

        curl -X GET 'https://glama.ai/api/mcp/v1/servers/StarGazer1995/mcp-stargazing'

        If you have feedback or need assistance with the MCP directory API, please join our Discord server