Skip to content

Commit

Permalink
added suggestion when is de430.bsp missing
Browse files Browse the repository at this point in the history
If the BSK script can't find de430.bsp, they BSK was likely installed via a wheel and the user didn't run bskLargeData to download the large BSK data files.  Now the user is given a suggestion to run this command.
  • Loading branch information
schaubh committed Nov 28, 2024
1 parent 275f430 commit f8041a7
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/utilities/simIncludeGravBody.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@

from Basilisk.utilities.deprecated import deprecationWarn

# this statement is needed to enable Windows to print ANSI codes in the Terminal
# see https://stackoverflow.com/questions/287871/how-to-print-colored-text-in-terminal-in-python/3332860#3332860
import os
os.system("")

@dataclass
class BodyData:
"""A class that contains information about a body in the simulation.
Expand Down Expand Up @@ -467,9 +472,15 @@ def createSpiceInterface(
if len(self.spicePlanetFrames) > 0:
self.spiceObject.planetFrames = list(self.spicePlanetFrames)

for fileName in set(self.spiceKernelFileNames):
self.spiceObject.loadSpiceKernel(fileName, path)
self.spiceObject.SPICELoaded = True
for fileName in set(self.spiceKernelFileNames):
if self.spiceObject.loadSpiceKernel(fileName, path):
# error occured loading spice kernel
self.spiceObject.SPICELoaded = False
if fileName == "de430.bsp":
print("\033[91mERROR loading the large file de430.bsp:\033[0m If BSK was "
"installed via a wheel, try running bskLargeData from the console to "
"install the large BSK data files.\n")

# subscribe Grav Body data to the spice state message
for c, gravBodyDataItem in enumerate(self.gravBodies.values()):
Expand Down

0 comments on commit f8041a7

Please sign in to comment.