sky.py 文件源码

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

项目:fg21sim 作者: liweitianux 项目源码 文件源码
def world2pix(self, x, y):
        """
        Convert the world coordinates (R.A., Dec.) into the pixel
        coordinates (indexes) within the sky data array.

        Parameters
        ----------
        x, y : float, `~numpy.ndarray`
            The R.A., Dec. world coordinates
            Unit: [deg]

        Returns
        -------
        ri, ci : int, `~numpy.ndarray`
            The row, column indexes within the sky data array.
        """
        pixelsize = self.pixelsize * AUC.arcsec2deg  # [deg]
        x, y = np.asarray(x), np.asarray(y)  # [deg]
        ri0, ci0 = self.ysize//2, self.xsize//2
        ri = np.round((y - self.ycenter) / pixelsize + ri0).astype(int)
        ci = np.round((x - self.xcenter) / pixelsize + ci0).astype(int)
        return (ri, ci)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号