Skip to main content
Glama
constellation_demo.py1.45 kB
import sys import os from datetime import datetime import pytz # Add project root to python path so we can import src project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) if project_root not in sys.path: sys.path.insert(0, project_root) from src.celestial import get_constellation_center from src.utils import create_earth_location def main(): print("Constellation Finder Demo") print("=========================") # Example Location: New York City lat = 40.7128 lon = -74.0060 city = "New York City" # Current Time (UTC) now = datetime.now(pytz.UTC) print(f"Location: {city} (Lat: {lat}, Lon: {lon})") print(f"Time: {now.strftime('%Y-%m-%d %H:%M:%S %Z')}") print("-" * 50) loc = create_earth_location(lat, lon) targets = ["Orion", "Ursa Major", "Cassiopeia", "Southern Cross", "Polaris"] print(f"{'Constellation':<15} | {'Altitude':<10} | {'Azimuth':<10} | {'Status'}") print("-" * 65) for target in targets: try: info = get_constellation_center(target, loc, now) alt = info["altitude"] az = info["azimuth"] status = "Visible" if alt > 0 else "Below Horizon" print(f"{target:<15} | {alt:<10.1f} | {az:<10.1f} | {status}") except Exception as e: print(f"{target:<15} | {'Error: ' + str(e)}") if __name__ == "__main__": main()

Latest Blog Posts

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