Commit 180a5575 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Solved a bug in the calculation of the carrier phase.

parent 84b137e4
......@@ -692,7 +692,36 @@ void CasteRx1::process_meas_epoch(unsigned char *data,unsigned short int length)
if(gps_meas_epoch_type1.carrier.msb==-128 && gps_meas_epoch_type1.carrier.lsb==0)// the carrier phase is not valid
meas_epoch_type1.carrier_phase=0.0;
else
meas_epoch_type1.carrier_phase=((double)gps_meas_epoch_type1.carrier.msb)*65.536+((double)gps_meas_epoch_type1.carrier.lsb)/1000.0;
meas_epoch_type1.carrier_phase=(meas_epoch_type1.pseudo_range/299792458.0)+((double)gps_meas_epoch_type1.carrier.msb)*65.536+((double)gps_meas_epoch_type1.carrier.lsb)/1000.0;
switch(meas_epoch_type1.signal_type)
{
case GPS_L1_CA:
case GPS_L1_PY: meas_epoch_type1.carrier_phase+=(meas_epoch_type1.pseudo_range/299792458.0)*1575420000.0;
break;
case GPS_L2_PY:
case GPS_L2C: meas_epoch_type1.carrier_phase+=(meas_epoch_type1.pseudo_range/299792458.0)*1227600000.0;
break;
case GPS_L5: meas_epoch_type1.carrier_phase+=(meas_epoch_type1.pseudo_range/299792458.0)*1176450000.0;
break;
case GLO_L1_CA:
case GLO_L1_P:
case GLO_L2_P:
case GLO_L2_CA: break;
case GAL_L1A:
case GAL_L1BC: meas_epoch_type1.carrier_phase+=(meas_epoch_type1.pseudo_range/299792458.0)*1575420000.0;
break;
case GAL_E6B:
case GAL_E6BC: meas_epoch_type1.carrier_phase+=(meas_epoch_type1.pseudo_range/299792458.0)*1278750000.0;
break;
case GAL_E5a: meas_epoch_type1.carrier_phase+=(meas_epoch_type1.pseudo_range/299792458.0)*1176450000.0;
break;
case GAL_E5b: meas_epoch_type1.carrier_phase+=(meas_epoch_type1.pseudo_range/299792458.0)*1207140000.0;
break;
case GAL_E5: meas_epoch_type1.carrier_phase+=(meas_epoch_type1.pseudo_range/299792458.0)*1191795000.0;
break;
case GEO_L1CA: meas_epoch_type1.carrier_phase+=(meas_epoch_type1.pseudo_range/299792458.0)*1575420000.0;
break;
}
meas_epoch_type1.cn0=((double)gps_meas_epoch_type1.cn0)*0.25;
if(meas_epoch_type1.signal_type==GPS_L1_PY || meas_epoch_type1.signal_type==GPS_L2_PY)
meas_epoch_type1.cn0+=10;
......@@ -732,6 +761,35 @@ void CasteRx1::process_meas_epoch(unsigned char *data,unsigned short int length)
meas_epoch_type2.carrier_phase=0.0;
else
meas_epoch_type2.carrier_phase=((double)gps_meas_epoch_type2.carrier_msb)*65.536+((double)gps_meas_epoch_type2.carrier_lsb)/1000.0;
switch(meas_epoch_type2.signal_type)
{
case GPS_L1_CA:
case GPS_L1_PY: meas_epoch_type2.carrier_phase+=(meas_epoch_type2.pseudo_range/299792458.0)*1575420000.0;
break;
case GPS_L2_PY:
case GPS_L2C: meas_epoch_type2.carrier_phase+=(meas_epoch_type2.pseudo_range/299792458.0)*1227600000.0;
break;
case GPS_L5: meas_epoch_type2.carrier_phase+=(meas_epoch_type2.pseudo_range/299792458.0)*1176450000.0;
break;
case GLO_L1_CA:
case GLO_L1_P:
case GLO_L2_P:
case GLO_L2_CA: break;
case GAL_L1A:
case GAL_L1BC: meas_epoch_type2.carrier_phase+=(meas_epoch_type2.pseudo_range/299792458.0)*1575420000.0;
break;
case GAL_E6B:
case GAL_E6BC: meas_epoch_type2.carrier_phase+=(meas_epoch_type2.pseudo_range/299792458.0)*1278750000.0;
break;
case GAL_E5a: meas_epoch_type2.carrier_phase+=(meas_epoch_type2.pseudo_range/299792458.0)*1176450000.0;
break;
case GAL_E5b: meas_epoch_type2.carrier_phase+=(meas_epoch_type2.pseudo_range/299792458.0)*1207140000.0;
break;
case GAL_E5: meas_epoch_type2.carrier_phase+=(meas_epoch_type2.pseudo_range/299792458.0)*1191795000.0;
break;
case GEO_L1CA: meas_epoch_type2.carrier_phase+=(meas_epoch_type2.pseudo_range/299792458.0)*1575420000.0;
break;
}
if(gps_meas_epoch_type2.info.smoothed==1)
meas_epoch_type2.pseudorange_smoothed=true;
else
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment