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
a
andb
:r_i
is 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_i
is 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
data
and 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
x
andy
. The behavior differs depending on whetherseg_id
is negative or positive. Ifseg_id
is positive, all pixels belonging to other objects are masked. (Pixelj, i
is masked ifseg[j, i] != seg_id and seg[j, i] != 0
). Ifseg_id
is negative, all pixels other than those belonging to the object of interest are masked. (Pixelj, i
is masked ifseg[j, i] != -seg_id
). NB: must be included if ``segmap` is provided.
- data
- Returns
- kronradarray_like
The Kron radius.
- flagarray_like
Integer value indicating conditions about the aperture or how many masked pixels it contains.