projecthorus / sondehub-infra

GNU General Public License v3.0
26 stars 4 forks source link

Missing "descending" field in Prediction Data? #17

Closed ZigiWalter closed 3 years ago

ZigiWalter commented 3 years ago

Hi,

In the previous HubHab API (https://legacy-snus.habhub.org/tracker/get_predictions.php?vehicles=), the prediction data included an extremely useful "descending" field (obviously, the predication is much more accurate after the balloon bursts). I don't see that field in the new API.

Will it be possible to add it? Or maybe it's already there and I've missed it somehow...?

Thanks.

darksidelemm commented 3 years ago

I guess I have to ask... why are you polling the trackers predictions API? This is meant to be used by the tracker.

ZigiWalter commented 3 years ago

It's pulled by some script that sends a notification upon a predicted close landing. What would be the alternative you had in mind?

darksidelemm commented 3 years ago

Polling it is probably fine I guess... The results are cached so I doubt it adds any extra load. @TheSkorm ?

Otherwise you'd need to query Tawhiri for predictions yourself.

ZigiWalter commented 3 years ago

To clarify - the polling rate is once every 15 minutes. If that's even close to creating an issue, please let me know.

Thanks.

TheSkorm commented 3 years ago

@ZigiWalter I've added in the field in this commit and rolled out : https://github.com/projecthorus/sondehub-infra/commit/9618ba13cf48037264abef4940c7253b725f1959 Let me know if that works as expected.

Requests are heavily cached so I think we'll be fine, regardless of how often people poll.

ZigiWalter commented 3 years ago

Looks very good! Thanks for handling this so quickly!

ZigiWalter commented 3 years ago

BTW, it's not a real problem, but maybe worth fixing: For some reason, the current "longitude" value (i.e., not the predicted one) returned by that API has only 2 digits after the decimal point, while the "latitude" has around 14...

`[{"vehicle": "S3320993", "time": "2021-06-18T20:02:15Z", "latitude": 32.82045997213572, "longitude": 246.01, "altitude": 14267.87,

Thanks.

TheSkorm commented 3 years ago

Good catch! For awhile I've wondered why there has been an offset between the prediction and the the actual track, but never got time to explore why. Super easy fix that's been rolled out.

: https://github.com/projecthorus/sondehub-infra/commit/d77bfa8a7cea6938c0516a67ea7f1e545d6b05a8

ZigiWalter commented 3 years ago

Thanks again for the second fix!