Skip to content

Commit 3a38a16

Browse files
committed
Move dastcom to sbpy.data.utils
1 parent 1c259cf commit 3a38a16

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

sbpy/data/orbit.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
from .. import bib
2121
from . import conf, DataClass
22-
from .. import utils
22+
from . import utils
2323

2424
__all__ = ['Orbit', 'OrbitError', 'OpenOrbError']
2525

@@ -181,14 +181,14 @@ def from_horizons(cls, targetids, id_type='smallbody',
181181
return cls.from_table(all_elem)
182182

183183
@classmethod
184-
def from_dastcom5(cls, name):
184+
def from_dastcom5(cls, identifier, is_record_number=False):
185185
"""Load orbital elements from the DASTCOM5 Database
186186
(ftp://ssd.jpl.nasa.gov/pub/ssd/dastcom5.zip).
187187
188188
Parameters
189189
----------
190-
name: str, mandatory
191-
Name of NEO
190+
identifier: mandatory
191+
Names, numbers, or designations of objects to be queried
192192
193193
Returns
194194
-------
@@ -204,7 +204,10 @@ def from_dastcom5(cls, name):
204204
if not os.path.isdir(dastcom5_dir):
205205
utils.dastcom5.download_dastcom5()
206206

207-
tb = utils.dastcom5.orbit_from_name(name=name)
207+
if is_record_number:
208+
tb = utils.dastcom5.orbit_from_record(record=identifier)
209+
else:
210+
tb = utils.dastcom5.orbit_from_name(name=identifier)
208211
return cls.from_table(tb)
209212

210213
@classmethod

0 commit comments

Comments
 (0)