[AstroPy] Issues in DR14/DR15 headers read using astropy.io.fits
Peter Dzwig
pdzwig at summaventures.com
Fri Jul 26 18:20:14 EDT 2019
I am looking for some general help with FITS Headers
I have two (SDSS) files:
(1) remote_filename =
'https://dr15.sdss.org/optical/spectrum/view/data/format=fits/spec=lite?plateid=0425&mjd=51898&fiberid=0440'
(2)remote_filename =
'https://dr15.sdss.org/optical/spectrum/view/data/format=fits/spec=lite?plateid=7512&mjd=56777&fiberid=0396'
I wrote some Python code using astropy which extracted the spectrum of
an object from the second HDU of the appropriate .fits file. In
particular I wanted to extract certain fields
For example:
f = fits.open(remote_filename)
specdata2 = f[2].data
RA = specdata2[0][59]
Dec = specdata2[0][60]
# Classification
Class = specdata2[0][61]
# Redshift and error
redshift = specdata2[0][63]
redshift_error = specdata2[0][64]
used to work fine. In the case of (1) above, it does. In the case of (2)
it just produces junk. I used the formulation for a large number of
files from DR12
FWIW I am running Python 3.7 over Ubuntu 18.04. I think that is probably
irrelevant as a colleague who is running in another configuration has
the same sort of problem
Any ideas why?
It seems that there might be the following reasons:
(i) there is a change in the formats (somewhere) in DR15
(ii) something has changed in the way io.fits treats some HDUs that I
have missed.
Is there perhaps a cleaner way of getting this info?
I have posted this to the Skyserver Helpdesk without any response. Am
happy to take this offline if people want.
Thanks for any help,
Peter
--
Dr. Peter Dzwig
More information about the AstroPy
mailing list