Closed dkrako closed 3 months ago
Due to artifacts and errors in measurements, gaze signal values can have outliers with extreme values.
A clip transformation would be ideal to clip signals to a lower and upper bound.
clip()
pymovements.gaze.transforms
tests/unit/gaze/transforms/clip_test.py
A first code proposal could look like this:
@pm.gaze.transforms.register_transform def clip(lower_bound, upper_bound, input_column, output_column, n_components): clipped = pl.concat_list( [ pl.col(input_column).list.get(component).clip(lower_bound, upper_bound) for component in range(n_components) ], ).alias(output_column) return clipped
Description of the problem
Due to artifacts and errors in measurements, gaze signal values can have outliers with extreme values.
Description of a solution
A clip transformation would be ideal to clip signals to a lower and upper bound.
Minimum acceptance criteria
clip()
inpymovements.gaze.transforms
tests/unit/gaze/transforms/clip_test.py
Sample Code
A first code proposal could look like this: