Fix failure in Geometric task caused by nanmedian behavior

Merged
#118 · Created  · Last updated

Merged pull request

Merged in fix_nanmedian_failure (pull request #118)

d20e9c7·Author: ·Closed by: ·2023-06-15

Description

This PR fixes some recent failures in the pipeline.

The issue is that a different number of hairline regions were discovered for the modstates in a single beam. In other words modstate X had 3 hairline regions while modstate Y had 4 hairline regions. (Having more than 2 hairline regions is possible in some older(?) data sets that suffer from reflections(?) of higher-order hairline images. The ViSP team is aware of this).

The bug occurred when trying to take nanmedian of a list containing arrays of different lengths. For example, np.nanmedian([np.array([1, 2, 3]), np.array([1, 2, 3])]) works, but np.nanmedian([np.array([1, 2]), np.array([1, 2, 3])]) errors out because the individual arrays do not have the same length.

To fix this we simply flatten the list of input arrays prior to sending it to nanmedian. So in the above, failing example we would instead have np.nanedian(np.array([1, 2, 1, 2, 3]), which works just fine.

0 attachments

0 comments

Loading commits...