Skip to content
Snippets Groups Projects
Commit 0dc4af80 authored by Petrus Hyvönen's avatar Petrus Hyvönen
Browse files

Changed from getInstance to getDefault for DataContext.

parent b50d687d
No related branches found
No related tags found
No related merge requests found
...@@ -31,7 +31,6 @@ from org.orekit.data import DataProvidersManager, ZipJarCrawler, DirectoryCrawle ...@@ -31,7 +31,6 @@ from org.orekit.data import DataProvidersManager, ZipJarCrawler, DirectoryCrawle
from org.orekit.time import TimeScalesFactory, AbsoluteDate from org.orekit.time import TimeScalesFactory, AbsoluteDate
from org.orekit.utils import ElevationMask from org.orekit.utils import ElevationMask
try: try:
import urllib.request as urlrequest import urllib.request as urlrequest
except ImportError: except ImportError:
...@@ -76,24 +75,24 @@ def setup_orekit_curdir(filename='orekit-data.zip'): ...@@ -76,24 +75,24 @@ def setup_orekit_curdir(filename='orekit-data.zip'):
""" """
DM = DataProvidersManager.getInstance() DM = DataContext.getDefault().getDataProvidersManager()
datafile = File(filename) datafile = File(filename)
if not datafile.exists(): if not datafile.exists():
print('File or folder:', datafile.absolutePath, ' not found') print('File or folder:', datafile.absolutePath, ' not found')
print(""" print("""
The Orekit library relies on some external data for physical models. The Orekit library relies on some external data for physical models.
Typical data are the Earth Orientation Parameters and the leap seconds history, Typical data are the Earth Orientation Parameters and the leap seconds history,
both being provided by the IERS or the planetary ephemerides provided by JPL. both being provided by the IERS or the planetary ephemerides provided by JPL.
Such data is stored in text or binary files with specific formats that Orekit knows Such data is stored in text or binary files with specific formats that Orekit knows
how to read, and needs to be provided for the library to work. how to read, and needs to be provided for the library to work.
You can download a starting file with this data from the orekit gitlab at: You can download a starting file with this data from the orekit gitlab at:
https://gitlab.orekit.org/orekit/orekit-data https://gitlab.orekit.org/orekit/orekit-data
or by the function: or by the function:
orekit.pyhelpers.download_orekit_data_curdir() orekit.pyhelpers.download_orekit_data_curdir()
""") """)
if os.path.isdir(filename): if os.path.isdir(filename):
...@@ -103,6 +102,8 @@ def setup_orekit_curdir(filename='orekit-data.zip'): ...@@ -103,6 +102,8 @@ def setup_orekit_curdir(filename='orekit-data.zip'):
else: else:
print('filename ', filename, ' is neither a file nor a folder') print('filename ', filename, ' is neither a file nor a folder')
DM.clearProviders() DM.clearProviders()
DM.clearLoadedDataNames()
DM.clearFilters()
DM.addProvider(crawler) DM.addProvider(crawler)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment