filterpy icon indicating copy to clipboard operation
filterpy copied to clipboard

Use masked array for zs?

Open rlabbe opened this issue 3 years ago • 1 comments

Using None to denote z is not available is fine in methods such as update(), but it really falls apart when using batch_filter. Typically I would have zs as an np.array, not a list. Having to convert to a list and then assigning None just isn't very NumPyish.

I would just single functions like update should use the test:

 if z is None or z is ma.masked:

and then you can pass what you want into methods like batch_filter.

rlabbe avatar Apr 08 '21 19:04 rlabbe

Hi ! First of all thanks for your great work :)

Indeed, the support of masked array would be great and it works fine with the batch-filter method.

I just did a pull request.

You can find a working example here: https://github.com/antoinecollet5/kalman-filtering/blob/develop/linear_case_filterpy.ipynb

Cheers

antoinecollet5 avatar Dec 27 '21 15:12 antoinecollet5