9
9
* Property: European Space Agency (ESA)
10
10
* Developed by: Elecnor Deimos
11
11
* Author: C. Álvaro Arroyo Parejo
12
- * Issue: 1.3.1
13
- * Date: 29-06 -2021
12
+ * Issue: 1.4.0
13
+ * Date: 02-11 -2021
14
14
* Purpose: Main module which gets NEAs data from https://neo.ssa.esa.int/
15
15
* Module: core.py
16
16
* History:
32
32
implementation.\n
33
33
Define methods as static.\n
34
34
1.3.1 29-06-2021 No changes
35
+ 1.4.0 29-10-2021 Adding new docstrings.\n
36
+ Change method for obtaining physical
37
+ properties
35
38
======== =========== ============================================
36
39
37
40
@@ -66,6 +69,8 @@ def query_list(list_name):
66
69
* Priority list (faint): *priority_list_faint*
67
70
* Close encounter list: *close_encounter*
68
71
* Impacted objects: *impacted_objects*
72
+ * Catalogue of NEAs (current date): *neo_catalogue_current*
73
+ * Catalogue of NEAs (middle arc): *neo_catalogue_middle*
69
74
70
75
These lists are referenced in https://neo.ssa.esa.int/computer-access
71
76
@@ -75,7 +80,8 @@ def query_list(list_name):
75
80
Name of the requested list. Valid names are: *nea_list,
76
81
updated_nea, monthly_update, risk_list, risk_list_special,
77
82
close_approaches_upcoming, close_approaches_recent, priority_list,
78
- priority_list_faint, close_encounter and impacted_objects*.
83
+ priority_list_faint, close_encounter, impacted_objects,
84
+ neo_catalogue_current and neo_catalogue_middle*.
79
85
80
86
Returns
81
87
-------
@@ -182,7 +188,7 @@ def query_list(list_name):
182
188
183
189
return neocc_list
184
190
185
- except ConnectionError :
191
+ except ConnectionError : # pragma: no cover
186
192
print ('Initial attempt to obtain list failed. Reattempting...' )
187
193
# Wait 5 seconds
188
194
time .sleep (5 )
@@ -315,28 +321,22 @@ def query_object(name, tab, **kwargs):
315
321
>>> properties.<tab>
316
322
properties.physical_properties properties.sources
317
323
>>> properties.physical_properties
318
- Property Values Unit Source
319
- 0 Rotation Period 5.27 h [4]
320
- 1 Quality 4 - [4]
321
- 2 Amplitude 0.04-1.49 mag [4]
322
- 3 Rotation Direction PRO - [1]
323
- 4 Spinvector L 16 deg [1]
324
- 5 Spinvector B 9 deg [1]
325
- 6 Taxonomy Sq - [2]
326
- 7 Taxonomy (all) S - [3]
327
- 8 Absolute Magnitude (H) 10.31 mag [5 ]
328
- 9 Slope Parameter (G) 0.46** mag [6 ]
329
- 10 Albedo 0.24 - [9]
330
- 11 Diameter 23300 m [10]
331
- 12 Color Index Information 0.39 R-I [11 ]
332
- 13 Sightings Visual S - [13 ]
324
+ Property Value(s) Units Reference(s)
325
+ 0 Rotation Period 5.27 h [4]
326
+ 1 Quality 4.0 - [4]
327
+ 2 Amplitude 0.04-1.49 mag [4]
328
+ 3 Rotation Direction PRO - [1]
329
+ 4 Spinvector L 16.0 deg [1]
330
+ 5 Spinvector B 9.0 deg [1]
331
+ 6 Taxonomy Sq - [2]
332
+ 7 Taxonomy (all) S - [3]
333
+ 8 Absolute Magnitude (H) [ 10.853, 10.31] [ mag, mag] [[5], [6] ]
334
+ 9 Slope Parameter (G) [ 0.46**, 0.2, 0.46**] [ mag, mag, mag] [[7], [8], [5] ]
335
+ 10 Albedo 0.24 - [9]
336
+ 11 Diameter 23300.0 m [10]
337
+ 12 Color Index Information [0.85, 0.48, 0.39, 0.52] [B-V, V-R, R-I, U-B] [[11], [11], [11], [12] ]
338
+ 13 Sightings [Radar R, Visual S] [-, -] [[13], [14] ]
333
339
334
- Note
335
- ----
336
- Some physical properties (e.g. *Absolute Mangnitude (H)*, *Slope
337
- Parameter (G)*, etc) may have several values which come from different
338
- sources. Currently, the library will only show one value as it is done
339
- in the NEOCC portal.
340
340
341
341
Note
342
342
----
@@ -400,8 +400,8 @@ def query_object(name, tab, **kwargs):
400
400
>>> ast_orbit_prop = neocc.query_object(name='99942',
401
401
tab='orbit_properties',orbital_elements='keplerian', orbit_epoch='present')
402
402
>>> ast_orbit_prop.<tab>
403
- ast_orbit_prop.anode ast_orbit_prop.moid
404
- ast_orbit_prop.aphelion ast_orbit_prop.ngr
403
+ ast_orbit_prop.anode ast_orbit_prop.ngr
404
+ ast_orbit_prop.aphelion ast_orbit_prop.orb_type
405
405
ast_orbit_prop.cor ast_orbit_prop.perihelion
406
406
ast_orbit_prop.cov ast_orbit_prop.period
407
407
ast_orbit_prop.dnode ast_orbit_prop.pha
@@ -410,6 +410,7 @@ def query_object(name, tab, **kwargs):
410
410
ast_orbit_prop.kep ast_orbit_prop.rms
411
411
ast_orbit_prop.lsp ast_orbit_prop.u_par
412
412
ast_orbit_prop.mag ast_orbit_prop.vinfty
413
+ ast_orbit_prop.moid
413
414
414
415
**Ephemerides:** In order to access ephemerides information, it
415
416
is necessary to provide five additional inputs to *query_object*
@@ -442,15 +443,16 @@ def query_object(name, tab, **kwargs):
442
443
# following different methods. Create "switch" for each case:
443
444
444
445
# Impacts, close approaches and observations
445
- if tab in ('impacts' , 'close_approaches' , 'observations' ):
446
+ if tab in ('impacts' , 'close_approaches' , 'observations' ,
447
+ 'physical_properties' ):
446
448
# Get URL to obtain the data from NEOCC
447
449
url = tabs .get_object_url (name , tab )
448
450
449
451
# Request data two times if the first attempt fails
450
452
try :
451
453
# Get object data
452
454
data_obj = tabs .get_object_data (url )
453
- except ConnectionError :
455
+ except ConnectionError : # pragma: no cover
454
456
print ('Initial attempt to obtain object data failed. '
455
457
'Reattempting...' )
456
458
# Wait 5 seconds
@@ -471,13 +473,11 @@ def query_object(name, tab, **kwargs):
471
473
neocc_obj = tabs .AsteroidObservations ()
472
474
# Get object with attributes from data
473
475
neocc_obj ._ast_obs_parser (data_obj )
474
-
475
- # Physical properties
476
- elif tab == 'physical_properties' :
477
- # Create empty object with class Physical properties
478
- neocc_obj = tabs .PhysicalProperties ()
479
- # Parse the requested data using Physical properties parser
480
- neocc_obj ._phys_prop_parser (name )
476
+ elif tab == 'physical_properties' :
477
+ # Create empty object with class Physical properties
478
+ neocc_obj = tabs .PhysicalProperties ()
479
+ # Parse the requested data using Physical properties parser
480
+ neocc_obj ._phys_prop_parser (data_obj )
481
481
# Orbit properties
482
482
elif tab == 'orbit_properties' :
483
483
# Raise error if no elements are provided
@@ -499,7 +499,7 @@ def query_object(name, tab, **kwargs):
499
499
try :
500
500
# Get object data
501
501
data_obj = tabs .get_object_data (url )
502
- except ConnectionError :
502
+ except ConnectionError : # pragma: no cover
503
503
print ('Initial attempt to obtain object data failed. '
504
504
'Reattempting...' )
505
505
# Wait 5 seconds
0 commit comments