Saturday 15 May 2010

python - Getting image from Fits files from SDSS DR10 -



python - Getting image from Fits files from SDSS DR10 -

basically want image info r-waveband fits file found here using pyfits has been incorporated astropy. here attempt:

from astropy.io import fits import matplotlib.pyplot 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()

currently, can see tiny little dots instead of the bright stars seen in jpeg image. also, imagehdu doesn't contain image (it can't since 1d array) thought why is?

finally, i'm attempting identify target galaxy in image (ra, dec). fits file has (ra, dec) associated , pixel scale of 0.396 arcsec per pixel. i'd know corner incorporated (ra, dec) talking can extrapolate position of target within image!

you'll want decent colour normalisation, this:

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

where im=hdulist[0].data

for rendering wcs, recommend utilize aplpy, if staying clear of real viewer such ds9.

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

python astronomy fits astropy

No comments:

Post a Comment