Skip to content

Commit 01d4e09

Browse files
committed
ENH: returning QTable for query_sia and query_ssa
1 parent e538fe4 commit 01d4e09

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

astroquery/ipac/irsa/core.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ def query_sia(self, *, pos=None, band=None, time=None, pol=None,
102102
103103
Returns
104104
-------
105-
Results in `pyvo.dal.SIAResults` format.
106-
result.to_table() in Astropy table format
105+
Results in `~astropy.table.QTable` format.
106+
107107
"""
108-
return self.sia.search(
108+
results = self.sia.search(
109109
pos=pos,
110110
band=band,
111111
time=time,
@@ -126,6 +126,8 @@ def query_sia(self, *, pos=None, band=None, time=None, pol=None,
126126
maxrec=maxrec,
127127
**kwargs)
128128

129+
return results.to_qtable()
130+
129131
query_sia.__doc__ = query_sia.__doc__.replace('_SIA2_PARAMETERS', SIA2_PARAMETERS_DESC)
130132

131133
def query_ssa(self, *, pos=None, radius=None, band=None, time=None, collection=None):
@@ -151,17 +153,17 @@ def query_ssa(self, *, pos=None, radius=None, band=None, time=None, collection=N
151153
152154
Returns
153155
-------
154-
Results in `pyvo.dal.SSAResults` format.
155-
result.to_table() in Astropy table format
156+
Results in `~astropy.table.QTable` format.
156157
"""
157158

158159
if radius is None:
159160
diameter = None
160161
else:
161162
diameter = 2 * radius
162163

163-
return self.ssa.search(pos=pos, diameter=diameter, band=band, time=time,
164-
format='all', collection=collection)
164+
results = self.ssa.search(pos=pos, diameter=diameter, band=band, time=time,
165+
format='all', collection=collection)
166+
return results.to_qtable()
165167

166168
def list_collections(self, servicetype=None):
167169
"""

astroquery/ipac/irsa/tests/test_irsa_remote.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,5 @@ def test_ssa(self):
9292
coord = SkyCoord.from_name("Eta Carina")
9393
result = Irsa.query_ssa(pos=coord)
9494
assert len(result) > 260
95-
collections = set(result.to_table()['dataid_collection'])
95+
collections = set(result['dataid_collection'])
9696
assert {'champ', 'iso_sws', 'sofia_forcast', 'sofia_great', 'spitzer_sha'}.issubset(collections)

0 commit comments

Comments
 (0)