Skip to content

Commit

Permalink
Remove deprecated policyToBadRegionList function
Browse files Browse the repository at this point in the history
  • Loading branch information
timj committed Aug 30, 2019
1 parent 5142e5f commit e98e28a
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions python/lsst/meas/algorithms/defects.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import logging
import itertools
import collections.abc
from deprecated.sphinx import deprecated
import numpy as np
import copy
import datetime
Expand All @@ -37,7 +36,6 @@
import astropy.table

import lsst.geom
import lsst.pex.policy as policy
import lsst.afw.table
import lsst.afw.detection
import lsst.afw.image
Expand All @@ -52,36 +50,6 @@
SCHEMA_VERSION_KEY = "DEFECTS_SCHEMA_VERSION"


@deprecated(reason="Policy defect files no longer supported (will be removed after v18)",
category=FutureWarning)
def policyToBadRegionList(policyFile):
"""Given a Policy file describing a CCD's bad pixels, return a vector of BadRegion::Ptr"""

badPixelsPolicy = policy.Policy.createPolicy(policyFile)
badPixels = []

if badPixelsPolicy.exists("Defects"):
d = badPixelsPolicy.getArray("Defects")
for reg in d:
x0 = reg.get("x0")
width = reg.get("width")
if not width:
x1 = reg.get("x1")
width = x1 - x0 - 1

y0 = reg.get("y0")
if reg.exists("height"):
height = reg.get("height")
else:
y1 = reg.get("y1")
height = y1 - y0 - 1

bbox = lsst.geom.BoxI(lsst.geom.PointI(x0, y0), lsst.geom.ExtentI(width, height))
badPixels.append(Defect(bbox))

return badPixels


class Defects(collections.abc.MutableSequence):
"""Collection of `lsst.meas.algorithms.Defect`.
Expand Down

0 comments on commit e98e28a

Please sign in to comment.