A topography analysis system for astronomy enthusiasts
Project description
Astronomy AI - Topography Analysis System
A simple and powerful system for analyzing locations for astronomy purposes, including elevation data and telescope obstruction analysis.
🚀 Quick Start
Step 1: Install Dependencies
pip install requests
Step 2: Run the System
python demo.py
📋 Features
- Elevation Analysis - Get elevation data for any location
- Location Parsing - Supports addresses and coordinates
- Quality Assessment - Evaluates location quality for astronomy
- Recommendations - Provides telescope orientation suggestions
- Multiple APIs - Uses free elevation and geocoding services
🛰️ Model Context Protocol (MCP) Server
The Astronomy Topography System includes a built-in Model Context Protocol (MCP) server for advanced integrations and automation.
What is the MCP Server?
- The MCP server allows external programs to connect via TCP and send analysis requests in real time.
- It uses a standard protocol for context management, configuration, and model execution.
- Useful for automation, remote control, or integrating with other AI/ML systems.
How to Start the MCP Server
From your project directory, run:
python -m astronomy_topography_system.src.mcp_server
Or, if you expose it via a CLI or entry point, use that command.
Configuration
- The server reads its settings from
mcp_config.json(host, port, model parameters, etc.). - Example config (
src/mcp_config.json):{ "model": "TopographySystem", "server": { "host": "127.0.0.1", "port": 65432 }, "model_parameters": { "radius_km": 10, "observer_height": 2.0, "telescope_height": 1.5 }, "user_input_mode": "manual", "logging": { "level": "INFO", "log_to_file": false } }
Protocol
- Client sends:
{ "context": {"user": "test"}, "query": "51.5, -0.1" }
- Server responds:
{ "result": { ...analysis result... } }
- All messages are JSON and newline-terminated (
\n).
Example Client (Python)
import socket, json
s = socket.create_connection(("127.0.0.1", 65432))
msg = json.dumps({"context": {"user": "test"}, "query": "51.5, -0.1"}) + "\n"
s.sendall(msg.encode())
resp = s.recv(4096)
print(resp.decode())
s.close()
Extending the MCP Server
- You can implement your own model by following the
ModelContextProtocolinterface inmodel_context_protocol.py. - The default model is
TopographySystem, but you can swap in your own for custom logic.
🎯 How to Use
-
Run the program:
python demo.py -
Enter a location:
- Address: "Mount Wilson Observatory, California"
- Coordinates: "34.0522, -118.2437"
- City: "Denver, Colorado"
-
Get results:
- Elevation data
- Location quality assessment
- Telescope recommendations
- Suggestions for better viewing
📊 Example Output
🌌 Astronomy AI - Topography Analysis System
==================================================
Example locations you can analyze:
1. Mount Wilson Observatory, California
2. 40.7589, -73.9851
3. 34.0522, -118.2437
4. Denver, Colorado
5. Flagstaff, Arizona
Or enter your own location (address or coordinates):
Enter location (or 'quit' to exit): Flagstaff, Arizona
🔍 Analyzing location: Flagstaff, Arizona
Fetching elevation data...
Performing analysis...
============================================================
ASTRONOMY AI - LOCATION ANALYSIS RESULTS
============================================================
📍 Location: Flagstaff, Coconino County, Arizona, USA
Coordinates: 35.1983, -111.6513
🏔️ Elevation Analysis:
Elevation: 2106m
Quality: Excellent
📊 Analysis:
Location quality: Excellent
Recommendation: High elevation - great for astronomy!
💡 Recommendations:
Location quality: Excellent
Telescope orientation: Point telescope toward the horizon for best views
💡 Suggestions:
• Current elevation: 2106m
• High elevation - great for astronomy!
• Consider checking weather conditions
• Look for areas with minimal light pollution
============================================================
🔧 Installation
Minimal Installation (Recommended)
pip install requests
Full Installation (Optional)
pip install requests python-dotenv
📁 Files
demo.py- Main applicationrequirements.txt- Python dependenciesREADME.md- This file
🌟 Features Explained
Elevation Analysis
- Fetches elevation data from multiple free APIs
- Provides elevation quality assessment
- Compares to ideal astronomy elevations
Location Parsing
- Supports various input formats:
- Full addresses: "Mount Wilson Observatory, California"
- Coordinates: "34.0522, -118.2437"
- City names: "Denver, Colorado"
Quality Assessment
- Excellent: >2000m elevation
- Good: 1000-2000m elevation
- Fair: 500-1000m elevation
- Poor: <500m elevation
Recommendations
- Telescope orientation suggestions
- Weather considerations
- Light pollution advice
- Alternative location suggestions
🔍 APIs Used
- Open-Elevation API - Primary elevation data
- USGS National Map API - Fallback elevation data
- Nominatim (OpenStreetMap) - Geocoding services
All APIs are free and don't require API keys.
🛠️ Troubleshooting
Common Issues
-
"ModuleNotFoundError: No module named 'requests'"
pip install requests
-
"Connection error"
- Check your internet connection
- Try again in a few minutes
-
"Location not found"
- Try a different location name
- Use coordinates instead of address
Getting Help
If you encounter any issues:
- Make sure you have Python 3.7+ installed
- Install the required dependencies
- Check your internet connection
- Try the example locations first
🎉 Success!
Once you see the interactive prompt, you're ready to analyze locations for astronomy purposes!
Enter any location and get instant elevation data, quality assessment, and telescope recommendations.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file astronomy_topography_system-1.1.0.tar.gz.
File metadata
- Download URL: astronomy_topography_system-1.1.0.tar.gz
- Upload date:
- Size: 59.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be03a78762a96ae401b7210d7fb6a57ca52d151419d4941e6986232b91aff522
|
|
| MD5 |
1d4ac2b32cffd46c1c3dba0e2be77ed1
|
|
| BLAKE2b-256 |
c958b729b147e5c6f3c85ba563ceeeb2d5e2bc468ec6f78b87e497bb1138a09d
|
File details
Details for the file astronomy_topography_system-1.1.0-py3-none-any.whl.
File metadata
- Download URL: astronomy_topography_system-1.1.0-py3-none-any.whl
- Upload date:
- Size: 47.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64c22c7c19d65e6920cb5930bb702b140c65f93d7d2a29f6fd1b5fd94e6c3500
|
|
| MD5 |
ca4c2880964a7658823334a43d0c259d
|
|
| BLAKE2b-256 |
8ec75fd1eef26a9f9b57a93c668262f2a42f8882c0b049f881d4a52340f3a3e9
|