LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
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