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

Class CrossTalkFlagger

source code


Defines the cross-talk artefact flagging algorithm and process.


To Do: Complete reliability tests (trac ticket:32)

Nested Classes [hide private]
    Errors & Exceptions
  MissingStarError
Exception thrown if a 2MASS star can't be found in a WFCAM image.
Instance Methods [hide private]
 
__init__(self, bitMask, updater)
Initialise cross-talk flagger.
source code
 
run(self)
Flag cross-talk artefacts.
source code
list(tuple(int, int))
_getMultiframeList(self)
Works through all of the latest multiframe versions that contribute to this detection table, where cross-talk flag has not already been set.
source code
list(tuple(float, float, float)
_getBrightStars(self, curDet)
Returns: A list of bright star positions and J-band magnitudes in the current detector field from the 2MASS catalogue.
source code
tuple(float, float, float)
_locateBrightStar(self, ra, dec, j_m, curDet)
Finds the location of a bright star on the WFCAM detector given the RA, Dec coordinates, by finding the equivalent WFCAM detection.
source code
float
_calcArtefactRadius(self, j_m, artErr, xPixSize, pixFactor)
Returns the radius in pixels for a first-order cross-talk artefact produced by a star of given brightness (j_m).
source code
list(str)
_createArtefactList(self, x, y, artRad, artSpacing, xSize, ySize, xOffset, yOffset)
Creates a list of artefact positions along each direction from a bright cross-talk producing star.
source code
list(str)
_createStripList(self, x1, x2, artRad, artSpacing, size, isXY)
Determines the list of artefacts in the one-dimension (both directions) from a given position of a bright star on the detector image.
source code
int
_flagDetector(self, artefacts, mfID, extNum)
Flags possible cross-talk artefacts in the detection table, given a list of artefacts positions as SQL where clause predicates.
source code
 
_commitMultiframe(self, mfID)
Commits all updates to the detection table for a given multiframe and updates the relevant ppErrBitsStatus flag in ProgrammeTable.
source code

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

Class Variables [hide private]
  roundingErr = 0.0002
Default uncertainty in astrometry due to rounding (degrees).
  searchErr = 0.003
Search radius limit for non-detected 2MASS stars (degrees).
  magLim = 14
2MASS J-band magnitude limit for star to create cross-talk.
  densityLimit = 150
Field bright star density limit for cross-talk flagging.
  avoidDenseFields = False
Only flag fields beneath the density limit?
  bitMask = None
Hexadecimal bit mask string to denote possible cross-talk artefacts.
  _detTable = None
Detection table to be flagged.
  _twomass = None
Connection to 2MASS database.
  _updater = None
The calling QualityFlagUpdater object.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, bitMask, updater)
(Constructor)

source code 

Initialise cross-talk flagger. Prepares connection to 2MASS server.

Parameters:
  • bitMask (str) - Hexadecimal bit mask string used to denote possible cross-talk artefacts.
  • updater (QualityFlagUpdater) - The calling QualityFlagUpdater object.
Overrides: object.__init__

_getMultiframeList(self)

source code 

Works through all of the latest multiframe versions that contribute to this detection table, where cross-talk flag has not already been set.

Returns: list(tuple(int, int))
List of multiframeIDs with number of microsteps.

_getBrightStars(self, curDet)

source code 
Returns: list(tuple(float, float, float)
A list of bright star positions and J-band magnitudes in the current detector field from the 2MASS catalogue.

_locateBrightStar(self, ra, dec, j_m, curDet)

source code 

Finds the location of a bright star on the WFCAM detector given the RA, Dec coordinates, by finding the equivalent WFCAM detection.

Returns: tuple(float, float, float)
Pixel coordinate of star on WFCAM detector, and error in degrees.

_calcArtefactRadius(self, j_m, artErr, xPixSize, pixFactor)

source code 

Returns the radius in pixels for a first-order cross-talk artefact produced by a star of given brightness (j_m). This radius is increased by artErr to consider the offset between the 2MASS position of the star and the WFCAM position. The radius is increased instead of just shifting centre, because this offset could be due to a 2MASS object becoming decoupled in the WFCAM image into multiple sources.

Returns: float
Radius of artefact in pixels.

_createArtefactList(self, x, y, artRad, artSpacing, xSize, ySize, xOffset, yOffset)

source code 

Creates a list of artefact positions along each direction from a bright cross-talk producing star. Having first determined which directions artefacts would be produced by a bright-star in this quadrant of the detector, considering the effects of dithering too.

Returns: list(str)
List of SQL where clause predicates for each strip of cross-talk artefacts for each direction.

_createStripList(self, x1, x2, artRad, artSpacing, size, isXY)

source code 

Determines the list of artefacts in the one-dimension (both directions) from a given position of a bright star on the detector image. The algorithm keeps appending cross-talk artefact positions to the list until the edge of each the detector quadrant is reached.

Parameters:
  • x1 (float) - Position of bright cross-talk producing star in the dimension along-which artefacts will be produced for this position on the detector.
  • x2 (float) - Position of bright cross-talk producing star in the other dimension.
  • artRad (float) - Radius of a cross-talk artefact in pixels.
  • artSpacing (float) - Absolute spacing in pixels between artefacts in this detector image.
  • size (float) - Width of the detector image along the x1-dimension.
  • isXY (bool) - If True, then x1=x, x2=y, to find cross-talk artefacts along the x-dimension of the detector, otherwise x1=y, x2=x to find artefacts along the y-dimension.
Returns: list(str)
List containing a single SQL where clause predicate that specifies a strip of artefact positions along one-dimension, with the same radial width.

_flagDetector(self, artefacts, mfID, extNum)

source code 

Flags possible cross-talk artefacts in the detection table, given a list of artefacts positions as SQL where clause predicates.

Returns: int
Number of detections flagged.