centroid_com¶
- photutils.centroids.centroid_com(data, mask=None)[source]¶
Calculate the centroid of an n-dimensional array as its “center of mass” determined from moments.
Non-finite values (e.g., NaN or inf) in the
data
array are automatically masked.- Parameters:
- Returns:
- centroid
ndarray
The coordinates of the centroid in pixel order (e.g.,
(x, y)
or(x, y, z)
), not numpy axis order.
- centroid