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 and b: r_i is the distance to the pixel relative to the distance to the ellipse specified by a, 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
datandarray

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.

masknumpy.ndarray, optional

An optional mask.

maskthreshfloat, optional

Pixels with mask > maskthresh will be ignored.

segmapndarray, optional

Segmentation image with dimensions of data and dtype np.int32. This is an optional input and corresponds to the segmentation map output by extract.

seg_idarray_like, optional

Array of segmentation ids used to mask additional pixels in the image. Dimensions correspond to the dimensions of x and y. The behavior differs depending on whether seg_id is negative or positive. If seg_id is positive, all pixels belonging to other objects are masked. (Pixel j, i is masked if seg[j, i] != seg_id and seg[j, i] != 0). If seg_id is negative, all pixels other than those belonging to the object of interest are masked. (Pixel j, i is masked if seg[j, i] != -seg_id). NB: must be included if ``segmap` is provided.

Returns
kronradarray_like

The Kron radius.

flagarray_like

Integer value indicating conditions about the aperture or how many masked pixels it contains.