本文整理汇总了Python中lsst.sims.photUtils.BandpassDict.wavelenMatch方法的典型用法代码示例。如果您正苦于以下问题:Python BandpassDict.wavelenMatch方法的具体用法?Python BandpassDict.wavelenMatch怎么用?Python BandpassDict.wavelenMatch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lsst.sims.photUtils.BandpassDict
的用法示例。
在下文中一共展示了BandpassDict.wavelenMatch方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testExceptions
# 需要导入模块: from lsst.sims.photUtils import BandpassDict [as 别名]
# 或者: from lsst.sims.photUtils.BandpassDict import wavelenMatch [as 别名]
def testExceptions(self):
"""
Test that the correct exceptions are thrown by BandpassDict
"""
nameList, bpList = self.getListOfBandpasses(4)
dummyNameList = copy.deepcopy(nameList)
dummyNameList[1] = dummyNameList[0]
with self.assertRaises(RuntimeError) as context:
testDict = BandpassDict(bpList, dummyNameList)
self.assertTrue('occurs twice' in context.exception.message)
testDict = BandpassDict(bpList, nameList)
with self.assertRaises(AttributeError) as context:
testDict.phiArray = None
with self.assertRaises(AttributeError) as context:
testDict.wavelenStep = 0.9
with self.assertRaises(AttributeError) as context:
testDict.wavelenMatch = numpy.arange(10.0,100.0,1.0)