XikunLiu-huskit / GLIO

GLIO: Tightly-Coupled GNSS/LiDAR/IMU Integration for Continuous and Drift-free State Estimation
229 stars 31 forks source link

Error in Niell tropo function calculation ? #9

Closed jonathanmuller closed 2 months ago

jonathanmuller commented 3 months ago

Hi,

There is a common pattern I see in all implementations of the Niell tropo across github :

The implementation is always the same :

(1+a / ... ) / (sinel +b / ...) while I believe it should be (sinel +b / ...) / (1+a / ... ) (the opposite)

For example in the code : https://github.com/XikunLiu-huskit/GLIO/blob/332d19ff641f2ada9d9d75f2a6dab013d6015f76/gnss_comm/src/gnss_utility.cpp#L778

    static double mapf(double el, double a, double b, double c)
    {
        double sinel=sin(el);
        return (1.0+a/(1.0+b/(1.0+c)))/(sinel+(a/(sinel+b/(sinel+c))));
    }

However, original paper ( https://safe.nrao.edu/wiki/pub/Main/RefBendDelayCalc/Niell_Global.pdf ) list "equation 4" as :

image So the form is (1/(1+a / ... )) / (1+1/(sinel +b / ...)) As (1/y)/(1/x) can be rewritten as x/y Then the calculation above can be simplified as (sinel +b / ...) /(1+a / ... ) There can be no ambiguity as later it is used directly as follow, without further division or calculation directly as height correction : https://github.com/XikunLiu-huskit/GLIO/blob/332d19ff641f2ada9d9d75f2a6dab013d6015f76/gnss_comm/src/gnss_utility.cpp#L828 image

This is the same (wrong?) implementation as RTKLib and any other commonly used RTK library I could find on github. Am I just wrong about the understanding of the calculation, or is everyone copy-pasting the same error ?

XikunLiu-huskit commented 2 months ago

Hi @jonathanmuller, sorry for the late reply. I am just referring to the open-sourced code for this part. There seems to be some inconsistency. I will go to some experts and see if there is any problem. Please kindly let me know if you have more insights. Thank you!

jonathanmuller commented 2 months ago

Hi @XikunLiu-huskit , I got feedback from other sources that state that the original paper is Herring (1992), "Modeling atmospheric delays in the analysis of space geodetic data". And in this one the equation matches your/the open-source implementation. So I'll close this ticket as it seems that, in the end, it's absolutely correct. Sorry for the noise