Skip to content
This repository was archived by the owner on Apr 13, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/tests/test_ephemeris.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def test_sat_state():
'af1': 3.637978807091713e-12,
'af2': 0.0}})
assert not eph.is_valid(t.GpsTime(**{ 'wn': 1867, 'tow': 518400.0,}))
assert not eph.is_healthy()
assert eph.is_healthy()
eph = e.Ephemeris(**{'sid': {'sat': 17, 'code': 0},
'toe': { 'wn': 1867, 'tow': 518400.0,},
'ura': 2.0,
Expand Down
8 changes: 7 additions & 1 deletion src/ephemeris.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,13 @@ u8 ephemeris_valid(const ephemeris_t *eph, const gps_time_t *t)
*/
u8 satellite_healthy(const ephemeris_t *eph)
{
return eph->healthy;
if (eph->valid) {
return eph->healthy;
} else {
/* If we don't yet have an ephemeris, assume satellite is healthy */
/* Otherwise we will stop tracking the sat and never find out */
return 1;
}
}

/** Convert a GPS URA index into a value.
Expand Down