Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from astropy.io import fits
- #This is what the file is called
- hdulist = fits.open('acisf02149N003_evt2.fits.gz')
- hdulist.info()
- tbdata = hdulist[1].data
- #This prints it out into a text file
- f=open('ChandraXraysources.txt','w+')
- #This chooses only the detx, dety, and energy columns I was talking about
- detxvect=tbdata.field('detx')
- detyvect=tbdata.field('dety')
- detzvect=tbdata.field('energy')
- #This lists at the top of the text file the names of each column
- f.write('Chandra X-ray source, RA(x),dec(y),energy rn')
- for i in range(len(detxvect)):
- f.write('%e %e %ern' %(detxvect[i],detyvect[i],detzvect[i]))
- print(detxvect[0])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement