test_utilities.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:redmapper 作者: erykoff 项目源码 文件源码
def runTest(self):
        """
        This tests the MStar function found in the utilities
        class at two different decimal levels.
        """
        # make sure invalid raises proper exception
        self.assertRaises(IOError,redmapper.utilities.MStar,'blah','junk')

        # make an SDSS test...
        ms = redmapper.utilities.MStar('sdss','i03')

        mstar = ms([0.1,0.2,0.3,0.4,0.5])
        # test against IDL...
        testing.assert_almost_equal(mstar,np.array([16.2375,17.8500,18.8281,19.5878,20.1751]),decimal=4)
        # and against regressions...
        testing.assert_almost_equal(mstar,np.array([ 16.23748776,  17.85000035,  18.82812871,  19.58783337,  20.17514801]))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号