Masking previously happened in a few different places, in a few different ways.
- Checking the first track variable for
NaN, and building a mask from this. Using the first variable was unstable, as we are relying on it being
float, which is not always the case. This meant the masking broke for the new samples in some cases.
- Elsewhere, we used a
tracks == 0check, after running
np.nan_to_num. This is also broken as there are some possible
leptonID) for which
0is a valid value, and the default for padded tracks is
This implements a solution for both problems, using the
valid flag (which is designed for this use) where possible, and, if it is not available, defaulting to finding the first
float variable and using a