Site Map

Understanding the image processing flags - Details


In the process of measuring the properties of all objects detected in the SDSS images, the image-processing software sets an extensive series of flags that indicate the status of each object, warn of possible problems with the image itself, and warn of possible problems in the measurement of various quantities associated with the object. The present document describes the flags in different categories, and tries to make clear how they can best be used. For full understanding, one should read this in parallel with Robert Lupton's flags document containing even more detailed descriptions of the individual flags.

The SDSS imaging data consist of images in five photometric bands. The measurement of the properties of the objects is carried out in the five bands separately, and flag bits are set in each band. There are enough flag bits to fill up two 32-bit quantities, thus these are encoded in two quantities, called generically flags and flags2. There is one such pair for each of the five bands, u, g, r, i, and z. These are combined in various ways to make flags appropriate for the whole object in all five bands; these are called objc_flags and objc_flags2.

Beware of interpreting the objc_flags blindly! For example, the NOPETRO flag is set in objc_flags if the Petrosian radius cannot be measured in any of u, g, r, i, and z. Imagine our horror when the SDSS galaxy spectroscopic sample (which is defined in terms of Petrosian magnitudes in r) had 50% of the objects flagged NOPETRO! The reason is because the u and z bands are low S/N, and many objects had NOPETRO set in u or z, and therefore in the objc_flags as well. Only 2% of galaxy targets have NOPETRO set in r.

Flags that affect the object's resolve status

These flags are used by the resolve software to determine whether an object is unique within a field. Typically, you should rely on the RUN_PRIMARY bit in resolveStatus rather than use these bits directly.


An object that is detected as greater than a 5 sigma peak (after smoothing with the local PSF) in a given band is flagged BINNED1 in that band. The object-finder then masks all detected objects thus far, bins the image 2x2, and runs the detection algorithm again; objects discovered at this stage are flagged BINNED2. This is repeated again (i.e., now binning 4x4); detections are labelled BINNED4. Many BINNED2 detections include the outskirts of bright galaxies, and scattered light from bright stars (as well as genuine low surface brightness galaxies); very few BINNED4 detections seem to be real astrophysical objects.


Used only internally in the pipeline, but not written to files. DETECTED is the OR of BINNED1, BINNED2, and BINNED4, in a given band. Even if the object is not flagged DETECTED in a given band (usually because it was detected only in another band), photometry is still carried out on it, allowing, e.g., a 3-sigma detection of a point source.


As described in the EDR paper, objects detected at more than 200 sigma in the r band have their properties measured twice: once with a global sky and once with a local sky. The former entry in the SDSS catalogs is flagged BRIGHT, and in practice is rarely used to do science. One should always reject such objects. This will be set in all the bands, as well as objc_flags.


Each detected object is examined to see if it is composite; if it is, it is flagged BLENDED in all bands, as well as objc_flags. An attempt is made to deblend it. If for some reason it is not deblended (usually because it is too close to the edge), it will be flagged NODEBLEND. Otherwise, its children will have their properties measured as well, and one wants to reject BLENDED objects not flagged DEBLENDED in order to avoid duplicate entries. Note that selecting PRIMARY objects does this, and the cut on BRIGHT entries, automatically.

The children of a deblend are flagged CHILD. It is possible for multiple peaks to be detected in the CHILD, and for it to also be labelled BLENDED as well. There are further flags related to deblending that are mostly informational in nature; see below.

Flags that indicate problems with the raw data


The photometry of saturated objects is questionable, needless to say (in fact, the total PSF counts of mildly saturated stars should not be too much in error, as it attempts to include all photons, including those in the saturated core and the bleed trail). The SATURATED flag is set in each band that includes saturated pixels; if it is set in any band, it is also set in objc_flags. Objects that are saturated can be deblended if they show multiple peaks. Note that a galaxy with a superposed saturated star in its disk, even if successfully deblended, will be flagged SATURATED, as some of the pixels in the object footprint are indeed saturated.

SATURATED_CENTER indicates that the saturated pixels are close to the center of the object. This can be used to distinguish, e.g., galaxies which are flagged SATURATED because of a superposed star, from those with a very bright Seyfert nucleus, although it still needs further testing. Note that star-galaxy separation is not very effective for saturated objects; many saturated stars are misclassified as galaxies.


The photometric pipeline works on one field at a time. An object which is too close to the edge of a frame is flagged EDGE in that band. Among PRIMARY objects (which have been resolved in overlaps, and thus should remove most EDGE objects), only large extended objects should be flagged EDGE. Thus, if you are interested in point sources, you will probably not need to worry about the EDGE flag (or at least be suspicious of objects with EDGE and PRIMARY set). On rare occasions, it has happened that half of a chip has gone on the blink; objects close to the new edge there are flagged LOCAL_EDGE in the appropriate band.

The deblending algorithm has to work harder for objects close to the edge; it runs only for big objects which otherwise might be missed. If so, the flag DEBLENDED_AT_EDGE is set. This is an informational flag; it by itself does not indicate any trouble.

Other pixel-level problems

If the photometric pipeline recognizes a pixel as bad (due to a bad column, a cosmic ray, or a bleed trail), it is interpolated over. If this is true for any pixel within the object, it is flagged INTERP. This by itself it just informational; if the interpolation is over a cosmic ray or a single bad column, for example, the photometry should be essentially perfect. Further flags give additional information.

Flags that indicate problems with the image


Often, in deblending, objects near the edge, and at low S/N, various flags will be set indicating trouble defining the center of the object. This should make one suspicious of its detailed photometric properties. In particular:

Problems associated with specific quantities


Some of these are easy; they simply say that the quantity in question could not be measured. In particular:

Three types of measurement generate a lot of flags: Petrosian quantities, the proper motion of objects, and adaptive shape moments. These are described below.

Flags associated with the measurement of Petrosian quantities

The pipeline measures Petrosian radii, fluxes, 50% and 90% radii, and errors for all these quantities. This is described in detail in Appendix A to Strauss et al. (2002), which discusses the flags as well. The Petrosian radius (and there can be more than one of them) is often measured at a fairly low S/N point in the profile of an object. Thus the most common flags that are set (especially at the faint end) are

These two often appear together. In this case (and in the absence of other warning flags such as BADSKY or NOPROFILE, which mean real trouble), the code still returns a meaningful magnitude (i.e., the total flux within the aperture with detected counts), so the Petrosian magnitude will still be usable. A related flag is NOPETRO_BIG, which indicates that the Petrosian radius appears to be larger than the outermost point of the extracted radial profile. This can happen in regions in which the background sky is noisy, or for low S/N objects.

Other Petrosian flags, mostly informational in nature, include:

Flags associated with moving objects

A main-belt asteroid will show a parallax of a few arcseconds between the r and g exposure in the SDSS camera. The photometric pipeline, and in particular, the deblending algorithm, explicitly tests for this, and measures the motion as appropriate. There are quite a few flags associated with this process. For most purposes, the only flag you need to examine is DEBLENDED_AS_MOVING, whose name should be self-explanatory. If one wants a catalog of moving objects, for example, cut on this flag, as well as the derived motion (rowv, colv) and associated errors. It is possible that objects with small enough motion will have a statistically significant proper motion, but not trigger this flag; this requires further exploration. There are no doubt a number of Kuiper Belt objects to be discovered in the SDSS data!

The remaining flags related to moving objects are mostly informational in nature, but are useful in understanding why a specific object was not deblended as moving:

Flags associated with the measurement of adaptive moments

The imaging pipeline carries out the calculations of optimally weighted second moments of objects in order to determine their shapes (especially for weak lensing studies). The flags indicate trouble with this process for a given object in a given band, usually at low S/N and such moment measurements should not be used.

Further flags related to deblending (all informational)

A complicated object may have many peaks in it (think of the core of a globular cluster as the worst-case scenario!). However complicated an object is, the deblender conserves flux, in so much as the flux in each pixel is split among the children. Still, no effort is made to ensure that the sum of the children is exactly equal to the parent, so rounding error could lead to discrepancies of one or two DN. A number of informational flags point out cases where deblending was complicated.

If the number of peaks is larger than 25, the flag DEBLEND_TOO_MANY_PEAKS is set (in the parent, *not* the child), and only the 25 most significant peaks are deblended. DEBLEND_UNASSIGNED_FLUX indicates that initially, >5% of the parent's flux was not assigned to any of the children and that this flux has been redistributed among them. Thus this is not an indicator of any problem with the deblender; this is an informational flag only.

It is occasionally true (especially in complicated deblends) that some of the peaks are not deblended, for one of two reasons. The parents in such cases are labelled DEBLEND_PRUNED. The two reasons are that these peaks lie too close to other peaks (in which case the flag PEAKS_TOO_CLOSE is set), or that the templates associated with the peak is degenerate with others (in which case DEBLEND_DEGENERATE is set -- see deblender description in DR1 changes document).

In a complicated deblend, especially those involving galaxies, there can be many children, and it is not always obvious (without looking at the image by eye) which child is the main galaxy. The flag BRIGHTEST_GALAXY_CHILD flags that object which the code believes to be the brightest galaxy child. If the deblending algorithm recognizes a given child as unresolved, it will use that information in the deblend, and flag it as DEBLENDED_AS_PSF.

HAS_SATUR_DN indicates that the object is saturated in this band and the bleed trail doesn't touch the edge of the frame. In such cases, an attempt is made to add up all the flux in the bleed trails, and to include it in the object's photometry. Note: some of the CCDs saturate at over 65535 DN; for these chips, the bled flux will be underestimated.

After the regular deblender had completed, photo took another pass looking for some special cases, and the deblend was modified based on this analysis are flagged DEBLEND_PEEPHOLE. Currently, only one special case is considered: objects that, when merged together, were consistent with a moving object that the deblender had missed in the first pass.

Further informational flags

It is often true that the last bin in the radial profile of an object goes slightly negative. When this happens, the BAD_RADIAL flag is set; it can usually be ignored.

The Petrosian and model magnitude calculations make reference to a canonical band, which defaults to the r band. In the case that the object is undetected in r, the canonical band is set to the highest S/N band. The band in question is flagged CANONICAL_BAND.

The extended wings around bright stars are subtracted; such objects are flagged SUBTRACTED.

For sufficiently extended objects, the PSF-weighted centroid is not optimal, and the centroid is found using a 2x2-binned images. Such objects are flagged BINNED_CENTER; such objects probably should not be used, e.g., as part of a local astrometric reference frame.