Reference/APIΒΆ

Background estimation & source detection

sep.Background(data[, mask, maskthresh, bw, ...]) Representation of spatially variable image background and noise.
sep.extract(data, thresh[, err, mask, ...]) Extract sources from an image.

Aperture photometry

sep.sum_circle(data, x, y, r[, err, var, ...]) Sum data in circular aperture(s).
sep.sum_circann(data, x, y, rin, rout[, ...]) Sum data in circular annular aperture(s).
sep.sum_ellipse(data, x, y, a, b, theta, r) Sum data in elliptical aperture(s).
sep.sum_ellipann(data, x, y, a, b, theta, ...) Sum data in elliptical annular aperture(s).

Aperture utilities

sep.kron_radius(data, x, y, a, b, theta, r) Calculate Kron “radius” within an ellipse.
sep.flux_radius(data, x, y, rmax, frac[, ...]) Return radius of a circle enclosing requested fraction of total flux.
sep.winpos(data, xinit, yinit, sig[, mask, ...]) Calculate more accurate object centroids using ‘windowed’ algorithm.
sep.mask_ellipse(arr, x, y, a, b, theta[, r]) Mask ellipse(s) in an array.
sep.ellipse_axes(cxx, cyy, cxy) Convert from coefficient ellipse representation to ellipse axes and angle.
sep.ellipse_coeffs(a, b, theta) Convert from ellipse axes and angle to coefficient representation.

Low-level utilities

sep.get_extract_pixstack() Get the size in pixels of the internal pixel buffer used in extract().
sep.set_extract_pixstack(size) Set the size in pixels of the internal pixel buffer used in extract().

Flags

Flag Description
sep.OBJ_MERGED object is result of deblending
sep.OBJ_TRUNC object is truncated at image boundary
sep.OBJ_SINGU x, y fully correlated in object
sep.APER_TRUNC aperture truncated at image boundary
sep.APER_HASMASKED aperture contains one or more masked pixels
sep.APER_ALLMASKED aperture contains only masked pixels
sep.APER_NONPOSITIVE aperture sum is negative in kron_radius

To see if a given flag is set in flags:

is_merged = (flags & sep.OBJ_MERGED) != 0

Note

The coordinate convention in SEP is that (0, 0) corresponds to the center of the first element of the data array. This agrees with the 0-based indexing in Python and C. However, note that this differs from the FITS convention where the center of the first element is at coordinates (1, 1). As Source Extractor deals with FITS files, its outputs follow the FITS convention. Thus, the coordinates from SEP will be offset from Source Extractor coordinates by -1 in x and y.