使用星号读取Kepler FITS文件时出错

问题描述 投票:0回答:1

我试图使用astropy从Kepler FITS文件(从此URL https://archive.stsci.edu/pub/kepler/lightcurves/0007/000757076/接收)中读取拟合文件。以下是我尝试读取文件的命令集:

from astropy.io import fits
fits_image_filename = fits.util.get_testdata_filepath(r'O:\MyWorks\keplar-test\kplr100000925-2009166043257_llc.fits')

但是以上命令产生了此错误:

enter image description here

我不确定如何解决此错误。我的目标是读取凯夫拉尔数据,然后作图和/或将其转换为CSV。

python astropy fits
1个回答
1
投票

此:fits.util.get_testdata_filepath(r'O:\MyWorks\keplar-test\kplr100000925-2009166043257_llc.fits')不是打开文件的正确功能。

您应该使用fits.open('file.fits'),或者如果这是表数据,则暗示为Table.read('file.fits')

请参阅FITS documentation顶部的注释

© www.soinside.com 2019 - 2024. All rights reserved.