Package wsatools :: Module QualityControl :: Class QualityFlagUpdater
[hide private]

Class QualityFlagUpdater

source code


Fills the ppErrBits attribute of the given programme's detection table.

Transactions are committed on a per bit flag basis, as there is an option to just run for certain bit flags. The cross-talk flag is the exception, committing on a per multiframe basis, and consequently also updates ppErrBitsStatus on a per multiframe basis to ensure database consistency.


Note: Only the cross-talk flag skips detections from deprecated frames. This is because skipping deprecated frames for the other, single, updates will probably be slower as there is no index on the deprecated flag.

Nested Classes [hide private]
    Nested Errors and Exceptions

Inherited from DbConnect.CuSession.CuSession: CuError

Instance Methods [hide private]
 
_onRun(self)
Update quality bit flags for current programme.
source code
str
bitMask(self, bitNumber)
Given a binary bit number, return the corresponding hexadecimal bit mask.
source code
int
bitNumber(self, bitMask)
Given a hexadecimal bit mask, return the corresponding binary bit number string.
source code
 
doBitFlag(self, bitNum, msg)
Checks whether we should apply this bit flag.
source code
bool
isMosaicProvenanceComplete(self)
Returns: True, if the mosaic Provenance is fully up-to-date.
source code
bool
requiresUpdate(self, bitMask, frameType=None, isNonDepOnly=False)
Does the current detection table require quality flagging?
source code
 
updateBadDetFlag(self, bitMask, condition, frameType='tile%stack')
Updates bit flag for source in a tile region coming from one or more bad detectors as defined by given condition.
source code
 
updateBadPixelFlag(self)
Updates bit flag for bad pixel in source condition.
source code
 
updateBoundaryFlag(self, bitMask, frameTypes, xWidth=None, yWidth=None)
Updates bit flag for source close to boundary condition.
source code
 
updateCrossTalkFlag(self, bitMask)
Updates bit flag for possible cross-talk artefact.
source code
 
updateDeblendedFlag(self)
Updates bit flag for deblended source condition.
source code
 
updateDet16Flag(self)
Updates bit flag for source in a region of a tile coming from detector 16.
source code
 
updateDitherFlag(self)
Updates bit flag for source in a dither region.
source code
 
updateEarFlag(self)
Updates bit flag for source in a ear region of a tile.
source code
 
updateLowConfidenceFlag(self)
Updates bit flag for low average confidence in source image condition.
source code
 
updateMissingDetFlag(self)
Updates bit flag for source in a region of a tile coming from one or more missing paw-print detectors.
source code
 
updatePoorFlatFieldFlag(self)
Updates bit flag for source in a region where flat fielding was poor.
source code
 
updateSaturatedFlag(self)
Updates bit flag for source close to saturation condition.
source code
 
updateStatus(self, bitMask, mfID=None, frameType=None, isNonDepOnly=False)
Updates ProgrammeFrame to denote quality flagging done.
source code
 
updateUncorrectedFlag(self)
Updates bit flag for source without illumination-corrected photometry condition.
source code
str
_whereProgrammeObs(self, bitMask=None, mfID=None)
Selection of the unflagged (or given) observations from the current programme with existing entries in the current detection table
source code

Inherited from DbConnect.CuSession.CuSession: __del__, __init__, logBrokenFile, run

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]

Inherited from DbConnect.CuSession.CuSession: logException

Class Variables [hide private]
  cuNum = 24
Curation task number.
  dateRange = DateRange(begin=<mx.DateTime.DateTime object for '...
Limit date range of flagging monthly tables to this value.
  doBit = -1
Number of big flag to be updated on this run (-1 = all).
  isDeepOnly = False
Only flag detections from deep WFAU-products?
  skipProvenanceCheck = False
Skip mosaic provenance completeness check?
  _detTable = None
Detection table currently being updated.
  _doMosaics = False
Does this programme have mosaics that need flagging too?

Inherited from DbConnect.CuSession.CuSession: archive, comment, cuEventID, curator, eTypes, isDayStampedLog, onlyNonSurveys, onlySurveys, programme, programmeID, resultsFilePathName, shareFileID, sysc

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_onRun(self)

source code 

Update quality bit flags for current programme.

Overrides: DbConnect.CuSession.CuSession._onRun

bitMask(self, bitNumber)

source code 

Given a binary bit number, return the corresponding hexadecimal bit mask.

Parameters:
  • bitNumber (int) - Binary bit number.
Returns: str
Hexadecimal bit mask.

bitNumber(self, bitMask)

source code 

Given a hexadecimal bit mask, return the corresponding binary bit number string.

Parameters:
  • bitMask (str) - Hexadecimal string.
Returns: int
Binary bit number.

isMosaicProvenanceComplete(self)

source code 
Returns: bool
True, if the mosaic Provenance is fully up-to-date.

requiresUpdate(self, bitMask, frameType=None, isNonDepOnly=False)

source code 

Does the current detection table require quality flagging?

Parameters:
  • bitMask (str) - Bit mask for the quality issue to check (hexadecimal).
  • frameType (str) - Optionally only check frames of this type.
  • isNonDepOnly (bool) - If True, only check non-deprecated entries.
Returns: bool
True, if incomplete quality flagging for current detection table.

updateBadDetFlag(self, bitMask, condition, frameType='tile%stack')

source code 

Updates bit flag for source in a tile region coming from one or more bad detectors as defined by given condition. Flags sources with a default aperture that is at least partially in one of these regions. Also, considers positional offsets in forming deep tiles.

Parameters:
  • bitMask (str) - Bit mask for this quality issue (hexadecimal).
  • condition (str) - Where clause that identifies detector as bad.
  • frameType (str) - Optionally only flag frames of this type.

updateBoundaryFlag(self, bitMask, frameTypes, xWidth=None, yWidth=None)

source code 

Updates bit flag for source close to boundary condition. Flags sources with a default aperture that is at least partially in the underexposed boundary region of a stack (either due to dithering = microstep + jitter, or for tiles also the "ears"). Also, considers positional offsets in forming deep stacks.

Parameters:
  • bitMask (str) - Bit mask for this quality issue (hexadecimal).
  • frameTypes (str) - SQL string defining the frame types that this underexposed region applies to.
  • xWidth (str) - SQL string defining the fully exposed width on the x-axis in pixels.
  • yWidth (str) - SQL string defining the fully exposed width on the y-axis in pixels.

Note: axis1/2Length is more reliable than x/ySize.

updateCrossTalkFlag(self, bitMask)

source code 

Updates bit flag for possible cross-talk artefact. This method is quite unlike the other methods where the entire table is updated at once, here a list of multiframes are updated.

Parameters:
  • bitMask (str) - Bit mask for this quality issue (hexadecimal).

updateDet16Flag(self)

source code 

Updates bit flag for source in a region of a tile coming from detector 16. Flags sources with a default aperture that is at least partially in one of these regions. Also, considers positional offsets in forming deep tiles.

updateDitherFlag(self)

source code 

Updates bit flag for source in a dither region. Flags sources with a default aperture that is at least partially in the underexposed boundary region of a stack due to dithering = microstep + jitter. Also, considers positional offsets in forming deep stacks.

To Do: Boundary flag for UDS mosaic? Probably not worthwhile because there is only one field with detections consistent in each band, so users could just make their own x/y cuts. Alternatively implement a flag based on avConf.

updateEarFlag(self)

source code 

Updates bit flag for source in a ear region of a tile. Flags sources with a default aperture that is at least partially in the underexposed strip of a tile. Also, considers positional offsets in forming deep tiles.

updateMissingDetFlag(self)

source code 

Updates bit flag for source in a region of a tile coming from one or more missing paw-print detectors. Flags sources with a default aperture that is at least partially in one of these regions. Also, considers positional offsets in forming deep tiles.

updatePoorFlatFieldFlag(self)

source code 

Updates bit flag for source in a region where flat fielding was poor. Flags sources with a default aperture that is at least partially in this region, accounting for stack dithering (= microstep + jitter) and positional offsets in forming deep stacks.

updateStatus(self, bitMask, mfID=None, frameType=None, isNonDepOnly=False)

source code 

Updates ProgrammeFrame to denote quality flagging done.

Parameters:
  • bitMask (str) - Bit mask of quality flag to mark as done (hexadecimal).
  • mfID (int) - Optionally just set this multiframeID as flagging done.
  • frameType (str) - Optionally only flag frames of this type.
  • isNonDepOnly (bool) - If True, only flag non-deprecated entries.

_whereProgrammeObs(self, bitMask=None, mfID=None)

source code 

Selection of the unflagged (or given) observations from the current programme with existing entries in the current detection table

Parameters:
  • bitMask (str) - Optionally select this bit as unflagged (hexadecimal).
  • mfID (int) - Optionally just select this multiframeID.
Returns: str
SQL WHERE string clause to specify just the unflagged (or given) observations from the current programme in the current detection table.

Class Variable Details [hide private]

dateRange

Limit date range of flagging monthly tables to this value.

Value:
DateRange(begin=<mx.DateTime.DateTime object for '1753-01-01 00:00:00.\
00' at 318c108>, end=<mx.DateTime.DateTime object for '9999-12-31 00:0\
0:00.00' at 3aed0c0>)