Nav-Soft an OpenSource Software GNSS company.


Home > GPS Theory > Ionospheric Delay Theory > GPS Ionospheric Delay Calculation

GPS Ionospheric Delay Calculation.

Here we go through the code that derives the correction to the pseudorange due to the slowing down of the Satellite RF signal when travelling through the Ionosphere.

We begin, as is usual practice, by defining several variables that will be used during the calculation.


double   iono_model(int chan)
{
GNSS_structSatPVT *sat_pos;
GNSS_structPVT *spvt;

double  t_iono,
        el_angle,
        phi_i,
        phi_m,
        phi_u,
        ob_factor,
        amp,
        az_angle,
        lambda_i,
        lambda_u,
        psi,
        phase_X,
        period,
        local_t;
double spos[4];

        sat_pos = &rx_meas[chan].sat_pos;
        spvt = &sat_pos->pvt;

We start the calculation by transforming the satellite position in cartesian (xyz) co-ordinates to the latitude, longitude and height co-ordinates used in the ionospheric model. Then the elevation and azimuth angle of the satellite from the users (estimated) position.

        spos[1] = spvt->x;
        spos[2] = spvt->y;
        spos[3] = spvt->z;
        ecef_to_llh(spos);
        phi_u = spos[1]/PI;
        lambda_u = spos[2]/PI;
        el_angle = sat_pos->elevation/PI;
        az_angle = sat_pos->azimuth;

Then we work our way through the various equations in the Klobuchar model.

        psi = 0.0137/(el_angle+0.11) - 0.022;
        phi_i = phi_u + psi*cos(az_angle);

        if(phi_i>0.416)phi_i=0.416;
        if(phi_i<-0.416)phi_i=-0.416;

        lambda_i = lambda_u +((psi*sin(az_angle))/cos(phi_i*PI));
        phi_m = phi_i+0.064*cos((lambda_i-1.617)*PI);

        local_t = rx_meas[chan].tow;
        while(local_t>=86400)local_t-=86400;
        local_t += 43200*lambda_i;
        if(local_t>=86400)local_t-=86400;
        if(local_t<0)local_t+=86400;
//      printf("Iono GPS time is %lf local time is %lf\n",user_time,local_t);

Having calculated the time of day in seconds above, we derive the period and amplitude values of the model. The alpha and beta components used here are supplied by the data downloaded from the satellite and are related to the tec or total electron content in the ionosphere.

        period = iono_data.beta0;
        period+= iono_data.beta1*phi_m;
        period+= iono_data.beta2*pow(phi_m,2);
        period+= iono_data.beta3*pow(phi_m,3);

        if(period<72000)period=72000;
        phase_X = 2*PI*(local_t-50400)/period;

        amp = iono_data.alpha0;
        amp+= iono_data.alpha1*phi_m;
        amp+= iono_data.alpha2*pow(phi_m,2);
        amp+= iono_data.alpha3*pow(phi_m,3);

        if(amp<0)amp=0;
        ob_factor = 1+16*pow((0.53-el_angle),3);
        t_iono=ob_factor*5e-9;

Now the obliquity factor is calculated to allow for the signal from the satellite travelling through the ionosphere at an oblique angle and travelling a greater distance within the ionosphere.

        if(phase_X<1.57)
          t_iono += ob_factor*amp*(1-pow(phase_X,2)/2+pow(phase_X,4)/24);
        t_iono *= SPEED_OF_LIGHT;
//      printf("Sat %d ionospheric correction is %lf m\n",
//              rx_meas[chan].id,t_iono);

        rx_meas[chan].corrections.prcIono = t_iono;

        return(t_iono);
}
© 2018

No explanation is given in the GPS User documentation for the details of the Klobuchar ionospheric model and the ionospheric correction accuracy is one of the biggest causes of error in the GPS User position calculation process.

Back to Top of Page