Skip to content

g4dpz/predict4java

Repository files navigation

predict4java

Build Status License Java Maven Central codecov

Real-time satellite tracking and orbital prediction library for Java.

Overview

predict4java provides accurate real-time satellite tracking and orbital prediction using SGP4/SDP4 models. This library enables developers to:

  • Track satellites in real-time using TLE (Two-Line Element) data
  • Predict satellite passes over ground stations
  • Calculate satellite positions, velocities, and orbital parameters
  • Determine visibility windows and pass characteristics
  • Compute Doppler shift for uplink/downlink frequencies

Features

  • SGP4/SDP4 Models - Industry-standard orbital propagation
  • Pass Prediction - Calculate when satellites are visible
  • Real-time Tracking - Get current satellite positions
  • Doppler Calculation - Frequency correction for communications
  • Ground Station Support - Multiple observer locations
  • High Performance - Optimized for speed and low memory usage
  • Well Documented - Complete Javadoc and examples

C++ Port

A C++ port of predict4java is now available in the predict4cpp/ directory! The C++ version offers:

  • 🚀 7-14x faster TLE parsing
  • 💾 60% less memory usage
  • 🔧 Zero dependencies - C++17 standard library only
  • 100% accuracy match with Java implementation

See predict4cpp/QUICKSTART.md for details.

Current status: TLE parsing complete, satellite models in progress.

Quick Start

Maven Dependency

<dependency>
    <groupId>uk.me.g4dpz</groupId>
    <artifactId>predict4java</artifactId>
    <version>1.2.2</version>
</dependency>

Gradle

implementation 'uk.me.g4dpz:predict4java:1.2.2'

Basic Usage

import uk.me.g4dpz.satellite.*;

// Load TLE data
String[] tle = {
    "ISS (ZARYA)",
    "1 25544U 98067A   26045.79523799  .00007779  00000+0  15107-3 0  9994",
    "2 25544  51.6315 185.5279 0011056  98.8248 261.3993 15.48601910552787"
};

// Create satellite
TLE tleData = new TLE(tle);
Satellite satellite = SatelliteFactory.createSatellite(tleData);

// Define ground station
GroundStationPosition groundStation = new GroundStationPosition(
    52.4670,  // Latitude (degrees, North positive)
    -2.022,   // Longitude (degrees, East positive)
    200.0     // Altitude (meters above sea level)
);

// Get current position
Date now = new Date();
SatPos position = satellite.getPosition(groundStation, now);

System.out.println("Azimuth: " + Math.toDegrees(position.getAzimuth()));
System.out.println("Elevation: " + Math.toDegrees(position.getElevation()));
System.out.println("Range: " + position.getRange() + " km");

Predict Next Pass

PassPredictor predictor = new PassPredictor(tleData, groundStation);
SatPassTime nextPass = predictor.nextSatPass(new Date());

System.out.println("AOS: " + nextPass.getStartTime());
System.out.println("Max Elevation: " + nextPass.getMaxEl() + "°");
System.out.println("LOS: " + nextPass.getEndTime());

Performance Improvements (v1.2.0)

This version includes significant optimizations:

Metric Improvement
Memory Allocations 62% reduction
CPU Usage 10-15% reduction
GC Pressure 40-50% reduction
Java Version Upgraded to Java 11

Key Optimizations

  • Object Pooling - Reused Vector4 objects reduce allocations
  • Modern Dependencies - Updated to SLF4J 2.0.9, Commons Lang3 3.14.0
  • Eliminated Redundancies - Removed unnecessary synchronization
  • Bug Fixes - Fixed array copying and data handling issues

See OPTIMIZATIONS.md for detailed technical information.

Documentation

User Guides

Developer Guides

Requirements

  • Java 11 or higher
  • Maven 3.x (for building from source)

Building from Source

# Clone the repository
git clone https://github.com/g4dpz/predict4java.git
cd predict4java

# Build
mvn clean package

# Run tests
mvn test

# Install to local repository
mvn install

History

This is a Java port of the core elements of the Open Source Predict program, written by John A. Magliacane (KD2BD).

Credits

  • Dr. T.S. Kelso - Author of SGP4/SDP4 orbital models (Fortran/Pascal)
  • Neoklis Kyriazis (5B4AZ) - C translation (2002)
  • John A. Magliacane (KD2BD) - Original PREDICT program
  • David A. B. Johnson (G4DPZ) - Java port and maintenance

References

License

MIT License

Copyright (c) 2026 David A. B. Johnson

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

See LICENSE for full license text.

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes with tests
  4. Submit a pull request

See CONTRIBUTING.md for detailed guidelines.

Support

Related Projects

Acknowledgments

Special thanks to:

  • The amateur radio satellite community
  • Contributors and users of the original PREDICT program
  • All contributors to this Java port

Author

David A. B. Johnson (G4DPZ)
Email: dave@g4dpz.me.uk
GitHub: @g4dpz


Version 1.2.2 - February 16, 2026
Timezone/locale fix for international compatibility

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •