简体   繁体   English

使用aplpy制作3色FITS文件

[英]Making a 3 Colour FITS file using aplpy

I am trying to make a three colour FITS image using the $aplpy.make_rgb_image$ function. 我正在尝试使用$ aplpy.make_rgb_image $函数制作三色FITS图像。 I use three separate FITS images in RGB to do so and am able to save a colour image in png, jpeg.... formats, but I would prefer to save its as a FITS file. 我使用RGB中的三个单独的FITS图像来进行操作,并且能够将彩色图像保存为png,jpeg ....格式,但是我希望将其另存为FITS文件。 When I try that I get the following error. 当我尝试时,出现以下错误。

IOError: FITS save handler not installed IOError:未安装FITS保存处理程序

I've tried to find a solution in the web for a few days but was unable to get any good results. 我尝试了几天在网络上找到解决方案,但无法获得任何良好的结果。 Would anyone know how to get such a handler installed, or perhaps any other approach I could use to get this done? 谁会知道如何安装这样的处理程序,或者我可以使用其他任何方法来完成此操作?

I don't think there is enough information for me to answer your question completely; 我认为没有足够的信息可以让我完全回答您的问题; for example, I don't know what call you are making to perform the "image" "save", but I can guess: 例如,我不知道您要执行什么调用来执行“图像”“保存”,但是我可以猜测:

FITS does not store RGB data like you wish it to. FITS不会像您希望的那样存储RGB数据。 FITS can store multi-band data as individual monochromatic data layers in a multi-extension data "cube". FITS可以将多波段数据作为单个单色数据层存储在多扩展数据“多维数据集”中。 Software, including ds9 and aplpy, can read that FITS data cube and author RGB images in RGB formats (png, jpg...). 包括ds9和aplpy在内的软件都可以读取FITS数据立方体,并以RGB格式(png,jpg ...)编写RGB图像。 The error you see comes from PIL, which has no backend to author FITS files (I think, but the validity of that point doesn't matter). 您看到的错误来自PIL,它没有编写FITS文件的后端(我认为,但这一点的有效性无关紧要)。

So I think that you should use aplpy.make_rgb_cube to save a 3 HDU FITS cube based your 3 input FITS files, then import that FITS cube back into aplpy and use aplpy.make_rgb_image to output RGB compatible formats. 因此,我认为您应该使用aplpy.make_rgb_cube保存基于3个输入FITS文件的3个HDU FITS多维数据集,然后将该FITS多维数据集导入回aplpy并使用aplpy.make_rgb_image输出RGB兼容格式。 This way you have the saved FITS cube in near native astronomy formats, and a means to create RGB formats from a variety of tools that can import that cube. 通过这种方式,您可以将保存的FITS多维数据集保存为接近本机的天文格式,并且可以通过多种可以导入该多维数据集的工具来创建RGB格式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM