【问题标题】:Can't read FITS file with GalSim无法使用 GalSim 读取 FITS 文件
【发布时间】:2017-09-11 15:28:25
【问题描述】:

设置

  • MacOS 10.12.6
  • Python 2.7
  • Galsim 1.4.4
  • Numpy 1.13.1
  • 天文 1.3.3
  • Fitsio

目标

我的目标是拍摄模拟的广域 HST 图像(12288*12288 像素,.fits 格式大约 600MB)并向其中添加 WFIRST 检测器功能。

问题

很遗憾,我在阅读 fit 文件时遇到了困难。
主要问题是如何以我们可以通过 galsim 操作它们的方式调整图像。

我试过了

我尝试了 galsim 拟合方法‘galsim.fits.read(“fine_name.fits”)’,我得到了:

galsim.Image(bounds=galsim.BoundsI(xmin=1, xmax=12288, ymin=1, ymax=12288), array=
    array([[ 0., 0., 0., ..., 0., 0., 0.],
[ 0., 0., 0., ..., 0., 0., 0.],
[ 0., 0., 0., ..., 0., 0., 0.],
...,
[ 0., 0., 0., ..., 0., 0., 0.],
[ 0., 0., 0., ..., 0., 0., 0.],
[ 0., 0., 0., ..., 0., 0., 0.]], dtype=float32), wcs=galsim.PixelScale(1.0))

我也尝试过fitsio.read(“file_name.fits”),但我仍然无法通过“galsim.Convolve”对 PSF 进行卷积或添加检测器功能。

-谢谢

【问题讨论】:

  • “我无法卷积...”等是什么意思?你有错误吗?你到底遇到了什么问题?

标签: fits galsim


【解决方案1】:

如果您阅读 galsim.fits.read 的文档字符串,您会看到它返回一个 galsim.Image,正如您在实验中发现的那样。要创建 GSObject,您需要实例化一个 galsim.InterpolatedImage,这将允许您进行卷积和执行其他操作。您可以阅读 galsim.InterpolatedImage 的文档字符串,和/或查看 galsim demo11.py 以查看实际执行的示例(将图像文件读入 InterpolatedImage 并与其他内容进行卷积)。

检测器功能确实被添加到图像中,而不是 GSObjects。有关这方面的示例,请参阅 GalSim 的 demo13.py。

快速参考指南https://github.com/GalSim-developers/GalSim/blob/releases/1.4/doc/GalSim_Quick_Reference.pdf 和 GalSim 存储库中的演示涵盖了基本 GalSim 使用问题。

【讨论】:

    猜你喜欢
    • 2021-07-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-18
    • 2017-07-25
    相关资源
    最近更新 更多