本文整理汇总了Python中lsst.sims.photUtils.BandpassDict.keys方法的典型用法代码示例。如果您正苦于以下问题:Python BandpassDict.keys方法的具体用法?Python BandpassDict.keys怎么用?Python BandpassDict.keys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lsst.sims.photUtils.BandpassDict
的用法示例。
在下文中一共展示了BandpassDict.keys方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testInitialization
# 需要导入模块: from lsst.sims.photUtils import BandpassDict [as 别名]
# 或者: from lsst.sims.photUtils.BandpassDict import keys [as 别名]
def testInitialization(self):
"""
Test that all of the member variables of BandpassDict are set
to the correct value upon construction.
"""
for nBp in range(3,10,1):
nameList, bpList = self.getListOfBandpasses(nBp)
testDict = BandpassDict(bpList, nameList)
self.assertEqual(len(testDict), nBp)
for controlName, testName in zip(nameList, testDict):
self.assertEqual(controlName, testName)
for controlName, testName in zip(nameList, testDict.keys()):
self.assertEqual(controlName, testName)
for name, bp in zip(nameList, bpList):
numpy.testing.assert_array_almost_equal(bp.wavelen, testDict[name].wavelen, 10)
numpy.testing.assert_array_almost_equal(bp.sb, testDict[name].sb, 10)
for bpControl, bpTest in zip(bpList, testDict.values()):
numpy.testing.assert_array_almost_equal(bpControl.wavelen, bpTest.wavelen, 10)
numpy.testing.assert_array_almost_equal(bpControl.sb, bpTest.sb, 10)