I am currently working on porting the latest Orekit to .NET (as a .dll).
To do this I am using IKVM to build the Orekit.java library into a .NET Orekit.dll.
After a bunch of trying and working through various issues, I was able to get this to work successfully and import Orekit into a .NET application as a .dll library.
I then call the code below as a test to create a new KeplerianOrbit. However, I am getting an exception with a call to TimeScalesFactory.getUTC() and the exception unfortunately is blank and contains no information. I checked the source code for the getUTC() method and can see that it indeed does throw an uncaught exception under certain conditions. I was planning on just adding a try/catch to this method to try and return more information on the error, however doing so, and then rebuilding Orekit causes it to fail the unit tests (as there is a test on this method that expects an exception to be thrown).
I just thought I would reach out to the communtiy here to see if
a) Anyone has a working build of Orekit for .NET
b) If anyone has any idea on what steps I could take to get this .getUTC() method working, does it require any other functions to be called beforehand to initialize certain variables or anything? I am new to Orekit so I might just be missing something.
P.S the other methods seem to complete normally, e.g getEME2000() returns successfully with the Frame object and the KeplerianOrbit constructor also appears to be working, so it is only this getUTC() method I am having trouble with.
static void Main(string[] args)
{
Frame inertialFrame = FramesFactory.getEME2000();
TimeScale utc = TimeScalesFactory.getUTC(); //This throws an exception
AbsoluteDate initialDate = new AbsoluteDate(2004, 01, 01, 23, 30, 00.000, utc);
const double DEG_TO_RAD = (Math.PI / 180);
double mu = 3.986004415e+14;
double a = 24396159; // semi major axis in meters
double e = 0.72831215; // eccentricity
double i = 7 * DEG_TO_RAD; // inclination
double omega = 180 * DEG_TO_RAD; // perigee argument
double raan = 261 * DEG_TO_RAD; // right ascension of ascending node
double lM = 0; // mean anomaly
Orbit initialOrbit = new KeplerianOrbit(a, e, i, omega, raan, lM, PositionAngle.MEAN, inertialFrame, initialDate, mu);
}