LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
Functions
lsst.meas.algorithms.defects Namespace Reference

Functions

def policyToBadRegionList
 

Function Documentation

def lsst.meas.algorithms.defects.policyToBadRegionList (   policyFile)
Given a Policy file describing a CCD's bad pixels, return a vector of BadRegion::Ptr

Definition at line 30 of file defects.py.

30 
31 def policyToBadRegionList(policyFile):
32  """Given a Policy file describing a CCD's bad pixels, return a vector of BadRegion::Ptr"""
33 
34  badPixelsPolicy = policy.Policy.createPolicy(policyFile)
35  badPixels = algorithmsLib.DefectListT()
36 
37  if badPixelsPolicy.exists("Defects"):
38  d = badPixelsPolicy.getArray("Defects")
39  for reg in d:
40  x0 = reg.get("x0")
41  width = reg.get("width")
42  if not width:
43  x1 = reg.get("x1")
44  width = x1 - x0 - 1
45 
46  y0 = reg.get("y0")
47  if reg.exists("height"):
48  height = reg.get("height")
49  else:
50  y1 = reg.get("y1")
51  height = y1 - y0 - 1
52 
53  bbox = afwGeom.BoxI(afwGeom.PointI(x0, y0), afwGeom.ExtentI(width, height))
54  badPixels.push_back(algorithmsLib.Defect(bbox))
55 
56  del badPixelsPolicy
57 
58  return badPixels
An integer coordinate rectangle.
Definition: Box.h:53