Skip to content

Commit

Permalink
Merge pull request #127 from tristandijkstra/quickfix/MPC_Horizons
Browse files Browse the repository at this point in the history
MPC + SBDB quick fix to run examples
  • Loading branch information
DominicDirkx authored Nov 7, 2023
2 parents 9f1a112 + 965ca49 commit ce4dd83
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
15 changes: 10 additions & 5 deletions tudatpy/data/mpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ class BatchMPC:
"""

def __init__(self) -> None:
"""Create an empty MPC batch.
"""
"""Create an empty MPC batch."""
self._table: pd.DataFrame = pd.DataFrame()
self._observatories: List[str] = []
self._space_telescopes: List[str] = []
Expand Down Expand Up @@ -504,7 +503,7 @@ def to_tudat(
+ "set the station_body paramater to the new name."
)
raise e

# Add positions of the observatories
self._add_observatory_positions(bodies, station_body)

Expand Down Expand Up @@ -823,7 +822,8 @@ def summary(self):
def observatories_table(
self,
only_in_batch: bool = True,
only_space_telescopes=False,
only_space_telescopes: bool = False,
exclude_space_telescopes: bool = False,
include_positions: bool = False,
) -> pd.DataFrame:
"""Returns a pandas DataFrame with information about all MPC observatories,
Expand All @@ -835,8 +835,11 @@ def observatories_table(
Filter out observatories that are not in the batch, by default True
only_space_telescopes : bool, optional
Filter out all observatories except space telescopes, by default False
only_space_telescopes : bool, optional
Filter out all space telescopes, by default False
include_positions : bool, optional
Include cartesian positions of the terrestrial telescopes, by default False
Include cartesian positions of the terrestrial telescopes only available
after running to_tudat(), by default False
Returns
-------
Expand Down Expand Up @@ -865,6 +868,8 @@ def observatories_table(
temp = temp.query("Code == @self.observatories")
if only_space_telescopes:
temp = temp.query("Code == @self._MPC_space_telescopes")
if exclude_space_telescopes:
temp = temp.query("Code != @self._MPC_space_telescopes")
if not include_positions:
temp = temp.loc[:, ["Code", "Name", "count"]]
return temp
7 changes: 6 additions & 1 deletion tudatpy/data/sbdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ def spkid(self):

@property
def codes_300_spkid(self):
"""Returns spice kernel number for the codes_300ast_20100725.bsp spice kernel"""
"""Returns spice kernel number for the codes_300ast_20100725.bsp spice kernel.
Some Objects may return a name instead of a number.
These are objects specifically specified by name in the codes_300ast_20100725.bsp kernel.
See https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/asteroids/aa_summaries.txt for a list of exceptions"""
spkid = self.spkid[0] + self.spkid[2:]
if spkid == "2000001":
return "Ceres"
Expand Down

0 comments on commit ce4dd83

Please sign in to comment.