Skip to content

Commit b07d5db

Browse files
authored
Merge pull request #2578 from bsipocz/MAINT_remote_non_functional_alfalfa
MAINT: removal of non-functional Alfalfa.get_spetrum method
2 parents 9f1a92f + 9ce71ea commit b07d5db

File tree

4 files changed

+7
-62
lines changed

4 files changed

+7
-62
lines changed

CHANGES.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ hsa
2020
Service fixes and enhancements
2121
------------------------------
2222

23+
alfalfa
24+
^^^^^^^
25+
26+
- Removal of the non-functional ``get_spectrym`` method as that service has
27+
disappeared. [#2578]
2328

2429
esa.hubble
2530
^^^^^^^^^^

astroquery/alfalfa/core.py

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import numpy.ma as ma
1212
from astropy import units as u
1313
from astropy import coordinates as coord
14-
from ..utils import commons, prepend_docstr_nosections
14+
from ..utils import commons
1515
from ..query import BaseQuery
1616

1717
__all__ = ['Alfalfa', 'AlfalfaClass']
@@ -22,7 +22,6 @@
2222

2323
class AlfalfaClass(BaseQuery):
2424

25-
FITS_PREFIX = "http://arecibo.tc.cornell.edu/hiarchive/alfalfa/spectraFITS"
2625
CATALOG_PREFIX = "http://egg.astro.cornell.edu/alfalfa/data/a40files/a40.datafile1.csv"
2726

2827
PLACEHOLDER = -999999
@@ -159,48 +158,5 @@ def query_region(self, coordinates, radius=3. * u.arcmin,
159158
else:
160159
return None
161160

162-
def get_spectrum_async(self, agc, show_progress=True):
163-
"""
164-
Download spectrum from ALFALFA catalogue.
165-
166-
Parameters
167-
----------
168-
agc : int
169-
Identification number for object in ALFALFA catalog.
170-
ascii : bool
171-
Download spectrum from remote server in ASCII or FITS format?
172-
173-
Returns
174-
-------
175-
result : A file context manager
176-
177-
See Also
178-
--------
179-
get_catalog : method that downloads ALFALFA catalog
180-
query_region : find object in catalog closest to supplied
181-
position (use this to determine AGC number first)
182-
183-
"""
184-
185-
agc = str(agc).zfill(6)
186-
187-
link = "%s/A%s.fits" % (self.FITS_PREFIX, agc)
188-
result = commons.FileContainer(link, show_progress=show_progress)
189-
return result
190-
191-
@prepend_docstr_nosections(get_spectrum_async.__doc__)
192-
def get_spectrum(self, agc, show_progress=True):
193-
"""
194-
Returns
195-
-------
196-
spectrum : `~astropy.io.fits.HDUList`
197-
Spectrum is in ``hdulist[0].data[0][2]``
198-
199-
"""
200-
201-
result = self.get_spectrum_async(agc, show_progress=show_progress)
202-
hdulist = result.get_fits()
203-
return hdulist
204-
205161

206162
Alfalfa = AlfalfaClass()

astroquery/alfalfa/tests/test_alfalfa.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,3 @@ def test_alfalfa_catalog(patch_get, patch_get_readable_fileobj, coords=coords):
7575
def test_alfalfa_crossID(patch_get, patch_get_readable_fileobj, coords=coords):
7676
agc = ALFALFA.query_region(coords, optical_counterpart=True)
7777
assert agc == 100051
78-
79-
80-
def test_alfalfa_spectrum(patch_get, patch_get_readable_fileobj,
81-
coords=coords):
82-
agc = ALFALFA.query_region(coords, optical_counterpart=True)
83-
sp = ALFALFA.get_spectrum(agc)
84-
assert len(sp) == 3

docs/alfalfa/alfalfa.rst

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,8 @@ This retrieves the AGC number of the object closest to the supplied ra and dec
2424
argument above tells the crossID function to look for matches using the
2525
positions of the optical counterparts of HI detected sources (painstakingly
2626
determined by members of the ALFALFA team), rather than their radio centroids.
27-
The AGC number is an identification number for objects in the ALFALFA survey,
28-
and once we know it, we can download spectra (if they are available) easily,
2927

30-
.. Remove the skip once #2403 is fixed
31-
.. .. doctest-remote-data::
32-
.. doctest-skip::
33-
34-
>>> sp = Alfalfa.get_spectrum(agc)
35-
36-
This returns a `~astropy.io.fits.HDUList` object. If we want to have a look at the
37-
entire ALFALFA catalog as a dictionary, we can do that too:
28+
If we want to have a look at the entire ALFALFA catalog as a dictionary, we can do that too:
3829

3930
.. doctest-remote-data::
4031

0 commit comments

Comments
 (0)