Skip to content

Commit f7b78f2

Browse files
committed
fix spectra file URLs
1 parent e440f2b commit f7b78f2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

astroquery/sdss/core.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class SDSSClass(BaseQuery):
3838
'{rerun}/{run}/{camcol}/'
3939
'frame-{band}-{run:06d}-{camcol}-'
4040
'{field:04d}.fits.bz2')
41-
SPECTRA_URL_SUFFIX = ('{base}/dr{dr}/{instrument}/spectro/redux/'
41+
SPECTRA_URL_SUFFIX = ('{base}/dr{dr}/sdss/spectro/redux/'
4242
'{run2d}/spectra/{plate:04d}/'
4343
'spec-{plate:04d}-{mjd}-{fiber:04d}.fits')
4444

@@ -585,9 +585,12 @@ def get_spectra_async(self, coordinates=None, radius=2. * u.arcsec,
585585
run2d = row['run2d'].decode()
586586
else:
587587
run2d = row['run2d']
588+
if data_release > 15:
589+
linkstr.replace('/spectra/', '/spectra/full/')
590+
if data_release > 13 and row['plate'] > 9999:
591+
linkstr.replace('{plate:04d}', '{plate:5d}')
588592
link = linkstr.format(
589593
base=conf.sas_baseurl, dr=data_release,
590-
instrument=row['instrument'].lower(),
591594
run2d=run2d, plate=row['plate'],
592595
fiber=row['fiberID'], mjd=row['mjd'])
593596

0 commit comments

Comments
 (0)