# This file lists columns for bit-packing using columns for use in the Apdb
#
tableName: DiaSource
doc: "Flag packing definitions for the DiaSource table."
columns:
  - columnName: flags
    doc: Bit pack of all relavant flags for the columns currently stored in
      the Apdb.
    bitList:
    - name: base_PixelFlags_flag
      bit: 0
      doc: general failure flag, set if anything went wrong
    - name: base_PixelFlags_flag_offimage
      bit: 1
      doc: Source center is off image
    - name: base_PixelFlags_flag_edge
      bit: 2
      doc: Source is outside usable exposure region (masked EDGE or NO_DATA)
    - name: base_PixelFlags_flag_interpolated
      bit: 3
      doc: Interpolated pixel in the Source footprint
    - name: base_PixelFlags_flag_saturated
      bit: 4
      doc: Saturated pixel in the Source footprint
    - name: base_PixelFlags_flag_cr
      bit: 5
      doc: Cosmic ray in the Source footprint
    - name: base_PixelFlags_flag_bad
      bit: 6
      doc: Bad pixel in the Source footprint
    - name: base_PixelFlags_flag_suspect
      bit: 7
      doc: Source''s footprint includes suspect pixels
    - name: base_PixelFlags_flag_interpolatedCenter
      bit: 8
      doc: Interpolated pixel in the Source center
    - name: base_PixelFlags_flag_saturatedCenter
      bit: 9
      doc: Saturated pixel in the Source center
    - name: base_PixelFlags_flag_crCenter
      bit: 10
      doc: Cosmic ray in the Source center
    - name: base_PixelFlags_flag_suspectCenter
      bit: 11
      doc: Source''s center is close to suspect pixels
    - name: slot_Centroid_flag
      bit: 12
      doc: general failure flag, set if anything went wrong
    - name: slot_Centroid_pos_flag
      bit: 13
      doc: failure flag for positive, set if anything went wrong
    - name: slot_Centroid_neg_flag
      bit: 14
      doc: failure flag for negative, set if anything went wrong
    - name: slot_ApFlux_flag
      bit: 15
      doc: General Failure Flag
    - name: slot_ApFlux_flag_apertureTruncated
      bit: 16
      doc: aperture did not fit within measurement image
    - name: slot_PsfFlux_flag
      bit: 17
      doc: General Failure Flag
    - name: slot_PsfFlux_flag_noGoodPixels
      bit: 18
      doc: not enough non-rejected pixels in data to attempt the fit
    - name: slot_PsfFlux_flag_edge
      bit: 19
      doc: object was too close to the edge of the image to use the full PSF model
    - name: ip_diffim_forced_PsfFlux_flag
      bit: 20
      doc: Forced PSF flux general failure flag.
    - name: ip_diffim_forced_PsfFlux_flag_noGoodPixels
      bit: 21
      doc: Forced PSF flux not enough non-rejected pixels in data to attempt the fit.
    - name: ip_diffim_forced_PsfFlux_flag_edge
      bit: 22
      doc: Forced PSF flux object was too close to the edge of the image to use the full PSF model.
    - name: slot_Shape_flag
      bit: 23
      doc: General Failure Flag
    - name: slot_Shape_flag_unweightedBad
      bit: 24
      doc: Both weighted and unweighted moments were invalid
    - name: slot_Shape_flag_unweighted
      bit: 25
      doc: Weighted moments converged to an invalid value; using unweighted moments
    - name: slot_Shape_flag_shift
      bit: 26
      doc: centroid shifted by more than the maximum allowed amount
    - name: slot_Shape_flag_maxIter
      bit: 27
      doc: Too many iterations in adaptive moments
    - name: slot_Shape_flag_psf
      bit: 28
      doc: Failure in measuring PSF model shape
