measure_centroid

poppy.measure_centroid(HDUlist_or_filename=None, ext=0, slice=0, boxsize=20, verbose=False, units='pixels', relativeto='origin', **kwargs)[source]

Measure the center of an image via center-of-mass

The centroid method used is the floating-box center of mass algorithm by Jeff Valenti et al., which has been adopted for JWST target acquisition measurements on orbit. See JWST technical reports JWST-STScI-001117 and JWST-STScI-001134 for details.

Parameters:
HDUlist_or_filenamestring

Either a fits.HDUList object or a filename of a FITS file on disk

extint

Extension in that FITS file

sliceint, optional

If that extension is a 3D datacube, which slice (plane) of that datacube to use

boxsizeint

Half box size for centroid

relativetostring

either ‘origin’ for relative to pixel (0,0) or ‘center’ for relative to image center. Default is ‘origin’

unitsstring

either ‘pixels’ for position in pixels or ‘arcsec’ for arcseconds. Relative to the relativeto parameter point in either case.

verbosebool

Be more verbose

Returns:
CoMarray_like

[Y, X] coordinates of center of mass.