pysdic.PointCloud.all_finite#

PointCloud.all_finite()[source]#

Check if all points in the point cloud are finite (i.e., not NaN or infinite).

See also

  • is_finite() method for getting a boolean mask of finite points.

  • is_nan() method for getting a boolean mask of NaN points.

Returns:

True if all points are finite, False otherwise.

Return type:

bool

Examples

Creating a PointCloud object and checking if all points are finite.

 1import numpy as np
 2from pysdic import PointCloud
 3
 4# Create a point cloud with some finite and non-finite points
 5points = np.array([[0.0, 1.0, 2.0],
 6                   [3.0, 4.0, 5.0],
 7                   [numpy.nan, 7.0, 8.0],
 8                   [9.0, numpy.inf, 11.0]])
 9point_cloud = PointCloud.from_array(points)
10
11# Check if all points are finite
12all_finite = point_cloud.all_finite()
13print(all_finite)
14# Output: False