Skip to content

Srinivasan-Mani/GNSS_Tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GNSS Satellite Tracker - Python Edition

A real-time GNSS satellite tracking application with Python backend and minimal JavaScript frontend.

🐍 Python-Focused Architecture

This application is built with Python doing the heavy lifting:

  • Backend: Flask REST API with Skyfield for orbital calculations
  • Frontend: Minimal JavaScript (only for 3D visualization)
  • All satellite calculations done in Python

πŸš€ Quick Start

1. Install Python Dependencies

pip install -r requirements.txt

2. Run the Application

python app.py

3. Open Browser

Navigate to http://localhost:5000

πŸ“ Project Structure

satellite/
β”œβ”€β”€ app.py                  # Python Flask backend (main application)
β”œβ”€β”€ requirements.txt        # Python dependencies
β”œβ”€β”€ templates/
β”‚   └── index.html         # Flask template
β”œβ”€β”€ static/
β”‚   β”œβ”€β”€ js/
β”‚   β”‚   └── main.js        # Minimal JS (visualization only)
β”‚   └── css/
β”‚       └── style.css      # Styling

πŸ”§ Python Backend Features

API Endpoints

GET /api/satellites

Get all GNSS satellites with current positions

  • Query param: time (ISO format, optional)
  • Returns: Array of satellites with positions, velocities, etc.

GET /api/satellite/<index>/info

Get detailed information for a specific satellite

  • Query param: time (ISO format, optional)
  • Returns: Full satellite data including orbital path

GET /api/satellite/<index>/orbit

Get orbital path for visualization

  • Query param: time (ISO format, optional)
  • Returns: Array of 3D coordinates

GET /api/constellations

Get list of available GNSS constellations

  • Returns: Array of constellation metadata

Python Libraries Used

  • Flask: Web framework and REST API
  • Skyfield: High-precision satellite position calculations
  • NumPy: Numerical computations
  • Requests: TLE data fetching from CelesTrak

πŸ›°οΈ Supported GNSS Constellations

  • GPS (USA) - 31 satellites
  • GLONASS (Russia) - 24 satellites
  • Galileo (EU) - 30 satellites
  • BeiDou (China) - 35+ satellites

🎯 Key Features

Python Backend

βœ… Real-time orbital calculations using Skyfield
βœ… TLE data caching (5-minute cache)
βœ… RESTful API design
βœ… Accurate position/velocity calculations
βœ… Orbital path generation
βœ… Time travel support (any date/time)

JavaScript Frontend

βœ… 3D Earth visualization (Three.js)
βœ… Satellite point rendering
βœ… Orbital path display
βœ… Click to select satellites
βœ… Real-time updates via API

πŸ“Š Python Code Breakdown

  • app.py: 300+ lines of Python
  • main.js: ~200 lines of JavaScript (minimal)

Python handles:

  • TLE data fetching and parsing
  • Satellite position calculations (lat/lon/alt)
  • Velocity calculations
  • Orbital period calculations
  • Orbital path generation
  • Time-based propagation

JavaScript handles:

  • 3D visualization only
  • User interface interactions
  • API calls to Python backend

πŸ”¬ Example Python Usage

from app import calculate_satellite_position, parse_tle
from datetime import datetime

# Load satellites
tle_data = fetch_tle_data('gps-ops')
satellites = parse_tle(tle_data, 'gps-ops')

# Calculate position
sat = satellites[0]['satellite']
time_obj = ts.utc(2025, 11, 29, 12, 0, 0)
position = calculate_satellite_position(sat, time_obj)

print(f"Latitude: {position['latitude']}Β°")
print(f"Longitude: {position['longitude']}Β°")
print(f"Altitude: {position['altitude']} km")

🌐 API Response Example

{
  "satellites": [
    {
      "name": "GPS BIIA-10 (PRN 32)",
      "group": "gps-ops",
      "groupName": "GPS (USA)",
      "color": "#00FF00",
      "position": {
        "x": 12345.67,
        "y": -8901.23,
        "z": 15678.90
      },
      "latitude": 45.1234,
      "longitude": -122.5678,
      "altitude": 20180.5,
      "speed": 3.87
    }
  ],
  "count": 120,
  "timestamp": "2025-11-29T21:00:00"
}

πŸ”„ Data Flow

  1. User Action β†’ JavaScript frontend
  2. API Request β†’ Python Flask backend
  3. TLE Fetch β†’ CelesTrak (cached)
  4. Skyfield Calculation β†’ Satellite positions
  5. JSON Response β†’ JavaScript frontend
  6. 3D Rendering β†’ Three.js visualization

πŸ“¦ Dependencies

Python

  • flask - Web framework
  • flask-cors - CORS support
  • skyfield - Satellite calculations
  • numpy - Numerical operations
  • requests - HTTP requests

JavaScript (CDN)

  • three.js - 3D rendering
  • satellite.js - TLE parsing (minimal use)

πŸŽ“ Learning Resources

πŸ“ License

MIT License - Feel free to use for learning and projects!


Built with Python 🐍 | Powered by Skyfield & Flask

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published