pysdic.PointCloud.is_finite#
- PointCloud.is_finite()[source]#
Check which points in the point cloud are finite (not NaN or infinite).
This method returns a boolean mask indicating which points in the point cloud are finite.
See also
all_finite()method for checking if all points are finite.is_nan()method for getting a boolean mask of NaN points.
- Returns:
A 1D boolean NumPy array of shape \((N_p,)\) where \(N_p\) is the number of points in the point cloud. Each element is True if the corresponding point is finite, and False otherwise.
- Return type:
Examples
Create a
PointCloudfrom a NumPy array containing some NaN and infinite values.1import numpy as np 2from pysdic import PointCloud 3 4# Create a point cloud with some NaN and infinite values 5points = np.array([[0.0, 1.0, 2.0], 6 [np.nan, 1.0, 2.0], 7 [3.0, np.inf, 4.0], 8 [5.0, 6.0, 7.0]]) 9point_cloud = PointCloud.from_array(points)
Check which points are finite using the
is_finite()method.1finite_mask = point_cloud.is_finite() 2print(finite_mask) 3# Output: [ True False False True]