test_general.py 文件源码

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

项目:marvin 作者: sdss 项目源码 文件源码
def test_pix_center(self, galaxy):
        """Tests mode='pix', xyorig='center'."""

        coords = [[0, 0],
                  [5, 3],
                  [-5, 1],
                  [1, -5],
                  [10, 10],
                  [-10, -10],
                  [1.5, 2.5],
                  [0.4, 0.25]]

        expected = [[17, 17],
                    [20, 22],
                    [18, 12],
                    [12, 18],
                    [27, 27],
                    [7, 7],
                    [20, 18],
                    [17, 17]]

        cubeCoords = convertCoords(coords, mode='pix', shape=galaxy.shape)
        pytest.approx(cubeCoords, np.array(expected))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号