因此,我保存了一些Astropy fits表(它们都具有相同的格式、列名等)。我想把所有这些fits文件合并成一个大的fits文件。
目前,我正在尝试astropy.io的附加和更新功能,但都无济于事。
任何帮助都将不胜感激。
发布于 2019-11-07 17:18:54
所以我现在让它工作了。这就是我基本上所做的:
# Read in the fits table you want to append
table = Table.read(input_file, format='fits')
# Read in the large table you want to append to
base_table = Table.read('base_file.fits', format='fits')
# Use Astropy's 'vstack' function and overwrite the file
concat_table = vstack([base_table,append_table])
concat_table.write('base_file.fits', format='fits', overwrite=True)在我的例子中,每个表的所有列都是相同的。所以我只是遍历了所有的fits文件,并一次添加了一个。可能还有其他方法可以做到这一点,但我发现这是最简单的。
https://stackoverflow.com/questions/58742707
复制相似问题