From ae5324a250379996a8725437e71db7ee2e969340 Mon Sep 17 00:00:00 2001 From: Lachlan Grose Date: Wed, 15 May 2024 10:03:05 +1000 Subject: [PATCH] fix: feature gradient masked by unconformities --- LoopStructural/modelling/features/_geological_feature.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/LoopStructural/modelling/features/_geological_feature.py b/LoopStructural/modelling/features/_geological_feature.py index 2e7890be..ca45e1fa 100644 --- a/LoopStructural/modelling/features/_geological_feature.py +++ b/LoopStructural/modelling/features/_geological_feature.py @@ -158,7 +158,8 @@ def evaluate_gradient(self, pos: np.ndarray, ignore_regions=False) -> np.ndarray ) points_faulted = self._apply_faults(points) values = self.interpolator.evaluate_value(points_faulted) - return self.interpolator.support.evaluate_gradient(pos, values) + v[mask, :] = self.interpolator.support.evaluate_gradient(pos[mask, :], values) + return v pos = self._apply_faults(pos) if mask.dtype not in [int, bool]: logger.error(f"Unable to evaluate gradient for {self.name}")