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

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


John,

On 26/07/2019 23:39, John K. Parejko wrote:
> It looks like you're looking at BOSS/eBOSS data? If so, the datamodel
> for that data is available here:

actually I am looking across the QSOs in the SDSS database.
....

> Which of the spAll values are you having trouble with, when you say it
> "produces junk"?

I was trying to create a simple way to access (in this case) redshift
and  redshift error, but it is the intention to look at other
characteristics so this is a test case.

I had assumed (clearly wrongly) that the reductions put everything in
the same format (it seemed to work well in DR12)

Peter


>
> On 26/07/2019 15:20, Peter Dzwig 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


-- 

Dr. Peter Dzwig


More information about the AstroPy mailing list