sep.kron_radius#
- sep.kron_radius(data, x, y, a, b, theta, r, mask=None, maskthresh=0.0, seg_id=None, segmap=None)#
Calculate Kron “radius” within an ellipse.
The Kron radius is given by
\[\sum_i r_i I(r_i) / \sum_i I(r_i)\]where the sum is over all pixels in the aperture and the radius is given in units of
aandb:r_iis the distance to the pixel relative to the distance to the ellipse specified bya,b,theta. Equivalently, after converting the ellipse parameters to their coefficient representation,r_iis given by\[r_i^2 = cxx(x_i - x)^2 + cyy(y_i - y)^2 + cxx(x_i - x)(y_i - y)\]- Parameters:
- data
ndarray Data array.
- x, yarray_like
Ellipse center(s).
- a, b, thetaarray_like
Ellipse parameters.
- rarray_like
“Radius” of ellipse over which to integrate. If the ellipse extent correponds to second moments of an object, this is the number of “isophotal radii” in Source Extractor parlance. A Fixed value of 6 is used in Source Extractor.
- mask
numpy.ndarray, optional An optional mask.
- maskthreshfloat, optional
Pixels with mask > maskthresh will be ignored.
- segmap
ndarray, optional Segmentation image with dimensions of
dataand dtypenp.int32. This is an optional input and corresponds to the segmentation map output byextract.- seg_idarray_like, optional
Array of segmentation ids used to mask additional pixels in the image. Dimensions correspond to the dimensions of
xandy. The behavior differs depending on whetherseg_idis negative or positive. Ifseg_idis positive, all pixels belonging to other objects are masked. (Pixelj, iis masked ifseg[j, i] != seg_id and seg[j, i] != 0). Ifseg_idis negative, all pixels other than those belonging to the object of interest are masked. (Pixelj, iis masked ifseg[j, i] != -seg_id). NB: must be included ifsegmapis provided.
- data
- Returns:
- kronradarray_like
The Kron radius.
- flagarray_like
Integer value indicating conditions about the aperture or how many masked pixels it contains.