Coverage for tests/test_ApproximateBandpasses.py : 65%

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
""" Module to test that Approximate Bandpasses are in sync with the official LSST Bandpasses from SYSENG
Note: While the LSST bandpasses list throughput values corresponding to wavelengths in the range of 300.0-1150.0 nm, the `approximate_baseline` directory of throughputs is created by a script manually. It is thus possible for this directory to fall out of sync with the SYSENG values in `baseline`. This module is intended to test whether this is happening. """
""" Tests for the approximate Bandpasses in the throughputs directory """ """ setup before tests """ BandpassDict.loadTotalBandpassesFromFiles(bandpassDir=self.approxBandPassDir) " approximate bandpasses in the lsst throughputs directory do not" "sync up with the baseline bandpasses is throughputs. This may require running"
""" Test that the ratio of the quantity \int d\lambda T(\lambda) = band flux for a SED proportional to $\lambda$ for the approximate bandpasses to the SYSENG band passes is 1.0 to an absolute tolerance hard coded to be 1.0e-4
"""
# Currently we have uniform sampling, but the end points have # very slightly different steps. This accounts for 3 possible values # If there are more, then the steps are non-unifor
""" Test that individual transmission values at wavelengths kept in the approximate bandpasses match the individual transmission values in the reference bandpasses """ for bn in 'ugrizy': approxBandPass = self.approxBandPassDict[bn] refBandPass = self.refBandPass[bn] refwavelen = refBandPass.wavelen approxwavelen = approxBandPass.wavelen mask = np.zeros(len(refwavelen), dtype=bool) for i, wave in enumerate(refwavelen): if wave in approxwavelen: mask[i] = True # Assume that the wavelengths are in order msg = 'individual matches failed on band {}'.format(bn) self.assertAlmostEqual(refBandPass.sb[mask], approxBandPass.sb, 1.0e-4, msg=msg)
pass
lsst.utils.tests.init() unittest.main() |