Draft: Add filter extremes
Add filter_extremes function as it had been implemented on the PNO.a1 for 60 A branch. Since it is not used there anymore but may be used in the future, it sits here, as a merge request, ready to be merged, should it be needed.