Skip to content

Commit cfa8033

Browse files
committed
MAINT: removal of non-functional Alfalfa.get_spetrum method
1 parent 9f1a92f commit cfa8033

File tree

3 files changed

+1
-60
lines changed

3 files changed

+1
-60
lines changed

astroquery/alfalfa/core.py

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -159,48 +159,5 @@ def query_region(self, coordinates, radius=3. * u.arcmin,
159159
else:
160160
return None
161161

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-
205162

206163
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)