astronomy-topography-system


Nameastronomy-topography-system JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://github.com/astronomy-ai/topography-system
SummaryA topography analysis system for astronomy enthusiasts
upload_time2025-07-10 09:31:13
maintainerNone
docs_urlNone
authorAstronomy AI Team
requires_python>=3.7
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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
```bash
pip install requests
```

### Step 2: Run the System
```bash
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:
```bash
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`):
  ```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:**
  ```json
  { "context": {"user": "test"}, "query": "51.5, -0.1" }
  ```
- **Server responds:**
  ```json
  { "result": { ...analysis result... } }
  ```
- All messages are JSON and newline-terminated (`\n`).

### Example Client (Python)
```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 `ModelContextProtocol` interface in `model_context_protocol.py`.
- The default model is `TopographySystem`, but you can swap in your own for custom logic.

---

## 🎯 How to Use

1. **Run the program:**
   ```bash
   python demo.py
   ```

2. **Enter a location:**
   - Address: "Mount Wilson Observatory, California"
   - Coordinates: "34.0522, -118.2437"
   - City: "Denver, Colorado"

3. **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)
```bash
pip install requests
```

### Full Installation (Optional)
```bash
pip install requests python-dotenv
```

## 📁 Files

- `demo.py` - Main application
- `requirements.txt` - Python dependencies
- `README.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

1. **"ModuleNotFoundError: No module named 'requests'"**
   ```bash
   pip install requests
   ```

2. **"Connection error"**
   - Check your internet connection
   - Try again in a few minutes

3. **"Location not found"**
   - Try a different location name
   - Use coordinates instead of address

### Getting Help

If you encounter any issues:
1. Make sure you have Python 3.7+ installed
2. Install the required dependencies
3. Check your internet connection
4. 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. 

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/astronomy-ai/topography-system",
    "name": "astronomy-topography-system",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": null,
    "author": "Astronomy AI Team",
    "author_email": "contact@astronomy-ai.com",
    "download_url": "https://files.pythonhosted.org/packages/c9/58/b729b147e5c6f3c85ba563ceeeb2d5e2bc468ec6f78b87e497bb1138a09d/astronomy_topography_system-1.1.0.tar.gz",
    "platform": null,
    "description": "# Astronomy AI - Topography Analysis System\r\n\r\nA simple and powerful system for analyzing locations for astronomy purposes, including elevation data and telescope obstruction analysis.\r\n\r\n## \ud83d\ude80 Quick Start\r\n\r\n### Step 1: Install Dependencies\r\n```bash\r\npip install requests\r\n```\r\n\r\n### Step 2: Run the System\r\n```bash\r\npython demo.py\r\n```\r\n\r\n## \ud83d\udccb Features\r\n\r\n- **Elevation Analysis** - Get elevation data for any location\r\n- **Location Parsing** - Supports addresses and coordinates\r\n- **Quality Assessment** - Evaluates location quality for astronomy\r\n- **Recommendations** - Provides telescope orientation suggestions\r\n- **Multiple APIs** - Uses free elevation and geocoding services\r\n\r\n## \ud83d\udef0\ufe0f Model Context Protocol (MCP) Server\r\n\r\nThe Astronomy Topography System includes a built-in **Model Context Protocol (MCP) server** for advanced integrations and automation.\r\n\r\n### What is the MCP Server?\r\n- The MCP server allows external programs to connect via TCP and send analysis requests in real time.\r\n- It uses a standard protocol for context management, configuration, and model execution.\r\n- Useful for automation, remote control, or integrating with other AI/ML systems.\r\n\r\n### How to Start the MCP Server\r\n\r\nFrom your project directory, run:\r\n```bash\r\npython -m astronomy_topography_system.src.mcp_server\r\n```\r\nOr, if you expose it via a CLI or entry point, use that command.\r\n\r\n### Configuration\r\n- The server reads its settings from `mcp_config.json` (host, port, model parameters, etc.).\r\n- Example config (`src/mcp_config.json`):\r\n  ```json\r\n  {\r\n    \"model\": \"TopographySystem\",\r\n    \"server\": { \"host\": \"127.0.0.1\", \"port\": 65432 },\r\n    \"model_parameters\": { \"radius_km\": 10, \"observer_height\": 2.0, \"telescope_height\": 1.5 },\r\n    \"user_input_mode\": \"manual\",\r\n    \"logging\": { \"level\": \"INFO\", \"log_to_file\": false }\r\n  }\r\n  ```\r\n\r\n### Protocol\r\n- **Client sends:**\r\n  ```json\r\n  { \"context\": {\"user\": \"test\"}, \"query\": \"51.5, -0.1\" }\r\n  ```\r\n- **Server responds:**\r\n  ```json\r\n  { \"result\": { ...analysis result... } }\r\n  ```\r\n- All messages are JSON and newline-terminated (`\\n`).\r\n\r\n### Example Client (Python)\r\n```python\r\nimport socket, json\r\ns = socket.create_connection((\"127.0.0.1\", 65432))\r\nmsg = json.dumps({\"context\": {\"user\": \"test\"}, \"query\": \"51.5, -0.1\"}) + \"\\n\"\r\ns.sendall(msg.encode())\r\nresp = s.recv(4096)\r\nprint(resp.decode())\r\ns.close()\r\n```\r\n\r\n### Extending the MCP Server\r\n- You can implement your own model by following the `ModelContextProtocol` interface in `model_context_protocol.py`.\r\n- The default model is `TopographySystem`, but you can swap in your own for custom logic.\r\n\r\n---\r\n\r\n## \ud83c\udfaf How to Use\r\n\r\n1. **Run the program:**\r\n   ```bash\r\n   python demo.py\r\n   ```\r\n\r\n2. **Enter a location:**\r\n   - Address: \"Mount Wilson Observatory, California\"\r\n   - Coordinates: \"34.0522, -118.2437\"\r\n   - City: \"Denver, Colorado\"\r\n\r\n3. **Get results:**\r\n   - Elevation data\r\n   - Location quality assessment\r\n   - Telescope recommendations\r\n   - Suggestions for better viewing\r\n\r\n## \ud83d\udcca Example Output\r\n\r\n```\r\n\ud83c\udf0c Astronomy AI - Topography Analysis System\r\n==================================================\r\n\r\nExample locations you can analyze:\r\n   1. Mount Wilson Observatory, California\r\n   2. 40.7589, -73.9851\r\n   3. 34.0522, -118.2437\r\n   4. Denver, Colorado\r\n   5. Flagstaff, Arizona\r\n\r\nOr enter your own location (address or coordinates):\r\n\r\nEnter location (or 'quit' to exit): Flagstaff, Arizona\r\n\r\n\ud83d\udd0d Analyzing location: Flagstaff, Arizona\r\nFetching elevation data...\r\nPerforming analysis...\r\n\r\n============================================================\r\nASTRONOMY AI - LOCATION ANALYSIS RESULTS\r\n============================================================\r\n\r\n\ud83d\udccd Location: Flagstaff, Coconino County, Arizona, USA\r\n   Coordinates: 35.1983, -111.6513\r\n\r\n\ud83c\udfd4\ufe0f  Elevation Analysis:\r\n   Elevation: 2106m\r\n   Quality: Excellent\r\n\r\n\ud83d\udcca Analysis:\r\n   Location quality: Excellent\r\n   Recommendation: High elevation - great for astronomy!\r\n\r\n\ud83d\udca1 Recommendations:\r\n   Location quality: Excellent\r\n   Telescope orientation: Point telescope toward the horizon for best views\r\n\r\n\ud83d\udca1 Suggestions:\r\n   \u2022 Current elevation: 2106m\r\n   \u2022 High elevation - great for astronomy!\r\n   \u2022 Consider checking weather conditions\r\n   \u2022 Look for areas with minimal light pollution\r\n============================================================\r\n```\r\n\r\n## \ud83d\udd27 Installation\r\n\r\n### Minimal Installation (Recommended)\r\n```bash\r\npip install requests\r\n```\r\n\r\n### Full Installation (Optional)\r\n```bash\r\npip install requests python-dotenv\r\n```\r\n\r\n## \ud83d\udcc1 Files\r\n\r\n- `demo.py` - Main application\r\n- `requirements.txt` - Python dependencies\r\n- `README.md` - This file\r\n\r\n## \ud83c\udf1f Features Explained\r\n\r\n### Elevation Analysis\r\n- Fetches elevation data from multiple free APIs\r\n- Provides elevation quality assessment\r\n- Compares to ideal astronomy elevations\r\n\r\n### Location Parsing\r\n- Supports various input formats:\r\n  - Full addresses: \"Mount Wilson Observatory, California\"\r\n  - Coordinates: \"34.0522, -118.2437\"\r\n  - City names: \"Denver, Colorado\"\r\n\r\n### Quality Assessment\r\n- **Excellent**: >2000m elevation\r\n- **Good**: 1000-2000m elevation\r\n- **Fair**: 500-1000m elevation\r\n- **Poor**: <500m elevation\r\n\r\n### Recommendations\r\n- Telescope orientation suggestions\r\n- Weather considerations\r\n- Light pollution advice\r\n- Alternative location suggestions\r\n\r\n## \ud83d\udd0d APIs Used\r\n\r\n- **Open-Elevation API** - Primary elevation data\r\n- **USGS National Map API** - Fallback elevation data\r\n- **Nominatim (OpenStreetMap)** - Geocoding services\r\n\r\nAll APIs are free and don't require API keys.\r\n\r\n## \ud83d\udee0\ufe0f Troubleshooting\r\n\r\n### Common Issues\r\n\r\n1. **\"ModuleNotFoundError: No module named 'requests'\"**\r\n   ```bash\r\n   pip install requests\r\n   ```\r\n\r\n2. **\"Connection error\"**\r\n   - Check your internet connection\r\n   - Try again in a few minutes\r\n\r\n3. **\"Location not found\"**\r\n   - Try a different location name\r\n   - Use coordinates instead of address\r\n\r\n### Getting Help\r\n\r\nIf you encounter any issues:\r\n1. Make sure you have Python 3.7+ installed\r\n2. Install the required dependencies\r\n3. Check your internet connection\r\n4. Try the example locations first\r\n\r\n## \ud83c\udf89 Success!\r\n\r\nOnce you see the interactive prompt, you're ready to analyze locations for astronomy purposes!\r\n\r\nEnter any location and get instant elevation data, quality assessment, and telescope recommendations. \r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A topography analysis system for astronomy enthusiasts",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "https://github.com/astronomy-ai/topography-system"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8ec75fd1eef26a9f9b57a93c668262f2a42f8882c0b049f881d4a52340f3a3e9",
                "md5": "ca4c2880964a7658823334a43d0c259d",
                "sha256": "64c22c7c19d65e6920cb5930bb702b140c65f93d7d2a29f6fd1b5fd94e6c3500"
            },
            "downloads": -1,
            "filename": "astronomy_topography_system-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ca4c2880964a7658823334a43d0c259d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 47780,
            "upload_time": "2025-07-10T09:31:11",
            "upload_time_iso_8601": "2025-07-10T09:31:11.743820Z",
            "url": "https://files.pythonhosted.org/packages/8e/c7/5fd1eef26a9f9b57a93c668262f2a42f8882c0b049f881d4a52340f3a3e9/astronomy_topography_system-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c958b729b147e5c6f3c85ba563ceeeb2d5e2bc468ec6f78b87e497bb1138a09d",
                "md5": "1d4ac2b32cffd46c1c3dba0e2be77ed1",
                "sha256": "be03a78762a96ae401b7210d7fb6a57ca52d151419d4941e6986232b91aff522"
            },
            "downloads": -1,
            "filename": "astronomy_topography_system-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "1d4ac2b32cffd46c1c3dba0e2be77ed1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 59204,
            "upload_time": "2025-07-10T09:31:13",
            "upload_time_iso_8601": "2025-07-10T09:31:13.774463Z",
            "url": "https://files.pythonhosted.org/packages/c9/58/b729b147e5c6f3c85ba563ceeeb2d5e2bc468ec6f78b87e497bb1138a09d/astronomy_topography_system-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-10 09:31:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "astronomy-ai",
    "github_project": "topography-system",
    "github_not_found": true,
    "lcname": "astronomy-topography-system"
}
        
Elapsed time: 0.97592s