Flags


Flag Descriptions

Flag Overview

Flag names are recognized by the SX Query Language. The names in the tables below can be used in any query (only in uppercase).

All names as cited by that page are accepted (only in uppercase). To keep compatibility with dervish, the dervish name convention is also accepted, which is the AR_DFLAG prefix instead of OBJECT and OBJECT. So OBJECT_BLENDED and AR_DFLAG_BLENDED specifies the very same flag.

To check whether a flag is set, use the bitwise AND '&' operator:

(objFlags & OBJECT_BLENDED) > 0

To check for several flags at once, you can use the bitwise OR operator '|' to combine the flag values and check the result of ANDing the combined value with the flag:

(objFlags & (OBJECT_BINNED1 | OBJECT_BINNED2 | OBJECT_BINNED4))
 == (OBJECT_BINNED1 | OBJECT_BINNED2 | OBJECT_BINNED4) 

To check if any of several flags is set, you can also use the bitwise OR operator '|', but just compare the result to 0:

(objFlags & (OBJECT_BINNED1 | OBJECT_BINNED2 | OBJECT_BINNED4))
> 0

To check if a flag is unset, use the bitwise AND operator '&' as in the first example above, but now check if the result of the AND is equal to 0:

(objFlags & OBJECT_BLENDED) == 0


Photo Flags

How to query on photo flags: The variable objFlags in any tag object is the same as objFlags in the photo objects. To query on the flags in each individual band, use the variable flags in the photo objects which is an array of 5, in the order [01234] == [ugriz]. See Robert Lupton's flags page for more details on the flags.

The flag names in the table below are the names set by Robert. The flags used by photoSch and in the software have the AR_DFLAG prefix instead of OBJECT. Both prefixes are accepted by SXQL, so you can write either AR_DFLAG_BRIGHT or OBJECT_BRIGHT, it doesn't matter.

Flag Names for objFlagsValueDescription
OBJECT_CANONICAL_CENTER0x1 used canonical, not local, centre
OBJECT_BRIGHT0x2 detected by Bright Objects
OBJECT_EDGE0x4 object is too close to edge of frame
OBJECT_BLENDED0x8 object is/was blended
OBJECT_CHILD0x10 object is a child
OBJECT_PEAKCENTER0x20 given centre position of peak pixel
OBJECT_NODEBLEND0x40 no deblending attempted
OBJECT_NOPROFILE0x80 too small to estimate a profile
OBJECT_NOPETRO0x100 no Petrosian radius
OBJECT_MANYPETRO0x200 more than one Petrosian radius
OBJECT_NOPETRO_BIG0x400 no Petrosian radius as object is too big
OBJECT_DEBLEND_TOO_MANY_PEAKS0x800 too many peaks to deblend
OBJECT_CR0x1000 contains a CR pixel
OBJECT_MANYR500x2000 more than one 50% radius
OBJECT_MANYR900x4000 more than one 90% radius
OBJECT_BAD_RADIAL0x8000 some low S/N radial points
OBJECT_INCOMPLETE_PROFILE0x10000 r_P includes off-frame pixels
OBJECT_INTERP0x20000 object contains interpolated pixels
OBJECT_SATUR0x40000 object contains saturated pixels
OBJECT_NOTCHECKED0x80000 object contains NOTCHECKED pixels
OBJECT_SUBTRACTED0x100000 object had wings subtracted
OBJECT_NOSTOKES0x200000 object has no measured stokes params
OBJECT_BADSKY0x400000 sky level so bad that object is -ve
OBJECT_PETROFAINT0x800000 >= 1 Petrosian radius too faint
OBJECT_TOO_LARGE0x1000000 object is too large
OBJECT_DEBLENDED_AS_PSF0x2000000 deblender treated obj as PSF
OBJECT_DEBLEND_PRUNED0x4000000 deblender pruned peak list
OBJECT_ELLIPFAINT0x8000000 Centre's fainter than desired elliptical isophote
OBJECT_BINNED10x10000000 object was found in 1x1 binned image
OBJECT_BINNED20x20000000 object was found in 2x2 binned image
OBJECT_BINNED40x40000000 object was found in 4x4 binned image
OBJECT_MOVED0x80000000 Object appears to have moved during the exposure. May have been deblended as a moving object.
OBJECT_DEBLENDED_AS_MOVING 0x100000000 deblended as a moving object
OBJECT_NODEBLEND_MOVING 0x200000000 no deblend of moving object
OBJECT_TOO_FEW_DETECTIONS 0x400000000 too few detections to deblend
OBJECT_BAD_MOVING_FIT 0x800000000 Fit to moving object was too poor
OBJECT_STATIONARY 0x1000000000 velocity is consistent with zero
OBJECT_PEAKS_TOO_CLOSE 0x2000000000 at least some peaks were too close, and thus merged
OBJECT_MEDIAN_CENTRE 0x4000000000 centre is of median-smoothed image
OBJECT_LOCAL_EDGE 0x8000000000 per-band centre's too near edge
OBJECT_BAD_COUNTS_ERROR 0x10000000000 psf|fiberCountsErr is bad/unknown
OBJECT_BAD_MOVING_FIT_CHILD 0x20000000000 moving child's fit was too poor
OBJECT_DEBLEND_UNASSIGNED_FLUX 0x40000000000 deblender failed to assign enough of flux to children
OBJECT_SATUR_CENTER 0x80000000000 object's centre's saturated
OBJECT_INTERP_CENTER 0x100000000000 object's centre is very close to at least one interpolated pixel
OBJECT_DEBLENDED_AT_EDGE0x200000000000 object is deblended though EDGE
OBJECT_DEBLEND_NOPEAK 0x400000000000 object had no detected peak
OBJECT_PSF_FLUX_INTERP 0x800000000000 a signifcant amount of PSF's flux is interpolated
OBJECT_TOO_FEW_GOOD_DETECTIONS0x1000000000000 too few good detections to deblend as moving
OBJECT_MEASURED 0x1000000000000000 object has been measured
OBJECT_GROWN_MERGED 0x2000000000000000 growing led to a merger
OBJECT_HAS_CENTER 0x4000000000000000 OBJC has a canonical centre
OBJECT_MEASURE_BRIGHT 0x8000000000000000 object should be measured bright


We have more than 32 target types, therefore target type must be separated into more than one enumerated type. We do this by splitting target types into primary (related to a primary survey science sample) and secondary (unrelated to any primary survey science samples) types.

Primary Target Selection Flag

A primTarget is an enumerated type which assigns a primary survey target type to an object. A primary target type is one identifying an object as belonging to one of the primary survey science samples. Note tha a given object can be assigned zero or more primary and zero or more secondary target types. The flags may be named like in photosch, with the additional AR_ prefix.

Flag Name for primTargetValue
TARGET_QSO_HIZ 0x1
TARGET_QSO_CAP 0x2
TARGET_QSO_SKIRT 0x4
TARGET_QSO_FIRST_CAP 0x8
TARGET_QSO_FIRST_SKIRT 0x10
TARGET_QSO_FAINT 0x2000000
TARGET_GALAXY_RED 0x20
TARGET_GALAXY_RED_II 0x4000000
TARGET_GALAXY 0x40
TARGET_GALAXY_BIG 0x80
TARGET_GALAXY_BRIGHT_CORE 0x100
TARGET_ROSAT_A 0x200
TARGET_ROSAT_B 0x400
TARGET_ROSAT_C 0x800
TARGET_ROSAT_D 0x1000
TARGET_ROSAT_E 0x8000000
TARGET_STAR_BHB 0x2000
TARGET_STAR_CARBON 0x4000
TARGET_STAR_BROWN_DWARF 0x8000
TARGET_STAR_SUB_DWARF 0x10000
TARGET_STAR_CATY_VAR 0x20000
TARGET_STAR_RED_DWARF 0x40000
TARGET_STAR_WHITE_DWARF 0x80000
TARGET_SERENDIP_BLUE 0x100000
TARGET_SERENDIP_FIRST 0x200000
TARGET_SERENDIP_RED 0x400000
TARGET_SERENDIP_DISTANT 0x800000
TARGET_SERENDIP_MANUAL 0x1000000

Secondary Target Selection Flag

A secTarget is an enumerated type which assigns a secondary survey target type to an object. A secondary target type is a type unrelated to any of the primary survey science samples. Note that a given object can be assigned zero or more primary and zero or more secondary target types. The flags may be named like in photosch, with the additional TAR_ prefix.

Flag Name for secTargetValue
TARGET_LIGHT_TRAP 0x1
TARGET_REDDEN_STD 0x2
TARGET_TEST_TARGET 0x4
TARGET_QA 0x8
TARGET_SKY 0x10
TARGET_SPECTROPHOTO_STD 0x20
TARGET_GUIDE_STAR 0x40
TARGET_BUNDLE_HOLE 0x80
TARGET_QUALITY_HOLE 0x100
TARGET_HOT_STD 0x200


Object Status Flag

A status is an enumerated type which assigns an overall survey status to an object. Any given object can only have one of the flags DUPLICATE, and OK_RUN set. Similarly, any given object can have only one of the flags SECONDARY or PRIMARY set.

Flag Name for statusValueDescription<
AR_OBJECT_STATUS_SET 0x1 This object's status has been set in reference to its own run.
AR_OBJECT_STATUS_GOOD 0x2 Good as determined by its object flags. Absence implies bad. This flag is set by "setObjectStatus".
AR_OBJECT_STATUS_DUPLICATE 0x4 This object has one or more duplicate detections in an adjacent field of the same Frames Pipeline Run. This is set by "setObjectStatus".
AR_OBJECT_STATUS_OK_RUN 0x10 Located within the primary range of rows for this field. This is usable object. This flag is set by "setObjectStatus".
AR_OBJECT_STATUS_RESOLVED 0x20 This object has been resolved against other runs.
AR_OBJECT_STATUS_PSEGMENT 0x40 Belongs to a PRIMARY segment. This does not imply that this is a primary object.
AR_OBJECT_STATUS_FIRST_FIELD 0x100 Belongs to the first field in its segment. Used to distinguish objects in fields shared by two segments.
AR_OBJECT_STATUS_OK_SCANLINE 0x200 Lies within valid nu range for its scanline.
AR_OBJECT_STATUS_OK_STRIPE 0x400 Lies within valid eta range for its stripe.
AR_OBJECT_STATUS_SECONDARY 0x1000 This is a secondary survey object.
AR_OBJECT_STATUS_PRIMARY 0x2000 This is a primary survey object.
AR_OBJECT_STATUS_TARGET 0x4000 This is a spectroscopic target.

Peter Z. Kunszt, Ani R. Thakar,
Last Modified: May 12, 2000.