Skip to content

Commit

Permalink
Move dastcom to sbpy.data.utils
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyasbapat committed Apr 9, 2019
1 parent bacf83e commit 1dcc8d2
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions sbpy/data/orbit.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from .. import bib
from . import conf, DataClass
from .. import utils
from . import utils

__all__ = ['Orbit']

Expand Down Expand Up @@ -135,14 +135,14 @@ def from_horizons(cls, targetids, id_type='smallbody',
return cls.from_table(all_elem)

@classmethod
def from_dastcom5(cls, name):
def from_dastcom5(cls, identifier, is_record_number=False):
"""Load orbital elements from the DASTCOM5 Database
(ftp://ssd.jpl.nasa.gov/pub/ssd/dastcom5.zip).
Parameters
----------
name: str, mandatory
Name of NEO
identifier: mandatory
Names, numbers, or designations of objects to be queried
Returns
-------
Expand All @@ -158,7 +158,10 @@ def from_dastcom5(cls, name):
if not os.path.isdir(dastcom5_dir):
utils.dastcom5.download_dastcom5()

tb = utils.dastcom5.orbit_from_name(name=name)
if is_record_number:
tb = utils.dastcom5.orbit_from_record(record=identifier)
else:
tb = utils.dastcom5.orbit_from_name(name=identifier)
return cls.from_table(tb)

@classmethod
Expand Down

0 comments on commit 1dcc8d2

Please sign in to comment.