src.eval.raster.filter_utils
- author:
Alberto M. Esmoris Pena
The filter_utils module contains the free function
apply_condition_filter() shared between the legacy
RasterGridEvaluator and the new
RasterGridEvaluatorPP to guarantee byte-identical conditional
filtering across both code paths.
Functions
|
Apply the given conditional filter to the given mask. |
- src.eval.raster.filter_utils.apply_condition_filter(val, cond, mask)
Apply the given conditional filter to the given mask.
The body of this function is a verbatim copy of the legacy
RasterGridEvaluator.filter()static method so that the legacy and the PP evaluators share byte-identical filter semantics. The exception messages, the recognized condition types, and the action handling are preserved as-is.- Parameters:
val (
np.ndarray) – The vector of values considered by the filter.cond (dict) – The condition specification governing the filter. See the
conditionsargument ofPointCloudSampler.filter_support_points()for further details.mask (
np.ndarray) – The boolean mask representing the composition of conditions that defines the full filter, at its current state.
- Returns:
The updated boolean filter mask.
- Return type:
np.ndarray