centroid_com¶

photutils.centroids.
centroid_com
(data, mask=None, oversampling=1)[source]¶ Calculate the centroid of an ndimensional array as its “center of mass” determined from moments.
Nonfinite values (e.g., NaN or inf) in the
data
array are automatically masked. Parameters
 dataarray_like
The input ndimensional array.
 maskarray_like (bool), optional
A boolean mask, with the same shape as
data
, where aTrue
value indicates the corresponding element ofdata
is masked. oversamplingint or tuple of two int, optional
Oversampling factors of pixel indices. If
oversampling
is a scalar this is treated as both x and y directions having the same oversampling factor; otherwise it is treated as(x_oversamp, y_oversamp)
.
 Returns
 centroid
ndarray
The coordinates of the centroid in pixel order (e.g.,
(x, y)
or(x, y, z)
), not numpy axis order.
 centroid