astropy / astroquery

Functions and classes to access online data resources. Maintainers: @keflavich and @bsipocz and @ceb8
http://astroquery.readthedocs.org/en/latest/
BSD 3-Clause "New" or "Revised" License
705 stars 397 forks source link

SDSS DR18 implementation #3011

Closed afaisst closed 4 months ago

afaisst commented 5 months ago

Hello, I'm trying to use the astroquery.sdss() to download SDSS spectra. It works for DR17 but I'm wondering if it also works for DR18 (the new SDSS-V). According to this webpage, it should be public.

I tried to change the data_release parameter but it returns a 404 error if it is changed to data_release=18. Here is an example:

import numpy as np
import astropy.units as u
from astropy.coordinates import SkyCoord
from astropy.table import Table
from astroquery.sdss import SDSS

coord = SkyCoord("{} {}".format("09 54 49.40" , "+09 16 15.9"), unit=(u.hourangle, u.deg) )
xid = SDSS.query_region(coord, radius=5 * u.arcsec, spectro=True, data_release=18)

sp = SDSS.get_spectra(matches=xid, show_progress=True , data_release=18)

Running this gives me a 404 error: HTTPError: HTTP Error 404: Not Found

Running the above code with data-release=17 (in both places, the query_region() and get_spectra()) works and returns a spectrum.

bsipocz commented 5 months ago

cc @weaverba137

weaverba137 commented 5 months ago

I'm going to have to respectfully bow out of this one. The layout of SDSS-V data releases is sufficiently different that someone who actually works for SDSS-V should take this on. I will try to identify that person though.

bsipocz commented 5 months ago

Thank you @weaverba137, it's already useful to know about this different layout and thanks for pinging the appropriate person.

weaverba137 commented 5 months ago

My initial contacts with SDSS-V management recommend using sdss-access for any release > DR17. Some of the access URLs could potentially be patched for a DR18 URL, but further changes are expected for DR19.

@afaisst, could you please be more specific about where you experienced the 404 error? It's not obvious. For example, did SDSS.query_region() give valid results?

If query_region() still works, then it will be much less work to add support for DR18. But again, we can't be sure what will happen with DR19.

Finally, note that astroquery.sdss has only ever supported SDSS imaging data, which last changed in DR13, and SDSS/BOSS/eBOSS spectroscopy which may have changed in DR18, but hasn't changed substantially for a number of data releases, so DR17 should be "good enough" for queries on these data sets.

afaisst commented 5 months ago

yes, query_region() works when I set data_release to 18. It looks like it gets me the same output as for data_release=17.

But the 404 error appears when I run the second command SDSS.get_spectra().

bsipocz commented 5 months ago

I suppose the solution is to use sdss-access under the hood of get_spectra to get the correct URL. Adding an extra optional requirement is not great, but it should work.

weaverba137 commented 5 months ago

More generally for questions about SDSS-V, my contacts recommend sending email to helpdesk@sdss.org. I'll take a look at adding a quick fix for DR18 later this week.