1111from ... import sdss
1212from ...exceptions import TimeoutError
1313
14+ # DR11 is a quasi-internal data release that does not have SkyServer support.
15+ dr_list = (8 , 9 , 10 , 12 , 13 , 14 , 15 , 16 )
16+
1417
1518@pytest .mark .remote_data
1619class TestSDSSRemote :
@@ -34,10 +37,19 @@ def test_images_timeout(self):
3437 "error with 'No route to host'. We don't know a "
3538 "workaround for this yet." )
3639
37- def test_sdss_spectrum (self ):
38- xid = sdss .SDSS .query_region (self .coords , spectro = True )
40+ @pytest .mark .parametrize ("dr" , dr_list )
41+ def test_sdss_spectrum (self , dr ):
42+ xid = sdss .SDSS .query_region (self .coords , spectro = True , data_release = dr )
3943 assert isinstance (xid , Table )
40- sp = sdss .SDSS .get_spectra (matches = xid )
44+ sp = sdss .SDSS .get_spectra (matches = xid , data_release = dr )
45+
46+ def test_sdss_spectrum_plate_mjd_fiber (self ):
47+ """These plates are only available in recent data releases.
48+ """
49+ sp = sdss .SDSS .get_spectra (plate = 9403 , mjd = 58018 , fiberID = 485 ,
50+ data_release = 16 )
51+ sp = sdss .SDSS .get_spectra (plate = 10909 , mjd = 58280 , fiberID = 485 ,
52+ data_release = 16 )
4153
4254 def test_sdss_spectrum_mjd (self ):
4355 sp = sdss .SDSS .get_spectra (plate = 2345 , fiberID = 572 )
@@ -75,25 +87,22 @@ def test_sdss_image_coord(self):
7587
7688 def test_sdss_specobj (self ):
7789 colnames = ['ra' , 'dec' , 'objid' , 'run' , 'rerun' , 'camcol' , 'field' ,
78- 'z' , 'plate' , 'mjd' , 'fiberID' , 'specobjid' , 'run2d' ,
79- 'instrument' ]
90+ 'z' , 'plate' , 'mjd' , 'fiberID' , 'specobjid' , 'run2d' ]
8091 dtypes = [float , float , np .int64 , int , int , int , int , float , int , int ,
81- int , np .int64 , int , bytes ]
92+ int , np .int64 , int ]
8293 data = [
8394 [46.8390680395307 , 5.16972676625711 , 1237670015125750016 , 5714 ,
8495 301 , 2 , 185 , - 0.0006390358 , 2340 , 53733 , 291 , 2634685834112034816 ,
85- 26 , 'SDSS' ],
96+ 26 ],
8697 [46.8705377929765 , 5.42458826592292 , 1237670015662621224 , 5714 ,
87- 301 , 3 , 185 , 0 , 2340 , 53733 , 3 , 2634606669274834944 , 26 , 'SDSS' ],
98+ 301 , 3 , 185 , 0 , 2340 , 53733 , 3 , 2634606669274834944 , 26 ],
8899 [46.8899751105478 , 5.09432755808192 , 1237670015125815346 , 5714 ,
89100 301 , 2 , 186 , - 4.898809E-05 , 2340 , 53733 , 287 , 2634684734600407040 ,
90- 26 , 'SDSS' ],
101+ 26 ],
91102 [46.8954031261838 , 5.9739184644185 , 1237670016199491831 , 5714 ,
92- 301 , 4 , 185 , 0 , 2340 , 53733 , 329 , 2634696279472498688 , 26 ,
93- 'SDSS' ],
103+ 301 , 4 , 185 , 0 , 2340 , 53733 , 329 , 2634696279472498688 , 26 ],
94104 [46.9155836662379 , 5.50671723824944 , 1237670015662686398 , 5714 ,
95- 301 , 3 , 186 , 0 , 2340 , 53733 , 420 , 2634721293362030592 , 26 ,
96- 'SDSS' ]]
105+ 301 , 3 , 186 , 0 , 2340 , 53733 , 420 , 2634721293362030592 , 26 ]]
97106 table = Table (data = [x for x in zip (* data )],
98107 names = colnames , dtype = dtypes )
99108 xid = sdss .SDSS .query_specobj (plate = 2340 )
0 commit comments