projecthorus / sondehub-tracker

🎈 Frontend for SondeHub Radiosonde Tracking
https://v2.sondehub.org
MIT License
61 stars 26 forks source link

Ascent rates go to infinity / -infinity during flight #181

Closed darksidelemm closed 2 years ago

darksidelemm commented 2 years ago

We are seeing the ascent rate calculation ingest some bad number, such that the running calculation of ascent rate ends up at infinity. This is due to the 'infinite impulse response' averaging/filtering used at the moment, occurring here: https://github.com/projecthorus/sondehub-tracker/blob/master/js/tracker.js#L2727

A few approaches to fixing this:

Detecting the +/- inf values is probably the better solution.

darksidelemm commented 2 years ago

Also... I'm thinking this line needs an isFinite check: https://github.com/projecthorus/sondehub-tracker/blob/master/js/tracker.js#L2734 That might fix the issue entirely.

LukePrior commented 2 years ago

I've added this to testing: https://github.com/projecthorus/sondehub-tracker/commit/de4c2f365cf29a5cd05a69c9b06f3d82f0c06d23.

If it all works ok will merge to main.