test_utilities.py 文件源码

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

项目:redmapper 作者: erykoff 项目源码 文件源码
def runTest(self):
        """
        This tests the functionality of the redmapper.utilities
        spline against the spline output values from a spline
        implemented in IDL found in RM 6.3.1 DR8.
        """
        # create test data
        # these numbers are from redMaPPer 6.3.1, DR8
        xx = np.array([0.05,0.15,0.25,0.35,0.45,0.60],dtype=np.float64)
        yy = np.array([15.685568,17.980721,18.934799,19.671671,19.796223,20.117981], dtype=np.float64)

        # will want to add error checking and exceptions to CubicSpline

        spl=redmapper.utilities.CubicSpline(xx, yy)
        vals=spl(np.array([0.01, 0.44, 0.55, 0.665]))

        # these numbers are also from redMaPPer 6.3.1, DR8
        testing.assert_almost_equal(vals,np.array([14.648017,19.792828,19.973761,20.301322],dtype=np.float64),decimal=6)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号