Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #226.
"Use full WMM with date and altitude" from #81.
wmm.jsnow evaluates the WMM2025 spherical harmonic model (degree 12, with secular variation) instead of interpolating the 10 deg declination/inclination/intensity tables. The coefficients are embedded from NOAA'sWMM2025.COF, which is public domain. The implementation was checked against both published test sets: the 12 points inWMM2025_TEST_VALUES.txtmatch to the 0.1 nT rounding, and the 100 points in the.COFzip'sWMM2025_TestValues.txt(lat -87 to 89, 2025.0 to 2029.5, 0 to 100 km) match to within 0.001 nT.ORGN,POSorAHRS_ORIGIN_ALT). The date comes from the first GPS week/time in the log, or is the current date if there is none. All can be edited.expected_earth_field()returns the same fields as before (vector in mGauss NED, intensity, declination, inclination), so the fit code is unchanged.Compared with the tables on three logs, the expected field differs by about 2 mGauss (0.4%) and declination by 0.1 to 0.25 deg, so fitted offsets move by 1 to 2 mGauss. This also moves MAGFit away from the firmware's
AP_Declinationtables. Logs from before 2025 use the model extrapolated backwards.Position throughout the flight (the next item on the list) will follow separately on top of this.