albar965 / littlenavmap

Little Navmap is a free flight planner, navigation tool, moving map, airport search and airport information system for Flight Simulator X, Microsoft Flight Simulator 2020, Prepar3D and X-Plane.
https://albar965.github.io/littlenavmap.html
GNU General Public License v3.0
1.31k stars 164 forks source link

Calculate magnetic declination #300

Closed albar965 closed 5 years ago

albar965 commented 6 years ago

Calculate magnetic declination on the fly for current year instead of using fixed files.

http://www.edwilliams.org/avform.htm#Var

https://github.com/FlightGear/simgear/tree/next/simgear/magvar

jdvalleiz commented 5 years ago

Hi there,

Why not use the WMMCOF from https://www.ngdc.noaa.gov/geomag/WMM/soft.shtml I think that X-Plane use this coefficient file (WMM.COF). it brings declination for a location (lat/lon) and a precise date (day). Therefore it's not a bunch of static values and it agrees with X-Plane values, moreover it can covers 5 years accurately (2015-2020 for WMM2015COFv2).

Many thanks for your work Alex, please keep up the great job!

albar965 commented 5 years ago

Thank you for the link! Very helpful. :-) I'll add the WMM software to the atools library once this issue is due. This seems to be the most accurate solution so far. Alex

jdvalleiz commented 5 years ago

Alex,

Glad that it can contribute to LNM jewel!

You can find libraries to use the WMM.COF here : https://www.ngdc.noaa.gov/geomag/WMM/thirdpartycontributions.shtml

I use daily the python version (Christopher Weiss contribution on the page above) and it sticks very well with values provided through X-PLANE (you can find WMM.COF in XPL installed files) : magnetic bearings without crosswinds on long legs are very precise.

BTW it's the model used in real world apps like skyvector (VFR predominance).

Cheers! Jean-Eudes

albar965 commented 5 years ago

There are plenty of other problems that come from real world data (VORs calibrated a long time ago with differing declination from surrounding) or issues when traveling along long legs where declination changes significantly between start and end. This all makes it hard to give a precise magnetic course. Maybe I should add true course as well in future versions. Alex

jdvalleiz commented 5 years ago

You are perfectly right. Long haul navigation is not as simple as it appears. Dead reckoning navigation (beyond VOR/NDB range) is always a challenge, but it's also so fun.

Regards, Jean-Eudes

gaabne commented 5 years ago

I fear the inconsistencies that this may rise with the magdec.bgl used by the sim (FSX or P3D). To limit them, I copy the one used by the simulation to LNM mapdec directory.

Does this make sense ?

Regards Gérard

albar965 commented 5 years ago

Hi Gérard, not needed. LNM uses the FSX/P3D magdec.bgl if present in the scenery library. The included one is a fallback for X-Plane. You can see that in the log file: ... Reading ".../Prepar3D v4/Scenery/BASE/Scenery/magdec.bgl" Alex