#ifndef AR_DETECTION_FLAG_H
#define AR_DETECTION_FLAG_H

typedef enum arDetectionFlag
/* A <def>arDetectionFlag</def> is an enumerated type which enumerates flags */
/* which may be set on individual detections by the photo pipeline.          */
{
  AR_DFLAG_CANONICAL_CENTER =    0x1, /* used canonical, not local, centre   */
  AR_DFLAG_BRIGHT       =        0x2, /* detected by Bright Objects	     */
  AR_DFLAG_EDGE         =        0x4, /* object is too close to edge of frame*/
  AR_DFLAG_BLENDED      =        0x8, /* object is/was blended		     */
  AR_DFLAG_CHILD        =       0x10, /* object is a child		     */
  AR_DFLAG_PEAKCENTER   =       0x20, /* given centre position of peak pixel */
  AR_DFLAG_NODEBLEND    =       0x40, /* no deblending attempted	     */
  AR_DFLAG_NOPROFILE    =       0x80, /* too small to estimate a profile     */
  AR_DFLAG_NOPETRO      =      0x100, /* no Petrosian radius		     */
  AR_DFLAG_MANYPETRO    =      0x200, /* more than one Petrosian radius      */
  AR_DFLAG_NOPETRO_BIG  =      0x400, /* no Petrosian radius as object is too big */
  AR_DFLAG_DEBLEND_TOO_MANY_PEAKS = 0x800, /* too many peaks to deblend      */
  AR_DFLAG_CR     	=     0x1000, /* contains a CR pixel                 */
  AR_DFLAG_MANYR50      =     0x2000, /* more than one 50% radius	     */
  AR_DFLAG_MANYR90      =     0x4000, /* more than one 90% radius	     */
  AR_DFLAG_BAD_RADIAL   =     0x8000, /* some low S/N radial points	     */
  AR_DFLAG_INCOMPLETE_PROFILE = 0x10000, /* r_P includes off-frame pixels    */
  AR_DFLAG_INTERP       =    0x20000, /* object contains interpolated pixels */
  AR_DFLAG_SATUR        =    0x40000, /* object contains saturated pixels    */
  AR_DFLAG_NOTCHECKED   =    0x80000, /* object contains NOTCHECKED pixels   */
  AR_DFLAG_SUBTRACTED   =   0x100000, /* object had wings subtracted	     */
  AR_DFLAG_NOSTOKES     =   0x200000, /* object has no measured stokes params*/
  AR_DFLAG_BADSKY       =   0x400000, /* sky level so bad that object is -ve */
  AR_DFLAG_PETROFAINT   =   0x800000, /* >= 1 Petrosian radius too faint     */
  AR_DFLAG_TOO_LARGE    =  0x1000000, /* object is too large		     */
  AR_DFLAG_DEBLENDED_AS_PSF = 0x2000000, /* deblender treated obj as PSF     */
  AR_DFLAG_DEBLEND_PRUNED = 0x4000000, /* deblender pruned peak list	     */
  AR_DFLAG_ELLIPFAINT   = 0x8000000, /* Centre's fainter than desired elliptical isophote */
  AR_DFLAG_BINNED1      = 0x10000000, /* object was found in 1x1 binned image*/
  AR_DFLAG_BINNED2      = 0x20000000, /* object was found in 2x2 binned image*/
  AR_DFLAG_BINNED4      = 0x40000000, /* object was found in 4x4 binned image*/
  AR_DFLAG_MOVED = 0x80000000         /* Object appears to have moved during */
                                      /* the exposure.  May have been        */
                                      /* deblended as a moving object.       */
} AR_DETECTION_FLAG; /* pragma SCHEMA */

typedef enum arDetectionFlag2
/* A <def>arDetectionFlag2</def> is an enumerated type which enumerates flags*/
/* which may be set on individual detections by the photo pipeline.          */
{
  AR_DFLAG2_DEBLENDED_AS_MOVING= 0x1, /* deblended as a moving object        */
  AR_DFLAG2_NODEBLEND_MOVING   = 0x2, /* no deblend of moving object         */
  AR_DFLAG2_TOO_FEW_DETECTIONS = 0x4, /* too few detections to deblend       */
  AR_DFLAG2_BAD_MOVING_FIT     = 0x8, /* Fit to moving object was too poor   */
  AR_DFLAG2_STATIONARY        = 0x10, /* velocity is consistent with zero    */
  AR_DFLAG2_PEAKS_TOO_CLOSE   = 0x20, /* at least some peaks were too close, */
                                      /* and thus merged                     */
  AR_DFLAG2_MEDIAN_CENTRE     = 0x40, /* centre is of median-smoothed image  */
  AR_DFLAG2_LOCAL_EDGE        = 0x80, /* per-band centre's too near edge     */
  AR_DFLAG2_BAD_COUNTS_ERROR = 0x100, /* psf|fiberCountsErr is bad/unknown   */
  AR_DFLAG2_BAD_MOVING_FIT_CHILD = 0x200, /* moving child's fit was too poor */
  AR_DFLAG2_DEBLEND_UNASSIGNED_FLUX = 0x400, /* deblender failed to assign   */
                                             /* enough of flux to children   */
  AR_DFLAG2_SATUR_CENTER     = 0x800, /* object's centre's saturated         */
  AR_DFLAG2_INTERP_CENTER   = 0x1000, /* object's centre is very close to at */
                                      /* least one interpolated pixel        */
  AR_DFLAG2_DEBLENDED_AT_EDGE=0x2000, /* object is deblended though EDGE     */
  AR_DFLAG2_DEBLEND_NOPEAK   =0x4000, /* object had no detected peak         */
  AR_DFLAG2_PSF_FLUX_INTERP  =0x8000, /* a signifcant amount of PSF's flux   */
                                      /* is interpolated                     */
  AR_DFLAG2_TOO_FEW_GOOD_DETECTIONS=0x10000, /* too few good detections to   */
                                             /* deblend as moving            */
  AR_DFLAG2_CENTER_OFF_AIMAGE = 0x20000, /* at least one peak's centre lay   */
					 /* off the atlas image in some band */
  AR_DFLAG2_MEASURED    = 0x10000000, /* object has been measured            */
  AR_DFLAG2_GROWN_MERGED= 0x20000000, /* growing led to a merger             */
  AR_DFLAG2_HAS_CENTER  = 0x40000000, /* OBJC has a canonical centre         */
  AR_DFLAG2_MEASURE_BRIGHT = 0x80000000 /* object should be measured bright  */
} AR_DETECTION_FLAG2; /* pragma SCHEMA */

#endif

