redsequence.py 文件源码

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

项目:redmapper 作者: erykoff 项目源码 文件源码
def zindex(self,z):
        """
        redshift index lookup

        parameters
        ----------
        z: array of floats

        returns
        -------
        indices: array of integers
            redshift indices

        """
        # return the z index/indices with rounding.

        zind = np.searchsorted(self.zinteger,np.round(np.atleast_1d(z)*self.zbinscale).astype(np.int64))
        if (zind.size == 1):
            return np.asscalar(zind)
        else:
            return zind

        # and check for top overflows.  Minimum is always 0
        #test,=np.where(zind == self.z.size)
        #if (test.size > 0): zind[test] = self.z.size-1
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号