SSN Radar Tracking: EKF, UKF, and Batch Least Squares¶
In this example we'll simulate Space Surveillance Network (SSN) radar tracking of a LEO object and estimate its orbit sequentially with an Extended Kalman Filter (EKF) and an Unscented Kalman Filter (UKF). We'll load the Vallado SSN sensor dataset, find the passes visible to each sensor over a 6-hour tracking arc, simulate az/el/range measurements during those passes, and compare how the two filters converge on the true orbit. A separate script, ssn_tracking_bls.py, solves the same scenario with Batch Least Squares (BLS) instead; we walk through it near the end of this page.
Setup¶
First, we'll import the necessary libraries, initialize Earth orientation parameters, and configure the tracking arc:
Load the Sensor Network¶
We load the Vallado SSN sensor sites and build sensors from them. The dataset's 21 sites split into two sensor types, both supported by SimpleSSNSensor: radar/phased-array/mechanical (azel_range) trackers, which measure [azimuth, elevation, range], and optical (azel) trackers, which are angles-only and measure [azimuth, elevation] via the AzElMeasurementModel. Each sensor's measurement_model() returns the model matching its type. SimpleSSNSensor.from_locations() builds a sensor for every site, defaulting sites that lack Table 4-4 calibration to zero noise and bias -- overridable with with_noise()/with_bias(). from_locations_calibrated() restricts to the fully-calibrated sites (16 of the 21: 13 radar plus the 3 calibrated optical trackers Socorro, Maui, and Diego Garcia); this example uses the calibrated set so simulated measurement noise always matches Table 4-4:
Visualize the Sensor Network¶
Next we propagate a truth trajectory -- a 700 km, 72° inclination LEO orbit -- and plot its ground track against the sensor network's coverage cones, using each sensor's minimum elevation angle. Each sensor gets a stable color, reused for its measurement traces in the next figure, so a comm cone's color on the map identifies the same sensor in the az/el/range plot below:
Interpolation
Normally sampling measurements at a finer time step (15 s) than the propagation step (~60 s) would introduce interpolation error; brahe's orbit propagators use Hermite-cubic interpolation by default, which avoids these artifacts. See InterpolationMethod for the available interpolation algorithms.
Simulate Measurements¶
Access windows bound the simulation: for each sensor we compute the elevation-constrained access windows against the truth trajectory, then call simulate_observations() only within those windows. This keeps the observation set to what the sensor geometry actually supports, rather than sampling continuously and discarding invisible epochs:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | |
Over the 6-hour arc, the network produces hundreds of observations across dozens of passes. Radar measurements are [azimuth, elevation, range]; optical measurements are angles-only [azimuth, elevation] and so contribute no points to the range subplot. Each is generated with its sensor's own bias and noise from Vallado Table 4-4, and colored to match its sensor in the network figure above:
Run the Estimators¶
Each sensor exposes a measurement_model() that carries the same bias and noise used to generate its measurements. Because the model applies bias inside predict(), a filter built from these models is consistent with the simulated observations -- this is the calibrated-sensor assumption: the filter is told about the same bias the sensor introduces, rather than having to estimate it away.
Passes from different sensors can overlap -- Cavalier and Millstone, for instance, both track the object around the same time -- so the per-sensor pass windows are first merged into non-overlapping tracking intervals. The EKF and UKF then each walk the intervals in order: the filter is stepped forward through the gap before an interval with propagate_to() at a fixed 60 s cadence (prediction-only, no measurement update, recording a FilterRecord named "Propagation" at each step so covariance growth during the gap is visible in the diagnostic output), and every observation within the interval is then processed in time order:
Analyze Results¶
Finally, we check filter consistency -- whether the formal uncertainty actually bounds the true error -- by rotating each record's position error and position-covariance block into the radial/along-track/cross-track (RTN) frame of the truth state at that epoch with bh.rotation_eci_to_rtn(). Each per-axis row shades a ±3σ band from the rotated covariance diagonal and draws the signed error on top, so a consistent filter keeps its error line inside the shaded band; a bottom row shows the unsigned total position error on a linear scale:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | |
Along-track error typically dominates the other two axes between passes: along-track position error grows from an along-track velocity or timing error integrated over time, while radial and cross-track errors stay comparatively small once the orbit plane and semi-major axis are well observed. The shaded bands widen visibly during the gaps between passes -- reflecting the same covariance growth visible in the "Propagation" records -- and narrow again once a new pass starts feeding measurements back in.
The EKF and UKF converge to nearly identical results here, both reaching meter-level final position error, since the two-body dynamics and az/el/range geometry are only mildly nonlinear over this arc; the UKF's sigma-point propagation does not offer a material advantage at this level of nonlinearity. Azimuth wrapping is handled consistently: AzElRangeMeasurementModel.residual() wraps the residual, the model's Jacobian differences through it, and the UKF forms its predicted measurement mean and innovation deviations through residual() as well, so a pass whose sigma-point azimuths straddle the 0/360° wrap stays well-behaved.
Batch Least Squares¶
BLS solves for the orbit in one batch, minimizing the weighted residual cost over the entire observation set at once, rather than the sequential filters' approach of recursively updating a running state estimate and letting covariance grow between passes. Each Gauss-Newton iteration re-propagates the full arc together with the state transition matrix, which makes BLS substantially slower than the sequential filters above, so this variant lives in its own script, ssn_tracking_bls.py.
The script reproduces the same scenario as ssn_tracking.py -- the sensor dataset, the truth orbit, and the simulated measurements -- before solving with BLS. Its default state-correction convergence threshold (1e-8, in mixed position/velocity units) is far tighter than the centimeter-level precision this measurement set actually supports, so the script loosens state_correction_threshold and adds a cost_convergence_threshold; this stops the solver once corrections are physically insignificant instead of exhausting max_iterations on progressively smaller, noise-driven corrections:
Output
BLS's final position error is somewhat higher than the sequential filters reach, since it minimizes the residual cost over the whole arc rather than tracking the most recent state, though its formal uncertainty remains comparable to the sequential filters', as shown in the output above.
Full Code
Full Code Example¶
Full Code
| ssn_tracking.py | |
|---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 | |