I’m having a problem trying to read the IGRF magnetic model. I downloaded the file from here and put it in my orekit-data folder.
When trying to read the file I get this error though:
JavaError: <super: <class 'JavaError'>, <JavaError object>>
Java stacktrace:
java.lang.ArrayIndexOutOfBoundsException: 12
at org.orekit.models.earth.GeoMagneticField.getDecimalYear(GeoMagneticField.java:327)
at org.orekit.models.earth.GeoMagneticModelLoader.readOriginalWMMFormat(GeoMagneticModelLoader.java:239)
at org.orekit.models.earth.GeoMagneticModelLoader.readModel(GeoMagneticModelLoader.java:136)
at org.orekit.models.earth.GeoMagneticModelLoader.loadData(GeoMagneticModelLoader.java:111)
at org.orekit.data.DataProvidersManager$MonitoringWrapper.loadData(DataProvidersManager.java:354)
at org.orekit.data.DirectoryCrawler.feed(DirectoryCrawler.java:127)
at org.orekit.data.DirectoryCrawler.feed(DirectoryCrawler.java:73)
at org.orekit.data.DataProvidersManager.feed(DataProvidersManager.java:312)
at org.orekit.models.earth.LazyLoadedGeoMagneticFields.loadModels(LazyLoadedGeoMagneticFields.java:101)
at org.orekit.models.earth.LazyLoadedGeoMagneticFields.getIGRF(LazyLoadedGeoMagneticFields.java:75)
at org.orekit.models.earth.GeoMagneticFieldFactory.getIGRF(GeoMagneticFieldFactory.java:82)
I put it in the main orekit-data folder, named IGRF.COF
This is the error I get if I change its name:
JavaError: <super: <class 'JavaError'>, <JavaError object>>
Java stacktrace:
org.orekit.errors.OrekitException: unable to find resource ^IGRF\.COF$ in classpath
at org.orekit.models.earth.LazyLoadedGeoMagneticFields.loadModels(LazyLoadedGeoMagneticFields.java:117)
at org.orekit.models.earth.LazyLoadedGeoMagneticFields.getIGRF(LazyLoadedGeoMagneticFields.java:75)
at org.orekit.models.earth.GeoMagneticFieldFactory.getIGRF(GeoMagneticFieldFactory.java:82)
But isn’t that for the WMM model? Does that mean that at the moment there is no way of reading the IGRF?
If that’s the case it’s not a big deal, I can use the WMM, I just want to understand
The model can be found here International Geomagnetic Reference Field (IGRF). Look for the IGRF14.COF file under Data, Programs and Software. Copy it to you orekit folder and rename it to IGRF.COF. That did it for me
Also note that with the development version of Orekit (which will soon become the official 13.0 release), you can parse the file directly using a DataSource. You could still put it in the orekit foilder as before, but it will not be a requirement anymore (see issue 1658).
I see that there’s no link to magnetic fields data files in the page Supported Data Types of the technical documentation.
Maybe it would be worth it to add both of your links: @luc’s for WMM and @BS_space’s for IGRF.
What do you think?
Now that issue 1658 is done, I am not sure orekit-data is a good place for this. Data there is almost forgotten because it is “too easy” to get and at the end we don’t know which data we used.
But this is only my own feeling, I guess we could put it in the convenience repository we set up, otr simply suggest people to just put the file in their own folder, after all orekit-data is something users are expected to manage.