rlabbe / filterpy

Python Kalman filtering and optimal estimation library. Implements Kalman filter, particle filter, Extended Kalman filter, Unscented Kalman filter, g-h (alpha-beta), least squares, H Infinity, smoothers, and more. Has companion book 'Kalman and Bayesian Filters in Python'.
MIT License
3.3k stars 615 forks source link

Feature/support masked array #263

Open antoinecollet5 opened 2 years ago

antoinecollet5 commented 2 years ago

Linked with issue #236

Add support for numpy masked array for measurement used in update methods and functions. This allow using masked array in batch_filter instead of list with None.

Unit tests have been updated and a working example can be found here:

Jonny-air commented 1 year ago

This would be a great feature! I saw that the tests for None, and now for the masked array only include filter with measurement dimension 1. However currently the filter (only with None) fails if the dimension of z is larger than 1. I think with the mask check it should work (didn't get to test it yet), but in general I think this is something that should be in the tests.

antoinecollet5 commented 1 year ago

Hi @Jonny-air I'll have a look at it today ! Cheers :)