Skip to content

Commit

Permalink
Merge pull request #280 from lsst/tickets/DM-27170
Browse files Browse the repository at this point in the history
DM-27170: Deprecate and phase out afw::image::Filter
  • Loading branch information
parejkoj committed Jan 29, 2021
2 parents 842db42 + 8871c69 commit ecc98f4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
16 changes: 2 additions & 14 deletions python/lsst/obs/lsst/lsstCamMapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,20 +453,8 @@ def std_raw(self, item, dataId, filter=True):

if filter:
obsInfo = ObservationInfo(exp.getMetadata(), translator_class=self.translatorClass)
try:
filt = afwImage.Filter(obsInfo.physical_filter)
except LookupError:
unknownName = "UNKNOWN"

logger = lsst.log.Log.getLogger("LsstCamMapper")
logger.warn('Unknown physical_filter "%s" for %s %s; replacing with "%s"',
obsInfo.physical_filter,
obsInfo.observation_id, obsInfo.detector_unique_name,
unknownName)

filt = afwImage.Filter(unknownName)

exp.setFilter(filt)
filt = afwImage.FilterLabel(physical=obsInfo.physical_filter)
exp.setFilterLabel(filt)

return exp

Expand Down
2 changes: 1 addition & 1 deletion python/lsst/obs/lsst/rawFormatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def readFull(self, parameters=None):
exposure.setVariance(variance)

info = exposure.getInfo()
info.setFilter(self.makeFilter())
info.setFilterLabel(self.makeFilterLabel())
info.setVisitInfo(self.makeVisitInfo())
info.setWcs(self.makeWcs(info.getVisitInfo(), info.getDetector()))

Expand Down
4 changes: 4 additions & 0 deletions tests/test_ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class LatissIngestTestCase(IngestTestBase, lsst.utils.tests.TestCase):
ingestDir = TESTDIR
file = os.path.join(DATAROOT, "latiss", "raw", "2018-09-20", "3018092000065-det000.fits")
dataIds = [dict(instrument="LATISS", exposure=3018092000065, detector=0)]
filterLabel = lsst.afw.image.FilterLabel(physical="unknown~unknown")


class Ts3IngestTestCase(IngestTestBase, lsst.utils.tests.TestCase):
Expand All @@ -49,6 +50,7 @@ class Ts3IngestTestCase(IngestTestBase, lsst.utils.tests.TestCase):
ingestDir = TESTDIR
file = os.path.join(DATAROOT, "ts3", "raw", "2018-11-15", "201811151255111-R433-S00-det433.fits")
dataIds = [dict(instrument="LSST-TS3", exposure=201811151255111, detector=433)]
filterLabel = lsst.afw.image.FilterLabel(physical="550CutOn")


class ComCamIngestTestCase(IngestTestBase, lsst.utils.tests.TestCase):
Expand All @@ -59,6 +61,7 @@ class ComCamIngestTestCase(IngestTestBase, lsst.utils.tests.TestCase):
file = os.path.join(DATAROOT, "comCam", "raw", "2019-05-30",
"3019053000001", "3019053000001-R22-S00-det000.fits")
dataIds = [dict(instrument="LSSTComCam", exposure=3019053000001, detector=0)]
filterLabel = lsst.afw.image.FilterLabel(physical="unknown", band="unknown")


class LSSTCamIngestTestCase(IngestTestBase, lsst.utils.tests.TestCase):
Expand All @@ -69,6 +72,7 @@ class LSSTCamIngestTestCase(IngestTestBase, lsst.utils.tests.TestCase):
file = os.path.join(DATAROOT, "lsstCam", "raw", "2019-03-19",
"3019031900001", "3019031900001-R10-S02-det029.fits")
dataIds = [dict(instrument="LSSTCam", exposure=3019031900001, detector=29)]
filterLabel = lsst.afw.image.FilterLabel(physical="unknown", band="unknown")


def setup_module(module):
Expand Down

0 comments on commit ecc98f4

Please sign in to comment.