data_properties#
- photutils.morphology.data_properties(data, mask=None, background=None, wcs=None)[source]#
Calculate the morphological properties (and centroid) of a 2D array (e.g., an image cutout of an object) using image moments.
- Parameters:
- dataarray_like or
Quantity The 2D array of the image.
- maskarray_like (bool), optional
A boolean mask, with the same shape as
data, where aTruevalue indicates the corresponding element ofdatais masked. Masked data are excluded from all calculations.- backgroundfloat or array_like, optional
The background level previously present in the input
data.backgroundmay be a scalar value or a 2D array with the same shape asdata. The inputbackgroundis not subtracted fromdata, which should already be background-subtracted; providing it only enables background-related properties to be measured.- wcsWCS object or
None, optional A world coordinate system (WCS) transformation that supports the astropy shared interface for WCS (e.g.,
astropy.wcs.WCS,gwcs.wcs.WCS). IfNone, then all sky-based properties will be set toNone.
- dataarray_like or
- Returns:
- result
SourceCataloginstance A scalar
SourceCatalogobject (single source) containing the morphological properties.
- result
- Raises:
- ValueError
If
datais not a 2D array.- ValueError
If
maskis provided and does not have the same shape asdata.- ValueError
If
maskis provided and all pixels are masked.- ValueError
If
backgroundis provided and is not a scalar or a 2D array with the same shape asdata.