Commit 1a829ef9 authored by Zheng Gaoshan's avatar Zheng Gaoshan
Browse files

init

parent 50a899b3
Pipeline #9049 failed with stages
in 2 minutes and 44 seconds
astropy
\ No newline at end of file
from astropy.io import fits
if __name__ == "__main__":
# 读取FITS文件
filename = 'D:\项目\天文\data\CSST_MSC_MS_SCIE_20240817060830_20240817061100_10160000001_01_L0_V01.fits'
hdu_list = fits.open(filename)
# 打印所有HDU(Header/Data Unit)的信息
hdu_list.info()
# 访问第一个HDU的数据
primary_hdu = hdu_list[1]
data = primary_hdu.data
# 打印数据类型
print("Data type:", type(data))
# 访问第一个HDU的头部信息
header = primary_hdu.header
print("Header keywords:", list(header.keys()))
# 关闭FITS文件以释放资源
hdu_list.close()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment