sep.winpos¶
- sep.winpos(data, xinit, yinit, sig, mask=None, maskthresh=0.0, subpix=11, minsig=2.0 / 2.35 * 0.5)¶
Calculate more accurate object centroids using ‘windowed’ algorithm.
Starting from the supplied initial center position, an iterative algorithm is used to determine a better object centroid. On each iteration, the centroid is calculated using all pixels within a circular aperture of
4*sig
from the current position, weighting pixel positions by their flux and the amplitude of a 2-d Gaussian with sigmasig
. Iteration stops when the change in position falls under some threshold or a maximum number of iterations is reached. This is equivalent toXWIN_IMAGE
andYWIN_IMAGE
parameters in Source Extractor (for the correct choice of sigma for each object).Note: One should be cautious about using windowed positions in crowded fields or for sources with nearby neighbors, as the iterative algorithm can fail catastrophically.
- Parameters
- data
ndarray
Data array.
- xinit, yinitarray_like
Initial center(s).
- sigarray_like
Gaussian sigma used for weighting pixels. Pixels within a circular aperture of radius 4*sig are included.
- mask
numpy.ndarray
, optional An optional mask.
- maskthreshfloat, optional
Pixels with mask > maskthresh will be ignored.
- subpixint, optional
Subpixel sampling used to determine pixel overlap with aperture. 11 is used in Source Extractor. For exact overlap calculation, use 0.
- minsigfloat, optional
Minimum bound on
sig
parameter.sig
values smaller than this are increased tominsig
to replicate Source Extractor behavior. Source Extractor uses a minimum half-light radius of 0.5 pixels, equivalent to a sigma of 0.5 * 2.0 / 2.35.
- data
- Returns
- x, ynp.ndarray
New x and y position(s).
- flagnp.ndarray
Flags.