Name:     python3-module-sgp4
Version:  2.23
Release:  alt1
Group:    Development/Python3
License:  MIT
Summary:  Python implementation of most recent version of the SGP4 satellite tracking algorithm
URL:      https://github.com/brandon-rhodes/python-sgp4
Packager: Alexander Lubyagin <dfpl@altlinux.org>
Source:   %name-%version.tar

BuildRequires(pre): rpm-macros-python3
BuildRequires:  python3-module-setuptools
BuildRequires:  python3-module-numpy
BuildRequires:  gcc-c++

%description
Track Earth satellites given TLE data, using up-to-date 2020 SGP4 routines.

This package compiles the official C++ code from Revisiting Spacetrack Report #3
(AIAA 2006-6753) - specifically, the 2023 May 09 release from David Vallado's
Fundamentals of Astrodynamics and Applications webpage - and uses it to compute
the positions of satellites in Earth orbit. Satellite orbital elements can be
loaded from either a legacy TLE file or from a modern OMM element set, both
of which you can fetch from a site like CelesTrak.

Note that the SGP4 propagator returns raw x,y,z Cartesian coordinates
in a "True Equator Mean Equinox" (TEME) reference frame that's centered
on the Earth but does not rotate with it - an "Earth centered inertial" (ECI)
reference frame. The SGP4 propagator itself does not implement the math
to convert these positions into more official ECI frames like J2000 or
the ICRS, nor into any Earth-centered Earth-fixed (ECEF) frames like the ITRS,
nor into latitudes and longitudes through an Earth ellipsoid like WGS84.
For conversions into these other coordinate frames, look for a comprehensive
astronomy library, like the Skyfield library that is built atop this one.

%prep
%setup

%build
python3 setup.py build

%install
python3 setup.py install --root=%buildroot

%check
#tox_check
python3 -m unittest discover sgp4


%files
%python3_sitelibdir/sgp4/
%exclude %python3_sitelibdir/sgp4/*.TLE
%exclude %python3_sitelibdir/sgp4/*.xml
%exclude %python3_sitelibdir/sgp4/*.csv
%exclude %python3_sitelibdir/sgp4/tests.py
%python3_sitelibdir/sgp4-*.egg-info/

%changelog
* Wed Jul 31 2024 Alexander Lubyagin <dfpl@altlinux.org> 2.23-alt1
- 2.23
