Closed barissaydag closed 6 years ago
Hi,
Thanks for the report.
I'll try to look it quickly (this WE if I can).
I'll try to reproduce your issue on .Net and on in original DLL Swiss Ephemeris to see if this error is raised on the original code too.
You are awesome, thanks a lot! I look forward to your findings. Good luck :)
BTW, I am not sure if this is related, but there seems to be other problems when using JPL ephemerides. For example:
swe.swe_sol_eclipse_when_glob(jd, SwissEph.SEFLG_JPLEPH, SwissEph.SE_ECL_TOTAL, tret, false, ref serr);
fails with
"jd 2689359.814575 outside JPL eph. range 2287184.50 .. 2688976.50; \nusing Moshier Eph; "
but
swe.swe_sol_eclipse_when_glob(jd, SwissEph.SEFLG_SWIEPH, SwissEph.SE_ECL_TOTAL, tret, false, ref serr);
works beautifully. My input JD is 2457754.5 (i.e. 1.1.2017)
OK I confirm it's a bug of the SwissEph.Net only.
Apparently the opened file is closed BEFORE used by the calculation. I didn't find where, but now I have some ways to find the bug.
I'll continue my search soon.
OK the version 2.6.0.22 fix the bug.
One thing: in your code, set the OnLoadFile
event BEFORE using the swe_set_ephe_path()
and swe.swe_set_jpl_file()
methods because there load file, so in your sample your must be
using (var swe = new SwissEph())
{
swe.OnLoadFile += swe_OnLoadFile;
swe.swe_set_ephe_path(@"X:\Projects\Swiss\jplfiles");
swe.swe_set_jpl_file("de430.eph");
...
}
regards,
Again, you are awesome. I can confirm that this issue is fixed.
Regarding the OnLoadFile. Yes, of course, it should be before setting path etc. What was I thinking! :)
Hi,
I recently started using SwissEph. I love that it is so powerful. But using JPL ephemeris, I am getting a null deref exception:
I solved the problem by commenting out
js = null
in swi_close_jpl_file(); Obviously this is hacky, and I am curious about what the root cause is. What is the real fix here?Here is my test app: