trusat-backend
trusat-backend copied to clipboard
TLE queries/endpoints can return a small number of duplicates
If there is more than one TLE with the joint-max epoch for a given satellite, then the epoch queries will return duplicates.
(On my test DB, there are two such objects.)
We should probably return only one TLE for each object. Not clear how to choose...
FROM TLE
GROUP BY satellite_number)
select epoch, satellite_number, count(*) as c
from TLE inner join max_epochs on (epoch = max_epochs.max_epoch and satellite_number = max_epochs.satnum)
group by epoch, satellite_number
order by c desc;```
Looks like the code has been updated a bit since this was created. Here is a current reference to the code
Seems like this would be a good place to sort by confidence factor if the Epochs are identical, but I don't see any actual reference to the confidence factor being recording. Might be on the to-do list and I just haven't found it.
Correct @thkruz - I'm hoping to implement initial "confidence" code in trusat-orbit this month.