Issue with Kalman Filter Tutorial

I am trying to run Bryan Cazabonne’s Kalman Filter Numerical OD Tutorial ( KalmanNumericalOrbitDetermination.java). The error happens in the main where the following is running:

new KalmanNumOD().runKalman(input);

The error is:
Exception in thread “main” java.lang.IllegalArgumentException: MALFORMED
at java.util.zip.ZipCoder.toString(ZipCoder.java:58)
at java.util.zip.ZipInputStream.readLOC(ZipInputStream.java:300)
at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:122)
at org.orekit.data.ZipJarCrawler$Archive.goToNext(ZipJarCrawler.java:272)
at org.orekit.data.ZipJarCrawler$Archive.(ZipJarCrawler.java:265)
at org.orekit.data.ZipJarCrawler.feed(ZipJarCrawler.java:150)
at org.orekit.data.DirectoryCrawler.feed(DirectoryCrawler.java:124)
at org.orekit.data.DirectoryCrawler.feed(DirectoryCrawler.java:118)
at org.orekit.data.DirectoryCrawler.feed(DirectoryCrawler.java:118)
at org.orekit.data.DirectoryCrawler.feed(DirectoryCrawler.java:118)
at org.orekit.data.DirectoryCrawler.feed(DirectoryCrawler.java:118)
at org.orekit.data.DirectoryCrawler.feed(DirectoryCrawler.java:118)
at org.orekit.data.DirectoryCrawler.feed(DirectoryCrawler.java:118)
at org.orekit.data.DirectoryCrawler.feed(DirectoryCrawler.java:118)
at org.orekit.data.DirectoryCrawler.feed(DirectoryCrawler.java:81)
at org.orekit.data.DataProvidersManager.feed(DataProvidersManager.java:362)
at org.orekit.data.AbstractSelfFeedingLoader.feed(AbstractSelfFeedingLoader.java:55)
at org.orekit.frames.RapidDataAndPredictionXMLLoader.fillHistory(RapidDataAndPredictionXMLLoader.java:93)
at org.orekit.frames.LazyLoadedEop.getEOPHistory(LazyLoadedEop.java:311)
at org.orekit.frames.LazyLoadedFrames.getEOPHistory(LazyLoadedFrames.java:182)
at org.orekit.frames.AbstractFrames.getCIRF(AbstractFrames.java:400)
at org.orekit.frames.AbstractFrames.getTIRF(AbstractFrames.java:353)
at org.orekit.frames.AbstractFrames.getITRF(AbstractFrames.java:278)
at org.orekit.frames.AbstractFrames.getFrame(AbstractFrames.java:87)
at org.orekit.frames.FramesFactory.getFrame(FramesFactory.java:344)
at org.orekit.tutorials.yaml.TutorialBody.getEarthFrame(TutorialBody.java:127)
at org.orekit.tutorials.estimation.common.AbstractOrbitDetermination.createBody(AbstractOrbitDetermination.java:1127)
at org.orekit.tutorials.estimation.common.AbstractOrbitDetermination.runKalman(AbstractOrbitDetermination.java:611)
at kalmannumod.KalmanNumOD.main(KalmanNumOD.java:82)
C:\Users\owner\AppData\Local\NetBeans\Cache\11.3\executor-snippets\run.xml:111: The following error occurred while executing this line:
C:\Users\owner\AppData\Local\NetBeans\Cache\11.3\executor-snippets\run.xml:94: Java returned: 1
BUILD FAILED (total time: 1 minute 41 seconds)

Since I am still a learner with Orekit this may be an “operator error” but would appreciate some assistance in getting this working. Thanks.

Hi @StephenC

Did you modified something in the tutorial?

Bryan

I was having trouble loading the input *.yaml so I made the following change:

public static void main(final String[] args) {
    try {
        // input in tutorial resources directory
        final String inputPath = KalmanNumOD.class.getClassLoader().
                                 getResource("kalman-orbit-determination.yaml").toURI().getPath();
        String inputPath1 = "C:\\Users\\kenneth.crumpton\\kalman-orbit-determination.yaml";
        System.out.println("inputPath: " + inputPath);
        input = new File(inputPath1);
        new KalmanNumOD().runKalman(input);

    } catch (URISyntaxException | IOException | OrekitException e) {
        System.err.println(e.getLocalizedMessage());
        System.exit(1);
    }
}

Would this be to missing one of the needed jar files?

The name was also change from “KalmanNumericalOrbitDetermination” to “KalmanNumOD.”

Here are the jar files I am using:
Jar_Files
I am running in Netbeans 11.3

It could be interesting to verify if your orekit-data are loaded properly.

The code doesn’t load the orekit-data. I will add that and try it.

I used the default code:
// configure Orekit data provider
final File home = new File(System.getProperty(“user.home”));
final File orekitData = new File(home, “orekit-data”);
if (!orekitData.exists()) {
System.err.format(Locale.US, “Failed to find %s folder%n”,
orekitData.getAbsolutePath());
System.err.format(Locale.US, “You need to download %s from the %s page and unzip it in %s for this tutorial to work%n”,
“orekit-data.zip”, “https://www.orekit.org/forge/projects/orekit/files”,
home.getAbsolutePath());
System.exit(1);
}
final DataProvidersManager manager = DataContext.getDefault().getDataProvidersManager();
manager.addProvider(new DirectoryCrawler(orekitData));

to load the data but got the same error messages.

Please note that the orekit-data are initialized at the beginning of the method runKalman by the method initializeOrekitData. Therefore, there is no need to load again the data.
Can you verify if you are loading again the data ?

Since the runKalman line is where the program fails, where would I insert some code to test for some of the loaded orekit-data?

When I was running it in the debugger I got the following:
Listening on javadebug
User program running
LineBreakpoint KalmanNumOD.java : 86 successfully submitted.
Breakpoint hit at line 86 in class kalmannumod.KalmanNumOD by thread main.
Thread main stopped at KalmanNumOD.java:86.
User program running
Debugger stopped on uncompilable source code.
User program finished
(Note line 86 is: new KalmanNumOD().runKalman(input):wink:

Sorry, the emoji was a slip on the keyboard

This may not be a full test but when I renamed my data directory (to orekit-data1) I got:

Failed to find C:\Users\kenneth.crumpton\orekit-data folder
You need to download orekit-data-master.zip from https://gitlab.orekit.org/orekit/orekit-data/-/archive/master/orekit-data-master.zip, unzip it in C:\Users\kenneth.crumpton and rename it ‘orekit-data’ for this tutorial to work
Failed to load Orekit data

Ok, I think I have no other idea about your problem without you computer in front of me. However, I don’t think the problem is related to this tutorial but it is probably related to your setting. If you try another tutorial (maybe GNSSOrbitDetermination) I think the problem will also be present.
I’m just a bit surprised about the exception in ZipJarCrawler. Did you zip a folder that has not to be ziped (e.g. orekit-data)?

Bryan

Thank you for looking at it. I did try another tutorial and had the same result. I will keep trying to track down what is going on and maybe another Orekit user has run into this and keep provide some assistance.

Dear @StephenC,

As Bryan pointed out, if you have the “official” orekit-data folder downloaded in your home folder, there should not be any zip file in it.
The exception in your first post refers to the ZipJarCrawler class that is used in Orekit to navigate in zip or jar compressed archive.
I suggest you inspect your orekit-data folder and checks if there is not a corrupted compressed archive in it.

Hope this helps,
Maxime

I did not see any issues there. What is puzzling is that I can run the “PropagationNonInertialFrame.java” and “PropagationInRotatingFrame.java” tutorials without any problems. Unfortunately the Netbeans debugger was unable to take me to where the orekit-data is loaded.

Very odd. I changed the location where I the program is reading the “kalman-orbit-determination.yaml” file and it ran. I definitely have a lot to learn about Java. I will close this out.

Good to know you manage to resolve your issue!