Skip to content

Commit

Permalink
Surpress known deprecated Filter calls
Browse files Browse the repository at this point in the history
  • Loading branch information
parejkoj committed Mar 2, 2021
1 parent 152df1a commit a82ad56
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions python/lsst/obs/lsst/lsstCamMapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
"""The LsstCam Mapper.""" # necessary to suppress D100 flake8 warning.

import os
import warnings

import lsst.log
import lsst.geom
import lsst.utils as utils
Expand Down Expand Up @@ -153,13 +155,17 @@ def __init__(self, inputPolicy=None, **kwargs):
# actually in the second wheel, but that's OK -- we still easily fit
# in 7 bits (5 would actually be enough)

baseFilters = set()
for n in afwImage.Filter.getNames():
i = n.find('~')
if i >= 0:
n = n[:i]
with warnings.catch_warnings():
# surpress Filter warnings; we already know getNames is deprecated
warnings.simplefilter('ignore', category=FutureWarning)

baseFilters = set()
for n in afwImage.Filter.getNames():
i = n.find('~')
if i >= 0:
n = n[:i]

baseFilters.add(n)
baseFilters.add(n)

nFilter = len(baseFilters)
if nFilter >= 2**LsstCamMapper._nbit_filter:
Expand Down

0 comments on commit a82ad56

Please sign in to comment.