-- Deprecation codes are as follows:
--  1: Stack frames that have no catalogue
--  2: Dead detector frames or all channels bad.
--  3: Undefined and or non-sensible critical image metadata attributes
--  4: Sky subtraction not OK (via pipeline sky sub scale factor)
--  5: Incorrect combination of expTime,numExp,numInts for survey specific projects
--  6: Incorrect frame complements within groups/nights (for incomplete MSBs)
--  7: Undefined values of critical catalogue attributes for stacks
--  8: Seeing=0.0 for a stack
--  9: High value of sky that compromises the depth
-- 10: Seeing outside specified maximum
-- 11: Photometric zeropoint too bright
-- 12: Average stellar ellipticity too high (> 0.25)
-- 13: Depth (as calculated from sky noise and 5sigma detection in fixed aperture)
--     is too shallow compared to overall histogram distribution (i.e. shallower
--     than ~0.5mag wrt the modal value) OR sky noise is too high given the sky
--     level
-- 14: AperCor3 outlying in aperCor3 versus seeing distribution
-- 15: Pipeline MAGZPT inconsistent between image PHDU, extension HDUs and/or
--     catalogue extension HDUs (from attributes photZP, photZPExt and photZPCat)
-- 16: Difference in detector sky level wrt to mean of all 4 detectors is outlying
--     in the distribution of the same.
-- 17: Unused at present
-- 18: Provenance indicates that a constituent frame of a combined frame product
--     includes a deprecated frame.
-- 19: Inconsistent provenance for a stack or leav product indicating something
--     wrong with the image product (usually screwed up FITS keywords confusing
--     the pipeline)
-- 20: Detector number counts indicate some problem (loads of crud images)
-- 21: 5-sigma depth of detector frame more than 0.4mag brighter than modal value
--     for a given filter/project/exposure time
-- 22: Basic astrometry check (pixel size and/or aspect ratio) indicates something
--     is wrong with the image.
--
-- 26: Deprecated because frame is flagged as ignored in pipeline processing.
-- 27: Deprecated because frame is flagged as part of a summit-rejected MSB.
-- 30: Pawprint deprecated because tile is deprecated
-- 31: Pawprint deprecated beacuse not used in tile (orphaned)
-- 32: u stacklist deprecated because currently no undeprecated g stack
-- (space left for further deprecation codes...)
--
-- 40: Science (*stack) frame is not part of a survey (e.g. high latitude sky
--     frames in the GPS)
-- 41: large variation in zero points of pawprints making up tile
-- 42: large variation in seeing of pawprints making up tile
-- 43: tile with low maglim pawprint, visually confirmed.
-- 44: low pawprint Maglim values and visual confirmation with tile jpeg
-- (space left for further deprecation codes...)
-- 48 VST file with no fixed catalogue
-- 49 Multiframe uses pawsky from same base positions
-- 50 Multiframe should not go into a deep stack but can be released otherwise
-- 51 Intermittency problem with channel 14 of detector. This will be processed by CU13 and used by all later stages. 
--
-- 53 Multiframe should not go into deep stacks but can go into detection and ..., created for VVV
-- 55 Aborted OB
-- 56 Deprecated becuase of poor ESOGrade
-- 58 catalogue not ingested into detectionRaw
-- (space left for further deprecation codes...)
--
-- 60: Eyeball check deprecation: trailed
-- 61:    "      "        "     : multiple bad channels
-- 62:    "      "        "     : Moon ghost
-- 63:    "      "        "     : Sky subtraction problem
-- 64:    "      "        "     : Disaster (catchall category for the indescribable)
-- 65:    "      "        "     : Empty detector frame
-- 66: Flat fielding problem? (as specified by AE)
-- 67: Eyeball check deprecation: Bad cross-talk correction residuals (GPS)
-- 68: VVVDR1 problem, deep tiles deprecated.
-- 70: Eyeball check requires deprecation, but this is the best that can be done so this
--     should not be reobserved (e.g. very bright star in WFCAM FOV).
--
-- (space left for further deprecation codes)
--
-- 80: Deprecated because observation (MSB,object,filter) has been repeated later
--     (shallow surveys only). The latest duplication in each case is kept.
-- 81: Deprecated because observation (MSB,object,filter) is repeated in a later
--     Semester (again, shallow surveys only). The best observation in each case is kept.
--
-- 83  Deprecated because observation has been repeated with an epoch difference less than
--     the required minimum for the survey.
-- 99: Manually deprecated because of some DFS issue (e.g. pipeline screw-up)
--
--100: Multiframe deprecated because all detectors have been previously deprecated
--     (and the MF not already deprecated)
--101: MultiframeDetectors deprecated because parent Multiframe is deprecated
--     (and the MFD not already deprecated)
--102: *Detection deprecated because parent MFD deprecated.
--103: MultiframeDetector of a stack deprecated because all constituent frames
--     of the same detector are deprecated.
--104: Deep frame deprecated because a constituent MSB,OB frame has been deprecated
--110: Intermediate stack frame photometry found to be poor wrt run of all
--     stacks in a deep field.
--111: Stack replaced by a filtered version.
--112: Deprecated in QC, but released because it is used as a component of an
--     external product (e.g. UDS mosaic)
--
--
--127: Unwanted frame ingested.
--128 (or greater): Frame deprecated because reprocessing supercedes it;
--    code = 128 + any original QC deprecation code as defined above.
