2014-10-11 42 views
0

基本上我只想從r波段適合文件here獲得圖像數據,該文件使用已經合併到天體中的pyfits。這裏是我的嘗試:從SDSS的適合文件中獲取圖像DR10

from astropy.io import fits 
import matplotlib.pyplot as plt 

hdulist = fits.open("frame-r-004646-1-0019.fits") 
hdulist.info() 

imgplot = plt.imshow(hdulist[0].data) 
imgplot.set_cmap('binary_r') 

plt.show() 
hdulist.close() 

目前,我只能看,而不是明亮的星星JPEG圖像中看到小小的圓點。 此外,ImageHDU不包含圖像(因爲它是一維數組,所以不能包含圖像) 任何想法爲什麼這是?

最後,我試圖從(ra,dec)的圖像中識別出我的目標星系。擬合文件具有與其關聯的(ra,dec)以及每像素0.396弧秒的像素比例。所以我想知道哪個角落(ra,dec)正在談論,所以我可以推斷圖像中目標的位置!

回答

4

你會想一些體面的色彩正常化,就像這樣:

imshow(im,vmin=np.percentile(im,5),vmax=np.percentile(im,95),cmap='gray') 

其中IM = hdulist [0]。數據

用於渲染WCS,我推薦你使用aplpy,如果你是避免使用真正的查看器,例如ds9。

gc = aplpy.FITSFigure("frame-r-004646-1-0019.fits") 
gc.show_grayscale(vmin=np.percentile(im,5),vmax=np.percentile(im,95)) 
+0

和不,我不知道什麼擴展名#1是對不起。 – mdurant 2014-10-11 20:10:03