nrl-tracker 1.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (199) hide show
  1. nrl_tracker-1.0.1/CONTRIBUTING.md +339 -0
  2. nrl_tracker-1.0.1/LICENSE +42 -0
  3. nrl_tracker-1.0.1/MANIFEST.in +7 -0
  4. nrl_tracker-1.0.1/PKG-INFO +297 -0
  5. nrl_tracker-1.0.1/README.md +237 -0
  6. nrl_tracker-1.0.1/nrl_tracker.egg-info/PKG-INFO +297 -0
  7. nrl_tracker-1.0.1/nrl_tracker.egg-info/SOURCES.txt +197 -0
  8. nrl_tracker-1.0.1/nrl_tracker.egg-info/dependency_links.txt +1 -0
  9. nrl_tracker-1.0.1/nrl_tracker.egg-info/requires.txt +38 -0
  10. nrl_tracker-1.0.1/nrl_tracker.egg-info/top_level.txt +1 -0
  11. nrl_tracker-1.0.1/pyproject.toml +173 -0
  12. nrl_tracker-1.0.1/pytcl/__init__.py +76 -0
  13. nrl_tracker-1.0.1/pytcl/assignment_algorithms/__init__.py +94 -0
  14. nrl_tracker-1.0.1/pytcl/assignment_algorithms/data_association.py +355 -0
  15. nrl_tracker-1.0.1/pytcl/assignment_algorithms/gating.py +382 -0
  16. nrl_tracker-1.0.1/pytcl/assignment_algorithms/jpda.py +644 -0
  17. nrl_tracker-1.0.1/pytcl/assignment_algorithms/three_dimensional/__init__.py +24 -0
  18. nrl_tracker-1.0.1/pytcl/assignment_algorithms/three_dimensional/assignment.py +659 -0
  19. nrl_tracker-1.0.1/pytcl/assignment_algorithms/two_dimensional/__init__.py +35 -0
  20. nrl_tracker-1.0.1/pytcl/assignment_algorithms/two_dimensional/assignment.py +399 -0
  21. nrl_tracker-1.0.1/pytcl/assignment_algorithms/two_dimensional/kbest.py +568 -0
  22. nrl_tracker-1.0.1/pytcl/astronomical/__init__.py +274 -0
  23. nrl_tracker-1.0.1/pytcl/astronomical/ephemerides.py +530 -0
  24. nrl_tracker-1.0.1/pytcl/astronomical/lambert.py +574 -0
  25. nrl_tracker-1.0.1/pytcl/astronomical/orbital_mechanics.py +877 -0
  26. nrl_tracker-1.0.1/pytcl/astronomical/reference_frames.py +677 -0
  27. nrl_tracker-1.0.1/pytcl/astronomical/relativity.py +472 -0
  28. nrl_tracker-1.0.1/pytcl/astronomical/time_systems.py +743 -0
  29. nrl_tracker-1.0.1/pytcl/atmosphere/__init__.py +37 -0
  30. nrl_tracker-1.0.1/pytcl/atmosphere/models.py +343 -0
  31. nrl_tracker-1.0.1/pytcl/clustering/__init__.py +79 -0
  32. nrl_tracker-1.0.1/pytcl/clustering/dbscan.py +275 -0
  33. nrl_tracker-1.0.1/pytcl/clustering/gaussian_mixture.py +813 -0
  34. nrl_tracker-1.0.1/pytcl/clustering/hierarchical.py +495 -0
  35. nrl_tracker-1.0.1/pytcl/clustering/kmeans.py +392 -0
  36. nrl_tracker-1.0.1/pytcl/containers/__init__.py +72 -0
  37. nrl_tracker-1.0.1/pytcl/containers/cluster_set.py +775 -0
  38. nrl_tracker-1.0.1/pytcl/containers/covertree.py +419 -0
  39. nrl_tracker-1.0.1/pytcl/containers/kd_tree.py +547 -0
  40. nrl_tracker-1.0.1/pytcl/containers/measurement_set.py +453 -0
  41. nrl_tracker-1.0.1/pytcl/containers/rtree.py +506 -0
  42. nrl_tracker-1.0.1/pytcl/containers/track_list.py +477 -0
  43. nrl_tracker-1.0.1/pytcl/containers/vptree.py +308 -0
  44. nrl_tracker-1.0.1/pytcl/coordinate_systems/__init__.py +181 -0
  45. nrl_tracker-1.0.1/pytcl/coordinate_systems/conversions/__init__.py +59 -0
  46. nrl_tracker-1.0.1/pytcl/coordinate_systems/conversions/geodetic.py +631 -0
  47. nrl_tracker-1.0.1/pytcl/coordinate_systems/conversions/spherical.py +435 -0
  48. nrl_tracker-1.0.1/pytcl/coordinate_systems/jacobians/__init__.py +37 -0
  49. nrl_tracker-1.0.1/pytcl/coordinate_systems/jacobians/jacobians.py +488 -0
  50. nrl_tracker-1.0.1/pytcl/coordinate_systems/projections/__init__.py +91 -0
  51. nrl_tracker-1.0.1/pytcl/coordinate_systems/projections/projections.py +1329 -0
  52. nrl_tracker-1.0.1/pytcl/coordinate_systems/rotations/__init__.py +56 -0
  53. nrl_tracker-1.0.1/pytcl/coordinate_systems/rotations/rotations.py +793 -0
  54. nrl_tracker-1.0.1/pytcl/core/__init__.py +53 -0
  55. nrl_tracker-1.0.1/pytcl/core/array_utils.py +633 -0
  56. nrl_tracker-1.0.1/pytcl/core/constants.py +319 -0
  57. nrl_tracker-1.0.1/pytcl/core/validation.py +474 -0
  58. nrl_tracker-1.0.1/pytcl/dynamic_estimation/__init__.py +207 -0
  59. nrl_tracker-1.0.1/pytcl/dynamic_estimation/batch_estimation/__init__.py +3 -0
  60. nrl_tracker-1.0.1/pytcl/dynamic_estimation/imm.py +747 -0
  61. nrl_tracker-1.0.1/pytcl/dynamic_estimation/information_filter.py +647 -0
  62. nrl_tracker-1.0.1/pytcl/dynamic_estimation/kalman/__init__.py +111 -0
  63. nrl_tracker-1.0.1/pytcl/dynamic_estimation/kalman/extended.py +415 -0
  64. nrl_tracker-1.0.1/pytcl/dynamic_estimation/kalman/linear.py +482 -0
  65. nrl_tracker-1.0.1/pytcl/dynamic_estimation/kalman/square_root.py +1003 -0
  66. nrl_tracker-1.0.1/pytcl/dynamic_estimation/kalman/unscented.py +588 -0
  67. nrl_tracker-1.0.1/pytcl/dynamic_estimation/measurement_update/__init__.py +3 -0
  68. nrl_tracker-1.0.1/pytcl/dynamic_estimation/particle_filters/__init__.py +38 -0
  69. nrl_tracker-1.0.1/pytcl/dynamic_estimation/particle_filters/bootstrap.py +534 -0
  70. nrl_tracker-1.0.1/pytcl/dynamic_estimation/smoothers.py +664 -0
  71. nrl_tracker-1.0.1/pytcl/dynamic_models/__init__.py +110 -0
  72. nrl_tracker-1.0.1/pytcl/dynamic_models/continuous_time/__init__.py +40 -0
  73. nrl_tracker-1.0.1/pytcl/dynamic_models/continuous_time/dynamics.py +577 -0
  74. nrl_tracker-1.0.1/pytcl/dynamic_models/discrete_time/__init__.py +37 -0
  75. nrl_tracker-1.0.1/pytcl/dynamic_models/discrete_time/coordinated_turn.py +274 -0
  76. nrl_tracker-1.0.1/pytcl/dynamic_models/discrete_time/polynomial.py +223 -0
  77. nrl_tracker-1.0.1/pytcl/dynamic_models/discrete_time/singer.py +162 -0
  78. nrl_tracker-1.0.1/pytcl/dynamic_models/process_noise/__init__.py +37 -0
  79. nrl_tracker-1.0.1/pytcl/dynamic_models/process_noise/coordinated_turn.py +197 -0
  80. nrl_tracker-1.0.1/pytcl/dynamic_models/process_noise/polynomial.py +290 -0
  81. nrl_tracker-1.0.1/pytcl/dynamic_models/process_noise/singer.py +159 -0
  82. nrl_tracker-1.0.1/pytcl/gravity/__init__.py +150 -0
  83. nrl_tracker-1.0.1/pytcl/gravity/clenshaw.py +556 -0
  84. nrl_tracker-1.0.1/pytcl/gravity/egm.py +697 -0
  85. nrl_tracker-1.0.1/pytcl/gravity/models.py +484 -0
  86. nrl_tracker-1.0.1/pytcl/gravity/spherical_harmonics.py +505 -0
  87. nrl_tracker-1.0.1/pytcl/gravity/tides.py +994 -0
  88. nrl_tracker-1.0.1/pytcl/magnetism/__init__.py +89 -0
  89. nrl_tracker-1.0.1/pytcl/magnetism/emm.py +820 -0
  90. nrl_tracker-1.0.1/pytcl/magnetism/igrf.py +643 -0
  91. nrl_tracker-1.0.1/pytcl/magnetism/wmm.py +709 -0
  92. nrl_tracker-1.0.1/pytcl/mathematical_functions/__init__.py +208 -0
  93. nrl_tracker-1.0.1/pytcl/mathematical_functions/basic_matrix/__init__.py +66 -0
  94. nrl_tracker-1.0.1/pytcl/mathematical_functions/basic_matrix/decompositions.py +450 -0
  95. nrl_tracker-1.0.1/pytcl/mathematical_functions/basic_matrix/special_matrices.py +608 -0
  96. nrl_tracker-1.0.1/pytcl/mathematical_functions/combinatorics/__init__.py +49 -0
  97. nrl_tracker-1.0.1/pytcl/mathematical_functions/combinatorics/combinatorics.py +604 -0
  98. nrl_tracker-1.0.1/pytcl/mathematical_functions/continuous_optimization/__init__.py +3 -0
  99. nrl_tracker-1.0.1/pytcl/mathematical_functions/geometry/__init__.py +48 -0
  100. nrl_tracker-1.0.1/pytcl/mathematical_functions/geometry/geometry.py +677 -0
  101. nrl_tracker-1.0.1/pytcl/mathematical_functions/interpolation/__init__.py +37 -0
  102. nrl_tracker-1.0.1/pytcl/mathematical_functions/interpolation/interpolation.py +496 -0
  103. nrl_tracker-1.0.1/pytcl/mathematical_functions/numerical_integration/__init__.py +45 -0
  104. nrl_tracker-1.0.1/pytcl/mathematical_functions/numerical_integration/quadrature.py +639 -0
  105. nrl_tracker-1.0.1/pytcl/mathematical_functions/polynomials/__init__.py +3 -0
  106. nrl_tracker-1.0.1/pytcl/mathematical_functions/signal_processing/__init__.py +105 -0
  107. nrl_tracker-1.0.1/pytcl/mathematical_functions/signal_processing/detection.py +1047 -0
  108. nrl_tracker-1.0.1/pytcl/mathematical_functions/signal_processing/filters.py +839 -0
  109. nrl_tracker-1.0.1/pytcl/mathematical_functions/signal_processing/matched_filter.py +783 -0
  110. nrl_tracker-1.0.1/pytcl/mathematical_functions/special_functions/__init__.py +198 -0
  111. nrl_tracker-1.0.1/pytcl/mathematical_functions/special_functions/bessel.py +619 -0
  112. nrl_tracker-1.0.1/pytcl/mathematical_functions/special_functions/debye.py +288 -0
  113. nrl_tracker-1.0.1/pytcl/mathematical_functions/special_functions/elliptic.py +323 -0
  114. nrl_tracker-1.0.1/pytcl/mathematical_functions/special_functions/error_functions.py +313 -0
  115. nrl_tracker-1.0.1/pytcl/mathematical_functions/special_functions/gamma_functions.py +477 -0
  116. nrl_tracker-1.0.1/pytcl/mathematical_functions/special_functions/hypergeometric.py +420 -0
  117. nrl_tracker-1.0.1/pytcl/mathematical_functions/special_functions/lambert_w.py +294 -0
  118. nrl_tracker-1.0.1/pytcl/mathematical_functions/special_functions/marcum_q.py +370 -0
  119. nrl_tracker-1.0.1/pytcl/mathematical_functions/statistics/__init__.py +73 -0
  120. nrl_tracker-1.0.1/pytcl/mathematical_functions/statistics/distributions.py +656 -0
  121. nrl_tracker-1.0.1/pytcl/mathematical_functions/statistics/estimators.py +491 -0
  122. nrl_tracker-1.0.1/pytcl/mathematical_functions/transforms/__init__.py +120 -0
  123. nrl_tracker-1.0.1/pytcl/mathematical_functions/transforms/fourier.py +794 -0
  124. nrl_tracker-1.0.1/pytcl/mathematical_functions/transforms/stft.py +668 -0
  125. nrl_tracker-1.0.1/pytcl/mathematical_functions/transforms/wavelets.py +847 -0
  126. nrl_tracker-1.0.1/pytcl/misc/__init__.py +3 -0
  127. nrl_tracker-1.0.1/pytcl/navigation/__init__.py +237 -0
  128. nrl_tracker-1.0.1/pytcl/navigation/geodesy.py +666 -0
  129. nrl_tracker-1.0.1/pytcl/navigation/great_circle.py +799 -0
  130. nrl_tracker-1.0.1/pytcl/navigation/ins.py +1116 -0
  131. nrl_tracker-1.0.1/pytcl/navigation/ins_gnss.py +1086 -0
  132. nrl_tracker-1.0.1/pytcl/navigation/rhumb.py +722 -0
  133. nrl_tracker-1.0.1/pytcl/performance_evaluation/__init__.py +82 -0
  134. nrl_tracker-1.0.1/pytcl/performance_evaluation/estimation_metrics.py +476 -0
  135. nrl_tracker-1.0.1/pytcl/performance_evaluation/track_metrics.py +483 -0
  136. nrl_tracker-1.0.1/pytcl/physical_values/__init__.py +3 -0
  137. nrl_tracker-1.0.1/pytcl/plotting/__init__.py +115 -0
  138. nrl_tracker-1.0.1/pytcl/plotting/coordinates.py +653 -0
  139. nrl_tracker-1.0.1/pytcl/plotting/ellipses.py +470 -0
  140. nrl_tracker-1.0.1/pytcl/plotting/metrics.py +718 -0
  141. nrl_tracker-1.0.1/pytcl/plotting/tracks.py +789 -0
  142. nrl_tracker-1.0.1/pytcl/scheduling/__init__.py +3 -0
  143. nrl_tracker-1.0.1/pytcl/static_estimation/__init__.py +103 -0
  144. nrl_tracker-1.0.1/pytcl/static_estimation/least_squares.py +505 -0
  145. nrl_tracker-1.0.1/pytcl/static_estimation/maximum_likelihood.py +805 -0
  146. nrl_tracker-1.0.1/pytcl/static_estimation/robust.py +746 -0
  147. nrl_tracker-1.0.1/pytcl/terrain/__init__.py +128 -0
  148. nrl_tracker-1.0.1/pytcl/terrain/dem.py +722 -0
  149. nrl_tracker-1.0.1/pytcl/terrain/loaders.py +921 -0
  150. nrl_tracker-1.0.1/pytcl/terrain/visibility.py +705 -0
  151. nrl_tracker-1.0.1/pytcl/trackers/__init__.py +45 -0
  152. nrl_tracker-1.0.1/pytcl/trackers/hypothesis.py +614 -0
  153. nrl_tracker-1.0.1/pytcl/trackers/mht.py +621 -0
  154. nrl_tracker-1.0.1/pytcl/trackers/multi_target.py +349 -0
  155. nrl_tracker-1.0.1/pytcl/trackers/single_target.py +242 -0
  156. nrl_tracker-1.0.1/pytcl/transponders/__init__.py +3 -0
  157. nrl_tracker-1.0.1/setup.cfg +4 -0
  158. nrl_tracker-1.0.1/tests/__init__.py +1 -0
  159. nrl_tracker-1.0.1/tests/conftest.py +116 -0
  160. nrl_tracker-1.0.1/tests/test_additional_trees.py +394 -0
  161. nrl_tracker-1.0.1/tests/test_assignment_algorithms.py +721 -0
  162. nrl_tracker-1.0.1/tests/test_astronomical.py +464 -0
  163. nrl_tracker-1.0.1/tests/test_clustering.py +548 -0
  164. nrl_tracker-1.0.1/tests/test_coordinate_systems.py +1204 -0
  165. nrl_tracker-1.0.1/tests/test_coverage_boost.py +887 -0
  166. nrl_tracker-1.0.1/tests/test_coverage_boost_2.py +1027 -0
  167. nrl_tracker-1.0.1/tests/test_dynamic_models.py +341 -0
  168. nrl_tracker-1.0.1/tests/test_egm.py +589 -0
  169. nrl_tracker-1.0.1/tests/test_emm.py +438 -0
  170. nrl_tracker-1.0.1/tests/test_ephemerides.py +343 -0
  171. nrl_tracker-1.0.1/tests/test_gaussian_mixtures.py +375 -0
  172. nrl_tracker-1.0.1/tests/test_geophysical.py +346 -0
  173. nrl_tracker-1.0.1/tests/test_great_circle.py +361 -0
  174. nrl_tracker-1.0.1/tests/test_ins.py +603 -0
  175. nrl_tracker-1.0.1/tests/test_ins_gnss.py +609 -0
  176. nrl_tracker-1.0.1/tests/test_kalman_filters.py +607 -0
  177. nrl_tracker-1.0.1/tests/test_mathematical_functions.py +516 -0
  178. nrl_tracker-1.0.1/tests/test_maximum_likelihood.py +238 -0
  179. nrl_tracker-1.0.1/tests/test_mht.py +530 -0
  180. nrl_tracker-1.0.1/tests/test_performance_evaluation.py +418 -0
  181. nrl_tracker-1.0.1/tests/test_phase6_specialized.py +412 -0
  182. nrl_tracker-1.0.1/tests/test_plotting.py +451 -0
  183. nrl_tracker-1.0.1/tests/test_projections.py +442 -0
  184. nrl_tracker-1.0.1/tests/test_relativity.py +463 -0
  185. nrl_tracker-1.0.1/tests/test_rhumb.py +373 -0
  186. nrl_tracker-1.0.1/tests/test_signal_processing.py +400 -0
  187. nrl_tracker-1.0.1/tests/test_smoothers.py +432 -0
  188. nrl_tracker-1.0.1/tests/test_spatial_structures.py +311 -0
  189. nrl_tracker-1.0.1/tests/test_special_functions_phase12.py +543 -0
  190. nrl_tracker-1.0.1/tests/test_static_estimation.py +519 -0
  191. nrl_tracker-1.0.1/tests/test_terrain.py +809 -0
  192. nrl_tracker-1.0.1/tests/test_terrain_loaders.py +454 -0
  193. nrl_tracker-1.0.1/tests/test_tides.py +385 -0
  194. nrl_tracker-1.0.1/tests/test_trackers.py +352 -0
  195. nrl_tracker-1.0.1/tests/test_tracking_containers.py +748 -0
  196. nrl_tracker-1.0.1/tests/test_transforms.py +430 -0
  197. nrl_tracker-1.0.1/tests/test_v030_comprehensive.py +866 -0
  198. nrl_tracker-1.0.1/tests/test_v030_features.py +447 -0
  199. nrl_tracker-1.0.1/tests/unit/test_core.py +357 -0
@@ -0,0 +1,339 @@
1
+ # Contributing to Tracker Component Library (Python)
2
+
3
+ Thank you for your interest in contributing! This document provides guidelines for contributing to the Python port of the Tracker Component Library.
4
+
5
+ ## Development Setup
6
+
7
+ 1. **Clone the repository:**
8
+ ```bash
9
+ git clone https://github.com/nedonatelli/TCL.git
10
+ cd TCL
11
+ ```
12
+
13
+ 2. **Create a virtual environment:**
14
+ ```bash
15
+ python -m venv venv
16
+ source venv/bin/activate # On Windows: venv\Scripts\activate
17
+ ```
18
+
19
+ 3. **Install development dependencies:**
20
+ ```bash
21
+ pip install -e ".[dev]"
22
+ ```
23
+
24
+ 4. **Install pre-commit hooks:**
25
+ ```bash
26
+ pre-commit install
27
+ ```
28
+
29
+ ## Code Style
30
+
31
+ We follow these conventions:
32
+
33
+ - **Code formatting:** [Black](https://black.readthedocs.io/) with default settings
34
+ - **Linting:** [Flake8](https://flake8.pycqa.org/)
35
+ - **Type hints:** Required for all public functions
36
+ - **Docstrings:** NumPy style
37
+
38
+ ### Example Function
39
+
40
+ ```python
41
+ def cart2sphere(
42
+ cart_points: ArrayLike,
43
+ system_type: int = 0,
44
+ ) -> NDArray[np.floating[Any]]:
45
+ """
46
+ Convert Cartesian coordinates to spherical coordinates.
47
+
48
+ Parameters
49
+ ----------
50
+ cart_points : array_like
51
+ Cartesian points with shape (3,) or (3, n) where each column is [x, y, z].
52
+ system_type : int, optional
53
+ Spherical coordinate system convention. Default is 0.
54
+ - 0: [range, azimuth, elevation] with azimuth from x-axis in xy-plane
55
+ - 1: [range, azimuth, elevation] with azimuth from y-axis
56
+
57
+ Returns
58
+ -------
59
+ NDArray
60
+ Spherical coordinates with shape (3,) or (3, n).
61
+ Each column is [range, azimuth, elevation].
62
+
63
+ Examples
64
+ --------
65
+ >>> cart2sphere([1, 0, 0])
66
+ array([1. , 0. , 0. ])
67
+
68
+ >>> cart2sphere([[1, 0], [0, 1], [0, 0]])
69
+ array([[1. , 1. ],
70
+ [0. , 1.57079633],
71
+ [0. , 0. ]])
72
+
73
+ Notes
74
+ -----
75
+ This is a port of Cart2Sphere.m from the MATLAB library.
76
+
77
+ References
78
+ ----------
79
+ .. [1] D. F. Crouse, "The Tracker Component Library..."
80
+ """
81
+ ...
82
+ ```
83
+
84
+ ## Testing
85
+
86
+ ### Running Tests
87
+
88
+ ```bash
89
+ # Run all tests
90
+ pytest
91
+
92
+ # Run with coverage
93
+ pytest --cov=pytcl --cov-report=html
94
+
95
+ # Run specific test file
96
+ pytest tests/unit/test_core.py
97
+
98
+ # Run tests matching a pattern
99
+ pytest -k "test_wrap"
100
+
101
+ # Run only fast tests
102
+ pytest -m "not slow"
103
+ ```
104
+
105
+ ### Writing Tests
106
+
107
+ 1. **Place tests in the appropriate directory:**
108
+ - `tests/unit/` - Unit tests for individual functions
109
+ - `tests/integration/` - Integration tests
110
+ - `tests/fixtures/` - Test data files
111
+
112
+ 2. **Use descriptive test names:**
113
+ ```python
114
+ def test_cart2sphere_single_point():
115
+ ...
116
+
117
+ def test_cart2sphere_multiple_points():
118
+ ...
119
+
120
+ def test_cart2sphere_raises_on_invalid_input():
121
+ ...
122
+ ```
123
+
124
+ 3. **Test against MATLAB reference values:**
125
+ ```python
126
+ @pytest.mark.matlab_validated
127
+ def test_cart2sphere_matches_matlab():
128
+ # Load reference values generated from MATLAB
129
+ ref = np.load('tests/fixtures/cart2sphere_reference.npz')
130
+ result = cart2sphere(ref['input'])
131
+ np.testing.assert_allclose(result, ref['expected'], rtol=1e-12)
132
+ ```
133
+
134
+ ### Generating MATLAB Reference Data
135
+
136
+ For functions ported from MATLAB, generate reference test data:
137
+
138
+ ```matlab
139
+ % In MATLAB with TrackerComponentLibrary loaded
140
+ input = randn(3, 100);
141
+ output = Cart2Sphere(input);
142
+ save('cart2sphere_reference.mat', 'input', 'output');
143
+ ```
144
+
145
+ Then convert to NumPy format:
146
+ ```python
147
+ from scipy.io import loadmat
148
+ import numpy as np
149
+
150
+ data = loadmat('cart2sphere_reference.mat')
151
+ np.savez('cart2sphere_reference.npz',
152
+ input=data['input'],
153
+ expected=data['output'])
154
+ ```
155
+
156
+ ## Porting Functions from MATLAB
157
+
158
+ When porting a function from the original MATLAB library:
159
+
160
+ 1. **Study the original:**
161
+ - Read the MATLAB code and comments thoroughly
162
+ - Understand the algorithm and edge cases
163
+ - Note any MATLAB-specific behaviors
164
+
165
+ 2. **Follow naming conventions:**
166
+ - MATLAB: `Cart2Sphere`, `FPolyKal`, `KalmanUpdate`
167
+ - Python: `cart2sphere`, `poly_kalman_F`, `kalman_update`
168
+
169
+ 3. **Handle array conventions:**
170
+ - MATLAB uses column vectors by default
171
+ - NumPy is row-major but we follow MATLAB conventions for state vectors
172
+ - Document clearly when shapes differ
173
+
174
+ 4. **Add the reference:**
175
+ ```python
176
+ Notes
177
+ -----
178
+ This is a port of Cart2Sphere.m from the MATLAB Tracker Component Library.
179
+
180
+ References
181
+ ----------
182
+ .. [1] Original implementation:
183
+ https://github.com/USNavalResearchLaboratory/TrackerComponentLibrary
184
+ ```
185
+
186
+ 5. **Test thoroughly:**
187
+ - Generate MATLAB reference values
188
+ - Test edge cases (empty arrays, single values, etc.)
189
+ - Test numerical accuracy
190
+
191
+ ## Pull Request Process
192
+
193
+ 1. **Create a feature branch:**
194
+ ```bash
195
+ git checkout -b feature/add-coordinated-turn-model
196
+ ```
197
+
198
+ 2. **Make your changes:**
199
+ - Write code following style guidelines
200
+ - Add tests
201
+ - Update documentation
202
+
203
+ 3. **Run quality checks:**
204
+ ```bash
205
+ # Format code
206
+ black .
207
+
208
+ # Lint
209
+ flake8 pytcl tests
210
+
211
+ # Type check
212
+ mypy pytcl
213
+
214
+ # Run tests
215
+ pytest
216
+ ```
217
+
218
+ 4. **Submit the PR:**
219
+ - Write a clear description
220
+ - Reference any related issues
221
+ - Ensure CI passes
222
+
223
+ ## Priority Areas
224
+
225
+ If you're looking for ways to contribute, these areas are priorities:
226
+
227
+ ### High Priority
228
+ - Coordinate system conversions (`coordinate_systems/conversions/`)
229
+ - Basic Kalman filter implementation (`dynamic_estimation/kalman/`)
230
+ - Constant velocity/acceleration models (`dynamic_models/discrete_time/`)
231
+ - Hungarian algorithm for assignment (`assignment_algorithms/`)
232
+
233
+ ### Medium Priority
234
+ - UKF and EKF implementations
235
+ - Coordinated turn models
236
+ - JPDA data association
237
+ - OSPA metric
238
+
239
+ ### Lower Priority
240
+ - Astronomical code (consider using astropy)
241
+ - Gravity/magnetism models
242
+ - Terrain models
243
+
244
+ ## Release Process
245
+
246
+ When preparing a new release, follow these steps:
247
+
248
+ ### 1. Update Version Numbers
249
+
250
+ Update the version in these files:
251
+ - `pyproject.toml` - `version = "X.Y.Z"`
252
+ - `docs/conf.py` - `release = "X.Y.Z"`
253
+ - `docs/_static/landing.html` - Update the status badge version
254
+
255
+ ### 2. Update Landing Page Statistics
256
+
257
+ In `docs/_static/landing.html`, update the statistics to reflect current metrics:
258
+ - **Version badge** (line ~730): `vX.Y.Z — 720+ Functions`
259
+ - **Test count** (line ~766): Run `pytest --collect-only` to get current test count
260
+ - **Other stats** as needed (functions, modules, etc.)
261
+
262
+ ### 3. Sync Examples
263
+
264
+ Copy examples from the root `examples/` directory to `docs/examples/`:
265
+
266
+ ```bash
267
+ cp examples/*.py docs/examples/
268
+ ```
269
+
270
+ ### 4. Run Quality Checks
271
+
272
+ ```bash
273
+ # Sort imports
274
+ isort pytcl tests examples docs/examples
275
+
276
+ # Format code
277
+ black .
278
+
279
+ # Lint
280
+ flake8 pytcl tests examples docs/examples
281
+
282
+ # Type check
283
+ mypy pytcl examples docs/examples
284
+
285
+ # Run full test suite with coverage
286
+ pytest --cov=pytcl --cov-report=term-missing
287
+ ```
288
+
289
+ ### 5. Verify Examples Run
290
+
291
+ Run each example script to ensure they execute without errors:
292
+
293
+ ```bash
294
+ for f in examples/*.py; do echo "Running $f..."; python "$f" || exit 1; done
295
+ ```
296
+
297
+ ### 6. Update Roadmap Files
298
+
299
+ Update both `ROADMAP.md` and `docs/roadmap.rst`:
300
+
301
+ **In `ROADMAP.md`:**
302
+ - Check off completed items with `[x]` or ~~strikethrough~~
303
+ - Update phase status (e.g., "✅ Completed in vX.Y.Z")
304
+ - Add any new planned features discovered during development
305
+ - Update version targets for upcoming phases if needed
306
+
307
+ **In `docs/roadmap.rst`:**
308
+ - Update "Current State (vX.Y.Z)" section header with new version
309
+ - Update statistics (functions, tests, coverage)
310
+ - Add new completed phase under "Completed Phases"
311
+ - Update the "Version Targets" table with new release
312
+
313
+ ### 7. Update Documentation
314
+
315
+ - Ensure all new features are documented
316
+ - Rebuild docs locally to verify: `cd docs && make html`
317
+
318
+ ### 8. Create Release Commit
319
+
320
+ ```bash
321
+ git add -A
322
+ git commit -m "Release vX.Y.Z: <brief description>"
323
+ git tag vX.Y.Z
324
+ git push origin main --tags
325
+ ```
326
+
327
+ ### 9. Publish to PyPI
328
+
329
+ ```bash
330
+ python -m build
331
+ twine upload dist/*
332
+ ```
333
+
334
+ ## Questions?
335
+
336
+ - Open an issue for bugs or feature requests
337
+ - Start a discussion for questions or ideas
338
+
339
+ Thank you for contributing!
@@ -0,0 +1,42 @@
1
+ This work is in the public domain.
2
+
3
+ The original MATLAB Tracker Component Library was developed by the U.S. Naval
4
+ Research Laboratory and released under the following terms:
5
+
6
+ DISTRIBUTION STATEMENT A. Approved for public release. Distribution is unlimited.
7
+
8
+ This Python port follows the same licensing terms.
9
+
10
+ As a work of the United States Government, this project is not subject to
11
+ copyright protection in the United States. Additionally, we waive copyright
12
+ and related rights in the work worldwide through the CC0 1.0 Universal
13
+ public domain dedication.
14
+
15
+ CC0 1.0 Universal Summary
16
+ -------------------------
17
+
18
+ No Copyright
19
+
20
+ The person who associated a work with this deed has dedicated the work to
21
+ the public domain by waiving all of their rights to the work worldwide under
22
+ copyright law, including all related and neighboring rights, to the extent
23
+ allowed by law.
24
+
25
+ You can copy, modify, distribute and perform the work, even for commercial
26
+ purposes, all without asking permission.
27
+
28
+ Other Information
29
+
30
+ In no way are the patent or trademark rights of any person affected by CC0,
31
+ nor are the rights that other persons may have in the work or in how the
32
+ work is used, such as publicity or privacy rights.
33
+
34
+ Unless expressly stated otherwise, the person who associated a work with
35
+ this deed makes no warranties about the work, and disclaims liability for
36
+ all uses of the work, to the fullest extent permitted by applicable law.
37
+
38
+ When using or citing the work, you should not imply endorsement by the
39
+ author or the affirmer.
40
+
41
+ For the full legal text, see:
42
+ https://creativecommons.org/publicdomain/zero/1.0/legalcode
@@ -0,0 +1,7 @@
1
+ include LICENSE
2
+ include README.md
3
+ include CONTRIBUTING.md
4
+ recursive-include pytcl *.py
5
+ recursive-include tests *.py
6
+ recursive-exclude * __pycache__
7
+ recursive-exclude * *.py[co]
@@ -0,0 +1,297 @@
1
+ Metadata-Version: 2.1
2
+ Name: nrl-tracker
3
+ Version: 1.0.1
4
+ Summary: Python port of the U.S. Naval Research Laboratory's Tracker Component Library for target tracking algorithms
5
+ Author: Original: David F. Crouse, Naval Research Laboratory
6
+ Maintainer: Python Port Contributors
7
+ Project-URL: Homepage, https://pytcl.readthedocs.io/en
8
+ Project-URL: Documentation, https://pytcl.readthedocs.io/en/latest/docs.html
9
+ Project-URL: Repository, https://github.com/nedonatelli/TCL
10
+ Project-URL: Bug Tracker, https://github.com/nedonatelli/TCL/issues
11
+ Project-URL: Original MATLAB Library, https://github.com/USNavalResearchLaboratory/TrackerComponentLibrary
12
+ Keywords: tracking,kalman-filter,target-tracking,data-association,estimation,navigation,coordinate-systems,signal-processing
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: License :: Public Domain
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Topic :: Scientific/Engineering
23
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
24
+ Classifier: Topic :: Scientific/Engineering :: Physics
25
+ Classifier: Topic :: Scientific/Engineering :: Astronomy
26
+ Requires-Python: >=3.10
27
+ Description-Content-Type: text/markdown
28
+ License-File: LICENSE
29
+ Requires-Dist: numpy>=1.24.0
30
+ Requires-Dist: scipy>=1.10.0
31
+ Requires-Dist: numba>=0.57.0
32
+ Provides-Extra: astronomy
33
+ Requires-Dist: astropy>=5.0; extra == "astronomy"
34
+ Requires-Dist: jplephem>=2.18; extra == "astronomy"
35
+ Provides-Extra: geodesy
36
+ Requires-Dist: pyproj>=3.4.0; extra == "geodesy"
37
+ Requires-Dist: geographiclib>=2.0; extra == "geodesy"
38
+ Provides-Extra: visualization
39
+ Requires-Dist: plotly>=5.15.0; extra == "visualization"
40
+ Provides-Extra: optimization
41
+ Requires-Dist: cvxpy>=1.3.0; extra == "optimization"
42
+ Provides-Extra: signal
43
+ Requires-Dist: pywavelets>=1.4.0; extra == "signal"
44
+ Provides-Extra: dev
45
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
46
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
47
+ Requires-Dist: pytest-xdist>=3.0.0; extra == "dev"
48
+ Requires-Dist: hypothesis>=6.0.0; extra == "dev"
49
+ Requires-Dist: black>=23.0.0; extra == "dev"
50
+ Requires-Dist: isort>=5.12.0; extra == "dev"
51
+ Requires-Dist: flake8>=7.0.0; extra == "dev"
52
+ Requires-Dist: mypy>=1.0.0; extra == "dev"
53
+ Requires-Dist: pre-commit>=3.0.0; extra == "dev"
54
+ Requires-Dist: sphinx>=6.0.0; extra == "dev"
55
+ Requires-Dist: sphinx-rtd-theme>=1.2.0; extra == "dev"
56
+ Requires-Dist: myst-parser>=1.0.0; extra == "dev"
57
+ Requires-Dist: nbsphinx>=0.9.0; extra == "dev"
58
+ Provides-Extra: all
59
+ Requires-Dist: nrl-tracker[astronomy,dev,geodesy,optimization,signal,visualization]; extra == "all"
60
+
61
+ # Tracker Component Library (Python)
62
+
63
+ [![PyPI version](https://img.shields.io/badge/pypi-v1.0.0-blue.svg)](https://pypi.org/project/nrl-tracker/)
64
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
65
+ [![License: Public Domain](https://img.shields.io/badge/License-Public%20Domain-brightgreen.svg)](https://en.wikipedia.org/wiki/Public_domain)
66
+ [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
67
+ [![Tests](https://img.shields.io/badge/tests-1598%20passing-success.svg)](https://github.com/nedonatelli/TCL)
68
+
69
+ A Python port of the [U.S. Naval Research Laboratory's Tracker Component Library](https://github.com/USNavalResearchLaboratory/TrackerComponentLibrary), a comprehensive collection of algorithms for target tracking, estimation, coordinate systems, and related mathematical functions.
70
+
71
+ **800+ functions** | **144 modules** | **1,598 tests** | **15+ algorithm categories**
72
+
73
+ ## Overview
74
+
75
+ The Tracker Component Library provides building blocks for developing target tracking algorithms, including:
76
+
77
+ - **Coordinate Systems**: Conversions between Cartesian, spherical, geodetic, and other coordinate systems
78
+ - **Dynamic Models**: State transition matrices for constant velocity, coordinated turn, and other motion models
79
+ - **Estimation Algorithms**: Kalman filters (EKF, UKF, etc.), particle filters, and batch estimation
80
+ - **Assignment Algorithms**: Hungarian algorithm, auction algorithms, and multi-dimensional assignment
81
+ - **Mathematical Functions**: Special functions, statistics, numerical integration, and more
82
+ - **Astronomical Code**: Ephemeris calculations, time systems, celestial mechanics
83
+ - **Navigation**: Geodetic calculations, INS algorithms, GNSS utilities
84
+ - **Geophysical Models**: Gravity, magnetism, atmosphere, and terrain models
85
+
86
+ ## Installation
87
+
88
+ ### Basic Installation
89
+
90
+ ```bash
91
+ pip install nrl-tracker
92
+ ```
93
+
94
+ ### With Optional Dependencies
95
+
96
+ ```bash
97
+ # For astronomy features (ephemerides, celestial mechanics)
98
+ pip install nrl-tracker[astronomy]
99
+
100
+ # For geodesy features (coordinate transforms, map projections)
101
+ pip install nrl-tracker[geodesy]
102
+
103
+ # For visualization
104
+ pip install nrl-tracker[visualization]
105
+
106
+ # For development
107
+ pip install nrl-tracker[dev]
108
+
109
+ # Install everything
110
+ pip install nrl-tracker[all]
111
+ ```
112
+
113
+ ### From Source
114
+
115
+ ```bash
116
+ git clone https://github.com/nedonatelli/TCL.git
117
+ cd TCL
118
+ pip install -e ".[dev]"
119
+ ```
120
+
121
+ ## Quick Start
122
+
123
+ ### Coordinate Conversions
124
+
125
+ ```python
126
+ import numpy as np
127
+ from pytcl.coordinate_systems import cart2sphere, sphere2cart
128
+
129
+ # Convert Cartesian to spherical coordinates
130
+ cart_point = np.array([1.0, 1.0, 1.0])
131
+ r, az, el = cart2sphere(cart_point)
132
+ print(f"Range: {r:.3f}, Azimuth: {np.degrees(az):.1f}°, Elevation: {np.degrees(el):.1f}°")
133
+
134
+ # Convert back
135
+ cart_recovered = sphere2cart(r, az, el)
136
+ ```
137
+
138
+ ### Kalman Filter
139
+
140
+ ```python
141
+ from pytcl.dynamic_estimation.kalman import KalmanFilter
142
+ from pytcl.dynamic_models import constant_velocity_model
143
+
144
+ # Create a constant velocity model
145
+ dt = 0.1
146
+ F, Q = constant_velocity_model(dt, dimension=2, process_noise_intensity=1.0)
147
+
148
+ # Initialize filter
149
+ kf = KalmanFilter(
150
+ F=F, # State transition matrix
151
+ H=np.array([[1, 0, 0, 0], [0, 0, 1, 0]]), # Measurement matrix
152
+ Q=Q, # Process noise
153
+ R=np.eye(2) * 10, # Measurement noise
154
+ )
155
+
156
+ # Run filter
157
+ x_est, P_est = kf.predict()
158
+ x_est, P_est = kf.update(measurement)
159
+ ```
160
+
161
+ ### Assignment Problem
162
+
163
+ ```python
164
+ from pytcl.assignment_algorithms import hungarian
165
+
166
+ # Cost matrix (tracks x measurements)
167
+ cost_matrix = np.array([
168
+ [10, 5, 13],
169
+ [3, 15, 8],
170
+ [7, 9, 12],
171
+ ])
172
+
173
+ # Solve assignment
174
+ assignment, total_cost = hungarian(cost_matrix)
175
+ print(f"Optimal assignment: {assignment}, Total cost: {total_cost}")
176
+ ```
177
+
178
+ ## Module Structure
179
+
180
+ ```
181
+ pytcl/
182
+ ├── core/ # Foundation utilities and constants
183
+ ├── mathematical_functions/ # Basic math, statistics, special functions
184
+ ├── coordinate_systems/ # Coordinate conversions and transforms
185
+ ├── dynamic_models/ # State transition and process noise models
186
+ ├── dynamic_estimation/ # Kalman filters, particle filters
187
+ ├── static_estimation/ # ML, least squares estimation
188
+ ├── assignment_algorithms/ # 2D and multi-dimensional assignment
189
+ ├── clustering/ # Mixture reduction, clustering
190
+ ├── performance_evaluation/ # OSPA, track metrics
191
+ ├── astronomical/ # Ephemerides, time systems
192
+ ├── navigation/ # Geodetic, INS, GNSS
193
+ ├── atmosphere/ # Atmosphere models, refraction
194
+ ├── gravity/ # Gravity models
195
+ ├── magnetism/ # Magnetic field models
196
+ ├── terrain/ # Terrain elevation models
197
+ └── misc/ # Utilities, visualization
198
+ ```
199
+
200
+ ## Documentation
201
+
202
+ - [API Reference](https://pytcl.readthedocs.io/en/latest/api/)
203
+ - [User Guides](https://pytcl.readthedocs.io/en/latest/user_guide/)
204
+ - [Examples](examples/)
205
+
206
+ ## Comparison with Original MATLAB Library
207
+
208
+ This library aims to provide equivalent functionality to the original MATLAB library with Pythonic APIs:
209
+
210
+ | MATLAB | Python |
211
+ |--------|--------|
212
+ | `Cart2Sphere(cartPoints)` | `cart2sphere(cart_points)` |
213
+ | `FPolyKal(T, xDim, order)` | `poly_kalman_F(dt, dim, order)` |
214
+ | `KalmanUpdate(...)` | `KalmanFilter.update(...)` |
215
+
216
+ Key differences:
217
+ - Function names use `snake_case` instead of `PascalCase`
218
+ - Arrays are NumPy arrays (row-major) vs MATLAB matrices (column-major)
219
+ - 0-based indexing vs 1-based indexing
220
+ - Object-oriented APIs where appropriate
221
+
222
+ ## Testing
223
+
224
+ ```bash
225
+ # Run all tests
226
+ pytest
227
+
228
+ # Run with coverage
229
+ pytest --cov=pytcl
230
+
231
+ # Run only fast tests
232
+ pytest -m "not slow"
233
+
234
+ # Run tests validated against MATLAB
235
+ pytest -m matlab_validated
236
+ ```
237
+
238
+ ## Contributing
239
+
240
+ Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
241
+
242
+ ### Development Setup
243
+
244
+ ```bash
245
+ git clone https://github.com/nedonatelli/TCL.git
246
+ cd TCL
247
+ pip install -e ".[dev]"
248
+ pre-commit install
249
+ ```
250
+
251
+ ### Running Quality Checks
252
+
253
+ ```bash
254
+ # Format code
255
+ black .
256
+
257
+ # Lint
258
+ flake8 pytcl
259
+
260
+ # Type check
261
+ mypy pytcl
262
+
263
+ # Run all checks
264
+ pre-commit run --all-files
265
+ ```
266
+
267
+ ## Citation
268
+
269
+ If you use this library in your research, please cite the original MATLAB library:
270
+
271
+ ```bibtex
272
+ @article{crouse2017tracker,
273
+ title={The Tracker Component Library: Free Routines for Rapid Prototyping},
274
+ author={Crouse, David F.},
275
+ journal={IEEE Aerospace and Electronic Systems Magazine},
276
+ volume={32},
277
+ number={5},
278
+ pages={18--27},
279
+ year={2017},
280
+ publisher={IEEE}
281
+ }
282
+ ```
283
+
284
+ ## License
285
+
286
+ This project is in the public domain, following the original MATLAB library's license. See [LICENSE](LICENSE) for details.
287
+
288
+ ## Acknowledgments
289
+
290
+ - Original MATLAB library by David F. Crouse at the U.S. Naval Research Laboratory
291
+ - This port follows the Federal Source Code Policy (OMB M-16-21)
292
+
293
+ ## Related Projects
294
+
295
+ - [FilterPy](https://github.com/rlabbe/filterpy) - Kalman filtering library
296
+ - [Stone Soup](https://github.com/dstl/Stone-Soup) - Framework for tracking algorithms
297
+ - [Astropy](https://www.astropy.org/) - Astronomy library for Python