Skip to content

Commit

Permalink
Add min/max wavelength FilterProperty unit test.
Browse files Browse the repository at this point in the history
  • Loading branch information
isullivan committed Apr 5, 2018
1 parent 35545ec commit ceaad0d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_color.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,20 @@ def testFilterProperty(self):
self.defineFilterProperty("gX", self.g_lambdaEff, force=True))
self.assertEqual(g.getLambdaEff(), self.g_lambdaEff)

def testLambdaMinMax(self):
"""Test additional properties for minimum and maximum wavelength for a filter."""
filt = afwImage.Filter("g")
# LambdaMin and LambdaMax are undefined for the test SDSS filter, and should return nan
self.assertTrue(np.isnan(filt.getFilterProperty().getLambdaMin()))
self.assertTrue(np.isnan(filt.getFilterProperty().getLambdaMax()))
lambdaEff = 476.31
lambdaMin = 405
lambdaMax = 552
imageUtils.defineFilter("gNew", lambdaEff, lambdaMin=lambdaMin, lambdaMax=lambdaMax)
filtNew = afwImage.Filter("gNew")
self.assertEqual(lambdaMin, filtNew.getFilterProperty().getLambdaMin())
self.assertEqual(lambdaMax, filtNew.getFilterProperty().getLambdaMax())

def testFilterAliases(self):
"""Test that we can provide an alias for a Filter"""
for name0 in self.aliases:
Expand Down

0 comments on commit ceaad0d

Please sign in to comment.