Skip to content

Fix (#127): ionmapf() layer geometry mixing metres and km - #204

Open
jqnfxa wants to merge 3 commits into
GeoscienceAustralia:mainfrom
jqnfxa:fix/ionmapf-layer-height-units
Open

jqnfxa wants to merge 3 commits into
GeoscienceAustralia:mainfrom
jqnfxa:fix/ionmapf-layer-height-units

Conversation

@jqnfxa

@jqnfxa jqnfxa commented Oct 23, 2026

Copy link
Copy Markdown

Fixes #127

ionmapf() computed RE_MEAN / (RE_MEAN + hion) with RE_MEAN in metres and hion in km,
so the SLM/MSLM/MLM factor ignored the layer height. With the default MSLM at 10 deg
it gave 4.904 instead of 2.374. The radius is now taken in km, as at every ionppp() call site.

Affects the IONEX/TEC correction and the VTEC recovered in ppp_obs.cpp. Klobuchar is unchanged.

Commits: move ionmapf/ionppp to common/ionMapping.cpp (no functional change), unit tests
(fail on main), the fix.

Both are pure thin-shell geometry whose only dependencies are header-level
(constants, SQR, VectorPos, AzEl). In their own translation unit they can be
unit tested without linking the rest of pea; ionModels.cpp alone pulls in
about 130 of pea's objects. No behaviour change.
ionmapf() with the single layer model must equal the slant factor ionppp()
returns for the same layer, since both describe the same thin-shell geometry;
ionppp() is called with the Earth radius and the layer height in km, as every
caller in pea does. The modified single layer model is checked against its
closed form (Schaer 1999: alpha 0.9782, H 506.7 km, R 6371 km), and the factor
must fall as the layer rises and be 1 at zenith.

On main these fail: at 10 deg elevation SLM gives 5.744 where ionppp() gives
2.441, MSLM gives 4.904 where the closed form gives 2.374, and moving the layer
from 350 km to 506.7 km changes the factor by 0.0045.
Fixes GeoscienceAustralia#127. RE_MEAN is in metres while hion, mapping_function_layer_height,
is in km (506.7 by default), so RE_MEAN / (RE_MEAN + hion) was 0.99992
instead of 0.926 and the factor collapsed to 1 / cos(z'), ignoring the layer
height. With the default MSLM the slant factor was 2.07 times too large at
10 deg elevation (4.904 instead of 2.374) and 3.27 times at 5 deg. The radius
is now taken in km, as at every ionppp() call site.

This affects the SLM, MSLM and MLM mapping functions wherever ionmapf() is
used: the IONEX (TEC grid) correction, and the VTEC that ppp_obs.cpp restores
from the slant delay for the higher-order ionosphere terms. The Klobuchar
mapping returns before this line and is unchanged.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ionmapf units issue

1 participant