mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 19:04:02 +00:00
Merge pull request #1436 from Rohilalala/fix/d-military-geom-vertical-rate
fix(military): read a GNSS-sourced vertical rate when no baro rate is sent
This commit is contained in:
4 files changed
+21
-2
No files matched your search
@@ -0,0 +1,3 @@
|
|||||||
|
- Military aircraft whose transponders report a GNSS vertical rate now carry it
|
||||||
|
in analyst and tracked-aircraft data instead of null (Aditya, @Rohilalala,
|
||||||
|
#1436).
|
||||||
@@ -1138,7 +1138,8 @@ The tracked-aircraft descriptor both flight layers hand to the cockpit carries
|
|||||||
`verticalRate` and military records as `verticalRateMps`; the query seam maps both to
|
`verticalRate` and military records as `verticalRateMps`; the query seam maps both to
|
||||||
one name, so `resolveTrackedAircraftInfo` returns a single shape for either layer. The
|
one name, so `resolveTrackedAircraftInfo` returns a single shape for either layer. The
|
||||||
rate is reported, never derived: a blank poll keeps the last transmitted value and an
|
rate is reported, never derived: a blank poll keeps the last transmitted value and an
|
||||||
absent rate stays null rather than reading as level flight.
|
absent rate stays null rather than reading as level flight. A military readsb row
|
||||||
|
without `baro_rate` reports its GNSS rate as `geom_rate`, which is used instead.
|
||||||
|
|
||||||
## Transponder emergency highlighting
|
## Transponder emergency highlighting
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,8 @@ export function normalizeReadsbAircraft(row, snapshotTimeMs) {
|
|||||||
const baroFt = finite(row.alt_baro),
|
const baroFt = finite(row.alt_baro),
|
||||||
geoFt = finite(row.alt_geom);
|
geoFt = finite(row.alt_geom);
|
||||||
const speedKts = finite(row.gs),
|
const speedKts = finite(row.gs),
|
||||||
rateFtMin = finite(row.baro_rate);
|
// readsb sends a GNSS-sourced rate as geom_rate instead of baro_rate.
|
||||||
|
rateFtMin = finite(row.baro_rate) ?? finite(row.geom_rate);
|
||||||
const seen = finite(row.seen),
|
const seen = finite(row.seen),
|
||||||
seenPos = finite(row.seen_pos);
|
seenPos = finite(row.seen_pos);
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -145,6 +145,20 @@ test('readsb units and position/contact ages are normalized once against the sou
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('readsb vertical rate falls back to the GNSS rate when no baro rate is sent', () => {
|
||||||
|
// readsb reports the rate under geom_rate when the aircraft's source is
|
||||||
|
// GNSS; 26 of 157 positioned rows in a live /v2/mil fetch had only that.
|
||||||
|
const row = { hex: 'ae638d', lat: 20.3, lon: -158.5, geom_rate: -2432 };
|
||||||
|
assert.equal(
|
||||||
|
normalizeReadsbAircraft(row, now).verticalRateMps,
|
||||||
|
-2432 * 0.00508,
|
||||||
|
);
|
||||||
|
assert.equal(
|
||||||
|
normalizeReadsbAircraft({ ...row, baro_rate: -2400 }, now).verticalRateMps,
|
||||||
|
-2400 * 0.00508,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
test('vessel identity, opaque reference and heading/course remain distinct, unknowns stay null', () => {
|
test('vessel identity, opaque reference and heading/course remain distinct, unknowns stay null', () => {
|
||||||
const row = normalizeVesselObservation(
|
const row = normalizeVesselObservation(
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user