@@ -15,6 +15,7 @@ def test_ephemerides_query(self):
15
15
# check values of Ceres for a given epoch
16
16
# orbital uncertainty of Ceres is basically zero
17
17
res = jplhorizons .Horizons (id = 'Ceres' , location = '500' ,
18
+ id_type = 'smallbody' ,
18
19
epochs = 2451544.5 ).ephemerides ()[0 ]
19
20
20
21
assert res ['targetname' ] == "1 Ceres (A801 AA)"
@@ -152,7 +153,7 @@ def test_ephemerides_query_five(self):
152
153
153
154
def test_ephemerides_query_six (self ):
154
155
# tests optional constrains for ephemerides queries
155
- obj = jplhorizons .Horizons (id = '3552' ,
156
+ obj = jplhorizons .Horizons (id = '3552' , id_type = 'smallbody' ,
156
157
location = 'I33' ,
157
158
epochs = {'start' : '2018-05-01' ,
158
159
'stop' : '2018-08-01' ,
@@ -169,13 +170,14 @@ def test_ephemerides_query_six(self):
169
170
170
171
def test_ephemerides_query_raw (self ):
171
172
res = (jplhorizons .Horizons (id = 'Ceres' , location = '500' ,
172
- epochs = 2451544.5 ).
173
+ id_type = 'smallbody' , epochs = 2451544.5 ).
173
174
ephemerides (get_raw_response = True ))
174
175
175
176
assert len (res ) >= 15400
176
177
177
178
def test_elements_query (self ):
178
179
res = jplhorizons .Horizons (id = 'Ceres' , location = '500@10' ,
180
+ id_type = 'smallbody' ,
179
181
epochs = [2451544.5 ,
180
182
2451545.5 ]).elements ()[0 ]
181
183
@@ -204,6 +206,7 @@ def test_elements_query(self):
204
206
205
207
def test_elements_query_two (self ):
206
208
obj = jplhorizons .Horizons (id = 'Ceres' , location = '500@10' ,
209
+ id_type = 'smallbody' ,
207
210
epochs = [2451544.5 ,
208
211
2451545.5 ])
209
212
@@ -219,6 +222,7 @@ def test_elements_query_two(self):
219
222
220
223
def test_elements_query_raw (self ):
221
224
res = jplhorizons .Horizons (id = 'Ceres' , location = '500@10' ,
225
+ id_type = 'smallbody' ,
222
226
epochs = 2451544.5 ).elements (
223
227
get_raw_response = True )
224
228
@@ -228,6 +232,7 @@ def test_vectors_query(self):
228
232
# check values of Ceres for a given epoch
229
233
# orbital uncertainty of Ceres is basically zero
230
234
res = jplhorizons .Horizons (id = 'Ceres' , location = '500@10' ,
235
+ id_type = 'smallbody' ,
231
236
epochs = 2451544.5 ).vectors ()[0 ]
232
237
233
238
assert res ['targetname' ] == "1 Ceres (A801 AA)"
@@ -251,28 +256,25 @@ def test_vectors_query(self):
251
256
252
257
def test_vectors_query_raw (self ):
253
258
res = jplhorizons .Horizons (id = 'Ceres' , location = '500@10' ,
259
+ id_type = 'smallbody' ,
254
260
epochs = 2451544.5 ).vectors (
255
261
get_raw_response = True )
256
262
257
263
assert len (res ) >= 6412
258
264
259
265
def test_unknownobject (self ):
260
- try :
266
+ with pytest . raises ( ValueError ) :
261
267
jplhorizons .Horizons (id = 'spamspamspameggsspam' , location = '500' ,
262
268
epochs = 2451544.5 ).ephemerides ()
263
- except ValueError :
264
- pass
265
269
266
270
def test_multipleobjects (self ):
267
- try :
268
- jplhorizons .Horizons (id = '73P' , location = '500' ,
271
+ with pytest . raises ( ValueError ) :
272
+ jplhorizons .Horizons (id = '73P' , location = '500' , id_type = 'smallbody' ,
269
273
epochs = 2451544.5 ).ephemerides ()
270
- except ValueError :
271
- pass
272
274
273
275
def test_uri (self ):
274
276
target = jplhorizons .Horizons (id = '3552' , location = '500' ,
275
- epochs = 2451544.5 )
277
+ id_type = 'smallbody' , epochs = 2451544.5 )
276
278
assert target .uri is None
277
279
278
280
target .ephemerides ()
@@ -299,10 +301,12 @@ def test__userdefinedlocation_ephemerides_query(self):
299
301
300
302
am_res = jplhorizons .Horizons (id = 'Ceres' ,
301
303
location = '688' ,
304
+ id_type = 'smallbody' ,
302
305
epochs = 2451544.5 ).ephemerides ()[0 ]
303
306
304
307
user_res = jplhorizons .Horizons (id = 'Ceres' ,
305
308
location = anderson_mesa ,
309
+ id_type = 'smallbody' ,
306
310
epochs = 2451544.5 ).ephemerides ()[0 ]
307
311
308
312
assert_quantity_allclose ([am_res ['RA' ], am_res ['DEC' ]],
@@ -342,6 +346,7 @@ def test_airmass(self):
342
346
343
347
# verify data['a-mass'].filled(99) works:
344
348
target = jplhorizons .Horizons ('Ceres' , location = 'I41' ,
349
+ id_type = 'smallbody' ,
345
350
epochs = [2458300.5 ])
346
351
eph = target .ephemerides (quantities = '1,8' )
347
352
assert len (eph ) == 1
@@ -352,7 +357,8 @@ def test_airmass(self):
352
357
353
358
def test_vectors_aberrations (self ):
354
359
"""Check functionality of `aberrations` options"""
355
- obj = jplhorizons .Horizons (id = '1' , epochs = 2458500 , location = '500@0' )
360
+ obj = jplhorizons .Horizons (id = '1' , epochs = 2458500 , location = '500@0' ,
361
+ id_type = 'smallbody' )
356
362
357
363
vec = obj .vectors (aberrations = 'geometric' )
358
364
assert_quantity_allclose (vec ['x' ][0 ], - 2.086487005013347 )
@@ -364,7 +370,8 @@ def test_vectors_aberrations(self):
364
370
assert_quantity_allclose (vec ['x' ][0 ], - 2.086576286974797 )
365
371
366
372
def test_vectors_delta_T (self ):
367
- obj = jplhorizons .Horizons (id = '1' , epochs = 2458500 , location = '500@0' )
373
+ obj = jplhorizons .Horizons (id = '1' , epochs = 2458500 , location = '500@0' ,
374
+ id_type = 'smallbody' )
368
375
369
376
vec = obj .vectors (delta_T = False )
370
377
assert 'delta_T' not in vec .columns
@@ -373,7 +380,8 @@ def test_vectors_delta_T(self):
373
380
assert_quantity_allclose (vec ['delta_T' ][0 ], 69.184373 )
374
381
375
382
def test_ephemerides_extraprecision (self ):
376
- obj = jplhorizons .Horizons (id = '1' , epochs = 2458500 , location = 'G37' )
383
+ obj = jplhorizons .Horizons (id = '1' , epochs = 2458500 , location = 'G37' ,
384
+ id_type = 'smallbody' )
377
385
378
386
vec_simple = obj .ephemerides (extra_precision = False )
379
387
vec_highprec = obj .ephemerides (extra_precision = True )
0 commit comments