Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-27170: Deprecate and phase out afw::image::Filter #280

Merged
merged 2 commits into from
Jan 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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")
parejkoj marked this conversation as resolved.
Show resolved Hide resolved


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