[AstroPy] Issues in DR14/DR15 headers read using astropy.io.fits

Peter Dzwig pdzwig at summaventures.com
Sat Jul 27 03:57:02 EDT 2019


Benajamin,

thanks. I will go through this. The reply from Helpdesk didn't arrive.

Thanks for your time


Peter

On 26/07/2019 23:38, Benjamin Alan Weaver wrote:
> Hello Peter,
>
> 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
>
(https://data.sdss.org/datamodel/files/BOSS_SPECTRO_REDUX/RUN2D/spAll.html).

> However, plate 0425 comes from the SDSS-I/II surveys, so the 3rd HDU
> contains data from the specObj file instead
> (https://data.sdss.org/datamodel/files/SPECTRO_REDUX/specObj.html) .
> See also the full description of spec files:
>
https://data.sdss.org/datamodel/files/BOSS_SPECTRO_REDUX/RUN2D/spectra/PLATE4/spec.html.
>
> This is a copy of a response from the SkyServer helpdesk that was sent
> on 17 July.
>
> Kia ora koe,
> Benjamin Alan Weaver
>
> On Fri, Jul 26, 2019 at 3:27 PM Peter Dzwig <pdzwig at summaventures.com
> <mailto:pdzwig at summaventures.com>> wrote:
>
>     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
>     _______________________________________________
>     AstroPy mailing list
>     AstroPy at python.org <mailto:AstroPy at python.org>
>     https://mail.python.org/mailman/listinfo/astropy
>
>
>
> --
> With great responsibility seldom comes great power.

-- 

Dr. Peter Dzwig


-- 

Dr. Peter Dzwig


More information about the AstroPy mailing list