import pyfits
import matplotlib.pyplot as plt
# Load the FITS file into the program
hdulist = pyfits.open('Your FITS file name here')
# Load table data as tbdata
tbdata = hdulist[1].data
fields = ['J','H','K'] #This contains your column names
var = dict((f, tbdata.field(f)) for f in fields) #Creating a dictionary that contains
#variable names J,H,K
#Now to call column J,H and K just use
J = var['J']
H = var['H']
K = var['K']
#To plot J Vs H and H Vs K and so on
plt.plot(J,H,'r')
plt.title('Your plot title here')
plt.show()
这是一个非常普遍和基本的问题。在
首先需要打开FITS文件并打印,下面是一个示例程序:
相关问题 更多 >
编程相关推荐