Skip to content

Commit dd4c79d

Browse files
committed
- Another couple of tries for the channels
1 parent 64917d8 commit dd4c79d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

gempy_plugins/orientations_generator/_orientations_generator.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ class NearestSurfacePointsSearcher(enum.Enum):
1212

1313

1414
def select_nearest_surfaces_points(surface_points_xyz: np.ndarray, searchcrit: Optional[int|float] = 3,
15-
search_type: NearestSurfacePointsSearcher = NearestSurfacePointsSearcher.KNN
16-
) -> np.ndarray:
15+
search_type: NearestSurfacePointsSearcher = NearestSurfacePointsSearcher.KNN,
16+
filter_less_than: Optional[int] = None) -> np.ndarray:
1717
match search_type:
1818
case NearestSurfacePointsSearcher.KNN:
1919
Tree = NearestNeighbors(n_neighbors=searchcrit)
@@ -26,4 +26,7 @@ def select_nearest_surfaces_points(surface_points_xyz: np.ndarray, searchcrit: O
2626
case _:
2727
raise ValueError(f"Invalid search type: {search_type}")
2828

29+
if filter_less_than is not None:
30+
neighbours_surfaces = [np.array(neigh) for neigh in neighbours_surfaces if len(neigh) >= filter_less_than]
31+
2932
return neighbours_surfaces

0 commit comments

Comments
 (0)