cwitools.measurement.centroid2d

cwitools.measurement.centroid2d(fits_in, obj_mask=None, obj_id=1, coords='image')

Measure the spatial centroid of an extended object.

Parameters:
  • fits_in (HDU or HDUList) – 2D or 3D flux-like data.
  • obj_mask (numpy.ndarray) – 2D or 3D data with labelled object regions.
  • obj_id (int or list) – Integer or list of integers of object IDs to use.
  • coords (str) – Desired coordinate system for the output. ‘image’: Center of mass is returned as an (x, y) tuple ‘radec’: Center of mass is returned as an (RA, DEC) tuple
Returns:

The center of mass in the requested coordinate system.

Return type:

float tuple