Skip to content

Commit

Permalink
Merge pull request #190 from lsst/tickets/DM-22550
Browse files Browse the repository at this point in the history
DM-22550: Reset filters before defining new filters
  • Loading branch information
timj committed Dec 16, 2019
2 parents 608b899 + ba315b9 commit e91d8c4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
1 change: 1 addition & 0 deletions python/lsst/obs/base/fitsRawFormatterBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class FitsRawFormatterBase(FitsExposureFormatter, metaclass=ABCMeta):
"""

def __init__(self, *args, **kwargs):
self.filterDefinitions.reset()
self.filterDefinitions.defineFilters()
super().__init__(*args, **kwargs)

Expand Down
1 change: 1 addition & 0 deletions python/lsst/obs/base/instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def filterDefinitions(self):
return None

def __init__(self, *args, **kwargs):
self.filterDefinitions.reset()
self.filterDefinitions.defineFilters()

@classmethod
Expand Down
10 changes: 2 additions & 8 deletions tests/test_instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,15 @@
import lsst.utils
from lsst.daf.butler.core import Registry
from lsst.daf.butler.core.butlerConfig import ButlerConfig
from lsst.obs.base import Instrument
from lsst.obs.base import Instrument, FilterDefinitionCollection

"""Tests of the Instrument class.
"""


class DummyCam(Instrument):

class FilterDefinitions:
"""Stopgap until Instrument is moved into obs_base and we can use the
real FilterDefinitions there.
"""
def defineFilters(self):
pass
filterDefinitions = FilterDefinitions()
filterDefinitions = FilterDefinitionCollection()

@classmethod
def getName(cls):
Expand Down

0 comments on commit e91d8c4

Please sign in to comment.