{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Satellites Overhead Visualization Notebook\n", "This Jupyter Notebook is meant to illustrate how the SatChecker FOV API (https://satchecker.cps.iau.org/fov) can be used with Python/Plotly to visualize all satellites overhead a given location." ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import plotly.graph_objects as go\n", "import plotly.io as pio\n", "import requests\n", "\n", "pio.renderers.default = \"notebook\"\n", "\n", "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "# Set up the FOV query parameters\n", "julian_date = 2461007.577083 # Example JD\n", "latitude = -33\n", "longitude = -117\n", "elevation = 100 # meters\n", "min_altitude = 60\n", "illuminated_only = \"true\"\n", "min_range = 0\n", "max_range = 1500000\n", "# Make the API request\n", "response = requests.get(\n", " f\"https://dev.satchecker.cps.iau.noirlab.edu/fov/satellites-above-horizon/?latitude={latitude}&longitude={longitude}&elevation={elevation}&julian_date={julian_date}&illuminated_only={illuminated_only}&min_altitude={min_altitude}&min_range={min_range}&max_range={max_range}\",\n", " timeout=60\n", ")\n", "data = response.json() " ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Total number of satellites: 102\n" ] } ], "source": [ "# Extract satellite positions\n", "satellites = {}\n", "\n", "for sat_data in data['data']:\n", " sat_key = f\"{sat_data['name']} ({sat_data['norad_id']})\"\n", " \n", " if sat_key not in satellites:\n", " satellites[sat_key] = []\n", " \n", " # Add ra, dec, and julian_date\n", " satellites[sat_key].append([\n", " sat_data['ra'],\n", " sat_data['dec'],\n", " sat_data['julian_date']\n", " ])\n", "\n", "# print total number of satellites\n", "print(f\"Total number of satellites: {len(data['data'])}\")\n" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/html": [ " \n", " " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "