phot.center.find_center_2dg

phot.center.find_center_2dg(
    ccd,
    position_xy,
    cbox_size=5.0,
    csigma=3.0,
    msky=None,
    ssky=0,
    sky_annulus=None,
    sky_kw=None,
    maxiters=5,
    error=None,
    atol_shift=0.0001,
    max_shift=1,
    max_shift_step=None,
    full=True,
    full_history=False,
)

Find the center of the image by 2D Gaussian fitting.

Parameters

ccd : ~astropy.nddata.CCDData or ndarray

The whole image which the position_xy is calculated.

position_xy : array - like

The position of the initial guess in image XY coordinate.

cbox_size : float or int = 5.0

The size of the box to find the centroid. Recommended to use 2.5 to 4.0 times the seeing FWHM. Minimally about 5 pixel is recommended. If extended source (e.g., comet), recommend larger cbox. See: https://iraf.readthedocs.io/en/latest/tasks/noao/digiphot/apphot/centerpars.html Default is 5.0.

csigma : float or int = 3.0
The parameter to use in sigma-clipping. Using pixels only above 3-simga level for centroiding is recommended. See Ma+2009, Optics Express, 17,
ssky : float = 0

The sample standard deviation of the sky or background. It will be used instead of sky_annulus if sky_annulus is None. The pixels above the local minima (of the array of size cbox_size) plus csigma*ssky will be used for centroid, following the default of IRAF’s noao.digiphot.apphot: https://iraf.readthedocs.io/en/latest/tasks/noao/digiphot/apphot/centerpars.html Default is 0.

sky_annulus : CircAn, EllipAn, RectAn, PillAn, or None = None

Annulus template for estimating the sky. Each iteration constructs a new annulus at the current centroid, retaining the template’s dimensions, orientations, and plotting resolution. The input object is unchanged; its initial position is ignored. If None (default), use ssky.

sky_kw : dict = None

The keyword arguments of .backgroud.sky_fit. Default is None.

atol_shift : float = 0.0001

Stop when the fitted shift in pixels is below this absolute tolerance. Default is 1.0e-4.

max_shift : = 1

The maximum acceptable shift. If shift is larger than this, raises warning.

max_shift_step : float, None = None

The maximum acceptable shift for each iteration. If the shift (call it shift_raw) is larger than this, the actual shift will be max_shift_step towards the direction identical to shift_raw. If None (default), no such truncation is done.

error : ~astropy.nddata.CCDData or ndarray = None

The 1-sigma uncertainty map used for fitting. Default is None.

full : bool = True

Whether to return the original and final cutout images. Default is True.

full_history : bool = False

Whether to return all the history of memory-heavy objects, including cutout ccd, cutout of the error frame, evaluated array of the fitted models. Most likely this is turned on only to check whether the centroiding process works correctly (i.e., kind of debugging purpose). Default is False.

Returns

newpos : tuple

The iteratively found centroid position.

shift : float

Total shift from the initial position.

fulldict : dict

The dict when returned if full=True:

* ``positions``: `Nx2` numpy.array

The history of x and y positions. The 0-th element is the initial position and the last element is the final fitted position.