diff --git a/python_files/pyhelpers.py b/python_files/pyhelpers.py index 32f6f74b4dd9a86900a919b7d2658041a79c9ce2..fe1b431985e8ba7ced94a5f7a03dcefa0796b1e5 100644 --- a/python_files/pyhelpers.py +++ b/python_files/pyhelpers.py @@ -31,7 +31,6 @@ from org.orekit.data import DataProvidersManager, ZipJarCrawler, DirectoryCrawle from org.orekit.time import TimeScalesFactory, AbsoluteDate from org.orekit.utils import ElevationMask - try: import urllib.request as urlrequest except ImportError: @@ -76,24 +75,24 @@ def setup_orekit_curdir(filename='orekit-data.zip'): """ - DM = DataProvidersManager.getInstance() + DM = DataContext.getDefault().getDataProvidersManager() datafile = File(filename) if not datafile.exists(): print('File or folder:', datafile.absolutePath, ' not found') print(""" - + The Orekit library relies on some external data for physical models. 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. 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. - + You can download a starting file with this data from the orekit gitlab at: https://gitlab.orekit.org/orekit/orekit-data - + or by the function: orekit.pyhelpers.download_orekit_data_curdir() - + """) if os.path.isdir(filename): @@ -103,6 +102,8 @@ def setup_orekit_curdir(filename='orekit-data.zip'): else: print('filename ', filename, ' is neither a file nor a folder') DM.clearProviders() + DM.clearLoadedDataNames() + DM.clearFilters() DM.addProvider(crawler)