Coverage for tests/testSedUtils.py : 40%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
lsst.utils.tests.init()
""" Test that the special test case getImsimFluxNorm returns the same value as calling calcFluxNorm actually passing in the imsim Bandpass """
bp = Bandpass() bp.imsimBandpass()
rng = np.random.RandomState(1123) wavelen = np.arange(300.0, 2000.0, 0.17)
for ix in range(10): flux = rng.random_sample(len(wavelen))*100.0 sed = Sed() sed.setSED(wavelen=wavelen, flambda=flux) magmatch = rng.random_sample()*5.0 + 10.0
control = sed.calcFluxNorm(magmatch, bp) test = getImsimFluxNorm(sed, magmatch)
# something about how interpolation is done in Sed means # that the values don't come out exactly equal. They come # out equal to 8 seignificant digits, though. self.assertEqual(control, test)
lsst.utils.tests.init() unittest.main() |