<div dir="ltr"><div>Hello Peter,</div><div><br></div><div>The files you are using 
come from two separate reductions of the SDSS spectroscopic data, 
separated by roughly 10 years.  Plate 7512 comes from the BOSS/eBOSS 
survey.  The 3rd HDU contains data from the BOSS/eBOSS spAll file (<a href="https://data.sdss.org/datamodel/files/BOSS_SPECTRO_REDUX/RUN2D/spAll.html" target="_blank">https://data.sdss.org/datamodel/files/BOSS_SPECTRO_REDUX/RUN2D/spAll.html</a>).  However, plate 0425 comes from the SDSS-I/II surveys, so the 3rd HDU contains data from the specObj file instead (<a href="https://data.sdss.org/datamodel/files/SPECTRO_REDUX/specObj.html" target="_blank">https://data.sdss.org/datamodel/files/SPECTRO_REDUX/specObj.html</a>) .  See also the full description of spec files: <a href="https://data.sdss.org/datamodel/files/BOSS_SPECTRO_REDUX/RUN2D/spectra/PLATE4/spec.html" target="_blank">https://data.sdss.org/datamodel/files/BOSS_SPECTRO_REDUX/RUN2D/spectra/PLATE4/spec.html</a>.</div><div><br></div><div>This is a copy of a response from the SkyServer helpdesk that was sent on 17 July.<br></div><div><br></div><div>Kia ora koe,</div><div>Benjamin Alan Weaver<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jul 26, 2019 at 3:27 PM Peter Dzwig <<a href="mailto:pdzwig@summaventures.com" target="_blank">pdzwig@summaventures.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I am looking for some general help with FITS Headers<br>
<br>
<br>
<br>
I have two (SDSS) files:<br>
<br>
(1) remote_filename =<br>
'<a href="https://dr15.sdss.org/optical/spectrum/view/data/format=fits/spec=lite?plateid=0425&mjd=51898&fiberid=0440" rel="noreferrer" target="_blank">https://dr15.sdss.org/optical/spectrum/view/data/format=fits/spec=lite?plateid=0425&mjd=51898&fiberid=0440</a>'<br>
<br>
(2)remote_filename =<br>
'<a href="https://dr15.sdss.org/optical/spectrum/view/data/format=fits/spec=lite?plateid=7512&mjd=56777&fiberid=0396" rel="noreferrer" target="_blank">https://dr15.sdss.org/optical/spectrum/view/data/format=fits/spec=lite?plateid=7512&mjd=56777&fiberid=0396</a>'<br>
<br>
I wrote some Python code using astropy which extracted the spectrum of<br>
an object from the second HDU of the appropriate .fits file. In<br>
particular I wanted to extract certain fields<br>
<br>
For example:<br>
<br>
f = fits.open(remote_filename)<br>
<br>
specdata2 = f[2].data<br>
<br>
RA = specdata2[0][59]<br>
Dec = specdata2[0][60]<br>
<br>
# Classification<br>
<br>
Class = specdata2[0][61]<br>
<br>
# Redshift and error<br>
<br>
redshift = specdata2[0][63]<br>
redshift_error = specdata2[0][64]<br>
<br>
used to work fine. In the case of (1) above, it does. In the case of (2)<br>
it just produces junk. I used the formulation for a large number of<br>
files from DR12<br>
<br>
FWIW I am running Python 3.7 over Ubuntu 18.04. I think that is probably<br>
irrelevant as a colleague who is running in another configuration has<br>
the same sort of problem<br>
<br>
Any ideas why?<br>
<br>
It seems that there might be the following reasons:<br>
<br>
(i) there is a change in the formats (somewhere) in DR15<br>
<br>
(ii) something has changed in the way io.fits treats some HDUs that I<br>
have missed.<br>
<br>
Is there perhaps a cleaner way of getting this info?<br>
<br>
I have posted this to the Skyserver Helpdesk without any response. Am<br>
happy to take this offline if people want.<br>
<br>
Thanks for any help,<br>
<br>
Peter<br>
<br>
<br>
<br>
-- <br>
<br>
Dr. Peter Dzwig<br>
_______________________________________________<br>
AstroPy mailing list<br>
<a href="mailto:AstroPy@python.org" target="_blank">AstroPy@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/astropy" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/astropy</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail-m_6243463322475826137gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">With great responsibility seldom comes great power.</div></div></div></div></div></div></div>