guess_center_nested

psfsubtraction.prepare.guess_center_nested(image, halfwidth=50)[source] [edit on github]

Guess the position of the central object as two-step process

First, this function calculates the center of mass of an image. This works well if the central object is the only bright source, however even a moderately bright source that is far away can shift the center of mass of an image by a few pixels. To improve the first guess the function selects a subimage with the halfwidth halfwidth in a second step and calculates the center of mass of that subimage.

Parameters:
image : 2d np.array

input image

halfwidth : int

half width of the subimage selected in the second step.

Returns:
xm, ym : float

x and y coordinates estimated position of the central object