Reference/APIΒΆ

Background estimation & source detection

sep_pjw.Background(data[, mask, maskthresh, ...])

Representation of spatially variable image background and noise.

sep_pjw.extract(data, thresh[, err, mask, ...])

Extract sources from an image.

Aperture photometry

sep_pjw.sum_circle(data, x, y, r[, err, ...])

Sum data in circular aperture(s).

sep_pjw.sum_circann(data, x, y, rin, rout[, ...])

Sum data in circular annular aperture(s).

sep_pjw.sum_ellipse(data, x, y, a, b, theta, r)

Sum data in elliptical aperture(s).

sep_pjw.sum_ellipann(data, x, y, a, b, ...)

Sum data in elliptical annular aperture(s).

Aperture utilities

sep_pjw.kron_radius(data, x, y, a, b, theta, r)

Calculate Kron "radius" within an ellipse.

sep_pjw.flux_radius(data, x, y, rmax, frac)

Return radius of a circle enclosing requested fraction of total flux.

sep_pjw.winpos(data, xinit, yinit, sig[, ...])

Calculate more accurate object centroids using 'windowed' algorithm.

sep_pjw.mask_ellipse(arr, x, y, a, b, theta)

Mask ellipse(s) in an array.

sep_pjw.ellipse_axes(cxx, cyy, cxy)

Convert from coefficient ellipse representation to ellipse axes and angle.

sep_pjw.ellipse_coeffs(a, b, theta)

Convert from ellipse axes and angle to coefficient representation.

Low-level utilities

sep_pjw.get_extract_pixstack()

Get the size in pixels of the internal pixel buffer used in extract().

sep_pjw.set_extract_pixstack(size)

Set the size in pixels of the internal pixel buffer used in extract().

sep_pjw.get_sub_object_limit()

Get the limit on the number of sub-objects when deblending in extract().

sep_pjw.set_sub_object_limit(limit)

Set the limit on the number of sub-objects when deblending in extract().

Flags

Flag

Description

sep_pjw.OBJ_MERGED

object is result of deblending

sep_pjw.OBJ_TRUNC

object is truncated at image boundary

sep_pjw.OBJ_SINGU

x, y fully correlated in object

sep_pjw.APER_TRUNC

aperture truncated at image boundary

sep_pjw.APER_HASMASKED

aperture contains one or more masked pixels

sep_pjw.APER_ALLMASKED

aperture contains only masked pixels

sep_pjw.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.