Combine Old and New WMM Files

Please forgive that I don’t have any clue what I’m asking.

I have inherited an application that uses Orekit. Today I was given a new WMM.COF file. Orekit will read it fine. The tragedy is that my application has a scenario using an older date. When used with the new file, Orekit says:

Exception: Failed to load WMM model, try the IGRF : Exception=non-existent geomagnetic model WMM for year 2,010.666

when i look at those text files, they look completely different and i cannot figure out how to combine them.

Does anyone know how to combine the two files? Or any other clever solution?



If you have a scenario in 2010, you must have a geomagnetic field that covers this date. I have looked at IGRF12 which seems to cover from 1900 to 2015, but the raw format of this file is not supported yet by Orekit (see below).

Orekit claims to supports both IGRF and WMM file formats (see comments in GeoMagneticModelLoader), but
not the original files, rather the combined format output by geomag software. This software is full public domain (see You may try to use it to generate files understood by Orekit from original files.

Another possibility would be to have Orekit parse directly the original formats. The global architecture allows to add different parsers, but the parsing itself (which is quite simple for columns data) should be done. If you
want to give it a try, you need to create a new IGRFLoader class that implements DataLoader (which mainly means it has a loadData(InputStream input, String name) method) and call it from GeomagneticFieldFactory. If you want to try it, we would welcome the contribution.