1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-16 05:00:35 +00:00
This commit is contained in:
Antonio Ramos 2018-03-02 13:30:21 +01:00
parent a216d22509
commit 3ce49ada96

View File

@ -54,7 +54,6 @@
#include "rtklib_ephemeris.h"
#include "rtklib_ionex.h"
#include "rtklib_sbas.h"
#include <iostream>
/* pseudorange measurement error variance ------------------------------------*/
double varerr(const prcopt_t *opt, double el, int sys)
@ -131,7 +130,12 @@ double prange(const obsd_t *obs, const nav_t *nav, const double *azel,
}
}
}
gamma_ = std::pow(lam[j], 2.0) / std::pow(lam[i], 2.0); /* f1^2/f2^2 */
/* fL1^2 / fL2(orL5)^2 . See IS-GPS-200, p. 103 and Galileo ICD p. 48 */
if(sys == SYS_GPS or sys == SYS_GAL)
{
gamma_ = std::pow(lam[i], 2.0) / std::pow(lam[j], 2.0);
}
P1 = obs->P[i];
P2 = obs->P[j];
P1_P2 = nav->cbias[obs->sat-1][0];
@ -139,10 +143,15 @@ double prange(const obsd_t *obs, const nav_t *nav, const double *azel,
P2_C2 = nav->cbias[obs->sat-1][2];
/* if no P1-P2 DCB, use TGD instead */
if (P1_P2 == 0.0 && (sys & (SYS_GPS | SYS_GAL | SYS_QZS))) //CHECK!
if(P1_P2 == 0.0 and sys == SYS_GPS)
{
P1_P2 = (1.0 - gamma_) * gettgd(obs->sat, nav);
P1_P2 = (gamma_ - 1.0) * gettgd(obs->sat, nav);
}
else if(P1_P2 == 0.0 and sys == SYS_GAL)
{
//TODO
}
if (opt->ionoopt == IONOOPT_IFLC)
{ /* dual-frequency */
@ -158,21 +167,35 @@ double prange(const obsd_t *obs, const nav_t *nav, const double *azel,
if((obs->code[i] == CODE_NONE) && (obs->code[j] == CODE_NONE)) { return 0.0; }
else if((obs->code[i] != CODE_NONE) && (obs->code[j] == CODE_NONE))
{
{//CHECK!!
P1 += P1_C1; /* C1->P1 */
PC = P1 - P1_P2 / (1.0 - gamma_);
}
else if((obs->code[i] == CODE_NONE) && (obs->code[j] != CODE_NONE))
{
if(sys == SYS_GPS)
{//CHECK!!
P2 += P2_C2; /* C2->P2 */
PC = P2 - gamma_ * P1_P2 / (1.0 - gamma_);
}
else if(sys == SYS_GAL)
{
//TODO
}
}
/* dual-frequency */
else
{
if(sys == SYS_GPS) /* See IS-GPS-200 p. 179 */
{
P1 += P1_C1;
P2 += P2_C2;
PC = (gamma_ * P1 - P2) / (gamma_ - 1.0);
PC = (P2 - gamma_ * P1) / (1 - gamma_) - P1_P2 / (gamma_ - 1);
}
else if(sys == SYS_GAL)
{
//TODO
}
}
}
if (opt->sateph == EPHOPT_SBAS) { PC -= P1_C1; } /* sbas clock based C1 */