将不同的拟合扩展标头和数据组合到新的拟合文件中
我有一个fits.gz文件,其中包含
No. Name Ver Type Cards Dimensions Format
0 PRIMARY 1 PrimaryHDU 720 ()
1 VidInp1 1 ImageHDU 359 (577, 2048) int16 (rescales to uint16)
2 VidInp2 1 ImageHDU 359 (577, 2048) int16 (rescales to uint16)
3 VidInp3 1 ImageHDU 359 (577, 2048) int16 (rescales to uint16)
4 VidInp4 1 ImageHDU 359 (577, 2048) int16 (rescales to uint16)
我试图从Exten [0]中获取标头的5个不同扩展名,并且来自Exten [3]的数据创建了一个新的拟合文件,该文件仅具有1个扩展名。我目前正在尝试使用Astropy.io..fit来实现这一目标,但是如果有一种干净的方法可以做到这一点,我从文档中尚不清楚。是否可以使用更好的软件包,或者这是一个混乱的过程?
I have a fits.gz file which contains 5 different extensions
No. Name Ver Type Cards Dimensions Format
0 PRIMARY 1 PrimaryHDU 720 ()
1 VidInp1 1 ImageHDU 359 (577, 2048) int16 (rescales to uint16)
2 VidInp2 1 ImageHDU 359 (577, 2048) int16 (rescales to uint16)
3 VidInp3 1 ImageHDU 359 (577, 2048) int16 (rescales to uint16)
4 VidInp4 1 ImageHDU 359 (577, 2048) int16 (rescales to uint16)
I'm trying to take the header from exten[0] and the data from exten[3] to create a new fits file which only has 1 extension. I'm currently trying to use astropy.io.fits to achieve this, but it's not clear to me from the documentation if there's a clean way to do this. Is there a better package to use, or is this a messy process no matter what?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该解决方案原来非常简单/优雅,这是我所希望的。
文件名是原始拟合文件,而splitfileName是创建的文件
The solution turns out to be very simple/elegant, a one liner which is what I was hoping for.
where fileName is the original fits file and splitFileName is the created file