从 astropy 中的行构建新的 table
build new table from rows in astropy
我正在尝试使用 python 包 astropy 在天文目录(FITS 文件)中剪切出几个选定的对象。我的问题是如何裁剪出这些对象并保存在新的目录中?
将它们转换为 astropy.table.Table
对象:
from astropy.table import Table
orig_catalogue = Table.read('filename.fits')
然后 select 您的目标(使用索引。即找到所有比 100 更有趣的对象)并将它们写入新的拟合文件:
new_catalogue = orig_catalogue[orig_catalogue['interesting'] > 100]
new_catalogue.write('new_filename.fits')
我正在尝试使用 python 包 astropy 在天文目录(FITS 文件)中剪切出几个选定的对象。我的问题是如何裁剪出这些对象并保存在新的目录中?
将它们转换为 astropy.table.Table
对象:
from astropy.table import Table
orig_catalogue = Table.read('filename.fits')
然后 select 您的目标(使用索引。即找到所有比 100 更有趣的对象)并将它们写入新的拟合文件:
new_catalogue = orig_catalogue[orig_catalogue['interesting'] > 100]
new_catalogue.write('new_filename.fits')