Skip to content

Commit 0dbb4e5

Browse files
committed
Remove get_raw_response optional parameters.
This functionality is already available with the *_async() methods.
1 parent 22f7e4d commit 0dbb4e5

File tree

3 files changed

+15
-66
lines changed

3 files changed

+15
-66
lines changed

astroquery/jplhorizons/core.py

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def ephemerides_async(self, airmass_lessthan=99,
176176
closest_apparition=False, no_fragments=False,
177177
quantities=conf.eph_quantities,
178178
get_query_payload=False,
179-
get_raw_response=False, cache=True,
179+
cache=True,
180180
extra_precision=False):
181181
"""
182182
Query JPL Horizons for ephemerides.
@@ -480,10 +480,6 @@ def ephemerides_async(self, airmass_lessthan=99,
480480
When set to `True` the method returns the HTTP request parameters as
481481
a dict, default: False
482482
483-
get_raw_response : boolean, optional
484-
Return raw data as obtained by JPL Horizons without parsing the data
485-
into a table, default: False
486-
487483
extra_precision : boolean, optional
488484
Enables extra precision in RA and DEC values; default: False
489485
@@ -614,10 +610,6 @@ def ephemerides_async(self, airmass_lessthan=99,
614610
if get_query_payload:
615611
return request_payload
616612

617-
# set return_raw flag, if raw response desired
618-
if get_raw_response:
619-
self.return_raw = True
620-
621613
# query and parse
622614
response = self._request('GET', self.server_url, params=request_payload,
623615
timeout=self.TIMEOUT, cache=cache)
@@ -637,7 +629,7 @@ def elements_async(self, get_query_payload=False,
637629
refplane='ecliptic',
638630
tp_type='absolute',
639631
closest_apparition=False, no_fragments=False,
640-
get_raw_response=False, cache=True):
632+
cache=True):
641633
"""
642634
Query JPL Horizons for osculating orbital elements.
643635
@@ -728,10 +720,6 @@ def elements_async(self, get_query_payload=False,
728720
When set to ``True`` the method returns the HTTP request parameters
729721
as a dict, default: False
730722
731-
get_raw_response: boolean, optional
732-
Return raw data as obtained by JPL Horizons without parsing the data
733-
into a table, default: False
734-
735723
736724
Returns
737725
-------
@@ -830,10 +818,6 @@ def elements_async(self, get_query_payload=False,
830818
if get_query_payload:
831819
return request_payload
832820

833-
# set return_raw flag, if raw response desired
834-
if get_raw_response:
835-
self.return_raw = True
836-
837821
# query and parse
838822
response = self._request('GET', self.server_url, params=request_payload,
839823
timeout=self.TIMEOUT, cache=cache)
@@ -850,7 +834,7 @@ def elements_async(self, get_query_payload=False,
850834

851835
def vectors_async(self, get_query_payload=False,
852836
closest_apparition=False, no_fragments=False,
853-
get_raw_response=False, cache=True,
837+
cache=True,
854838
refplane='ecliptic', aberrations='geometric',
855839
delta_T=False,):
856840
"""
@@ -933,10 +917,6 @@ def vectors_async(self, get_query_payload=False,
933917
When set to `True` the method returns the HTTP request parameters as
934918
a dict, default: False
935919
936-
get_raw_response: boolean, optional
937-
Return raw data as obtained by JPL Horizons without parsing the data
938-
into a table, default: False
939-
940920
refplane : string
941921
Reference plane for all output quantities: ``'ecliptic'`` (ecliptic
942922
and mean equinox of reference epoch), ``'earth'`` (Earth mean
@@ -1074,10 +1054,6 @@ def vectors_async(self, get_query_payload=False,
10741054
if get_query_payload:
10751055
return request_payload
10761056

1077-
# set return_raw flag, if raw response desired
1078-
if get_raw_response:
1079-
self.return_raw = True
1080-
10811057
# query and parse
10821058
response = self._request('GET', self.server_url, params=request_payload,
10831059
timeout=self.TIMEOUT, cache=cache)

astroquery/jplhorizons/tests/test_jplhorizons_remote.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,6 @@ def test_ephemerides_query_six(self):
174174

175175
assert len(res) == 32
176176

177-
def test_ephemerides_query_raw(self):
178-
res = (jplhorizons.Horizons(id='Ceres', location='500',
179-
id_type='smallbody', epochs=2451544.5).
180-
ephemerides(get_raw_response=True))
181-
182-
assert len(res) >= 15400
183-
184177
def test_elements_query(self):
185178
res = jplhorizons.Horizons(id='Ceres', location='500@10',
186179
id_type='smallbody',
@@ -226,14 +219,6 @@ def test_elements_query_two(self):
226219
[res['Omega'], res['w'], res['Tp_jd']],
227220
rtol=1e-3)
228221

229-
def test_elements_query_raw(self):
230-
res = jplhorizons.Horizons(id='Ceres', location='500@10',
231-
id_type='smallbody',
232-
epochs=2451544.5).elements(
233-
get_raw_response=True)
234-
235-
assert len(res) >= 6686
236-
237222
def test_vectors_query(self):
238223
# check values of Ceres for a given epoch
239224
# orbital uncertainty of Ceres is basically zero
@@ -260,14 +245,6 @@ def test_vectors_query(self):
260245
res['lighttime'], res['range'],
261246
res['range_rate']], rtol=1e-3)
262247

263-
def test_vectors_query_raw(self):
264-
res = jplhorizons.Horizons(id='Ceres', location='500@10',
265-
id_type='smallbody',
266-
epochs=2451544.5).vectors(
267-
get_raw_response=True)
268-
269-
assert len(res) >= 6412
270-
271248
def test_unknownobject(self):
272249
with pytest.raises(ValueError):
273250
jplhorizons.Horizons(id='spamspamspameggsspam', location='500',

docs/jplhorizons/jplhorizons.rst

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,7 @@ limits fragment matching (73P-B would only match 73P-B), respectively. Note
189189
that these options should only be used for comets and will crash the query for
190190
other object types. Extra precision in the queried properties can be requested
191191
using the ``extra_precision`` option. Furthermore, ``get_query_payload=True``
192-
skips the query and only returns the query payload, whereas
193-
``get_raw_response=True`` returns the raw query response instead of the astropy
194-
table.
192+
skips the query and only returns the query payload.
195193

196194
:meth:`~astroquery.jplhorizons.HorizonsClass.ephemerides` queries by default all
197195
available quantities from the JPL Horizons servers. This might take a while. If
@@ -243,9 +241,8 @@ absolute representation of the time of perihelion passage. For comets, the
243241
options ``closest_apparition`` and ``no_fragments`` are available, which select
244242
the closest apparition in time and reject fragments, respectively. Note that
245243
these options should only be used for comets and will crash the query for other
246-
object types. Also available are ``get_query_payload=True``, which skips the
247-
query and only returns the query payload, and ``get_raw_response=True``, which
248-
returns the raw query response instead of the astropy table.
244+
object types. Also available is ``get_query_payload=True``, which skips the
245+
query and only returns the query payload.
249246

250247
Vectors
251248
-------
@@ -290,16 +287,15 @@ The following fields are queried:
290287
291288
292289
Similar to the other :class:`~astroquery.jplhorizons.HorizonsClass` functions,
293-
optional parameters of :meth:`~astroquery.jplhorizons.HorizonsClass.vectors` are
294-
``get_query_payload=True``, which skips the query and only returns the query
295-
payload, and ``get_raw_response=True``, which returns the raw query response
296-
instead of the astropy table. For comets, the options ``closest_apparation`` and
297-
``no_fragments`` are available, which select the closest apparition in time and
298-
reject fragments, respectively. Note that these options should only be used for
299-
comets and will crash the query for other object types. Options ``aberrations``
300-
and ``delta_T`` provide different choices for aberration corrections as well as
301-
a measure for time-varying differences between TDB and UT time-scales,
302-
respectively.
290+
an optional parameter of :meth:`~astroquery.jplhorizons.HorizonsClass.vectors`
291+
is ``get_query_payload=True``, which skips the query and only returns the query
292+
payload for diagnostic purposes. For comets, the options ``closest_apparation``
293+
and ``no_fragments`` are available, which select the closest apparition in time
294+
and reject fragments, respectively. Note that these options should only be used
295+
for comets and will crash the query for other object types. Options
296+
``aberrations`` and ``delta_T`` provide different choices for aberration
297+
corrections as well as a measure for time-varying differences between TDB and UT
298+
time-scales, respectively.
303299

304300

305301
How to Use the Query Tables

0 commit comments

Comments
 (0)