00001 #pragma ident "$Id: LinearCombinations.cpp 2939 2011-10-23 19:55:11Z yanweignss $"
00002
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #include "LinearCombinations.hpp"
00032
00033
00034 namespace gpstk
00035 {
00036
00037 LinearCombinations::LinearCombinations()
00038 {
00039
00040 double a(+GAMMA_GPS/0.646944444);
00041 double b(1.0/0.646944444);
00042
00043
00044 c1Prefit.header = TypeID::prefitC;
00045 c1Prefit.body[TypeID::C1] = +1.0;
00046 c1Prefit.body[TypeID::rho] = -1.0;
00047 c1Prefit.body[TypeID::dtSat] = +1.0;
00048 c1Prefit.body[TypeID::rel] = -1.0;
00049 c1Prefit.body[TypeID::gravDelay] = -1.0;
00050 c1Prefit.body[TypeID::satPCenter] = -1.0;
00051 c1Prefit.body[TypeID::tropoSlant] = -1.0;
00052 c1Prefit.body[TypeID::ionoL1] = -1.0;
00053
00054 c1Prefit.body[TypeID::instC1] = -1.0;
00055 c1Prefit.body[TypeID::mpC1] = -1.0;
00056
00057
00058 p1Prefit.header = TypeID::prefitP1;
00059 p1Prefit.body[TypeID::P1] = +1.0;
00060 p1Prefit.body[TypeID::rho] = -1.0;
00061 p1Prefit.body[TypeID::dtSat] = +1.0;
00062 p1Prefit.body[TypeID::rel] = -1.0;
00063 p1Prefit.body[TypeID::gravDelay] = -1.0;
00064 p1Prefit.body[TypeID::satPCenter] = -1.0;
00065 p1Prefit.body[TypeID::tropoSlant] = -1.0;
00066 p1Prefit.body[TypeID::ionoL1] = -1.0;
00067
00068 p1Prefit.body[TypeID::instC1] = -1.0;
00069 p1Prefit.body[TypeID::mpC1] = -1.0;
00070
00071
00072 l1Prefit.header = TypeID::prefitL1;
00073 l1Prefit.body[TypeID::L1] = +1.0;
00074 l1Prefit.body[TypeID::rho] = -1.0;
00075 l1Prefit.body[TypeID::dtSat] = +1.0;
00076 l1Prefit.body[TypeID::rel] = -1.0;
00077 l1Prefit.body[TypeID::gravDelay] = -1.0;
00078 l1Prefit.body[TypeID::satPCenter] = -1.0;
00079 l1Prefit.body[TypeID::tropoSlant] = -1.0;
00080 l1Prefit.body[TypeID::ionoL1] = +1.0;
00081
00082 l1Prefit.body[TypeID::windUp] = -L1_WAVELENGTH/TWO_PI;
00083 l1Prefit.body[TypeID::mpL1] = -1.0;
00084
00085
00086 pcCombination.header = TypeID::PC;
00087 pcCombination.body[TypeID::P1] = +a;
00088 pcCombination.body[TypeID::P2] = -b;
00089
00090
00091 pcCombWithC1.header = TypeID::PC;
00092 pcCombWithC1.body[TypeID::C1] = +a;
00093 pcCombWithC1.body[TypeID::P2] = -b;
00094
00095
00096 pcPrefit.header = TypeID::prefitC;
00097 pcPrefit.body[TypeID::PC] = +1.0;
00098 pcPrefit.body[TypeID::rho] = -1.0;
00099 pcPrefit.body[TypeID::dtSat] = +1.0;
00100 pcPrefit.body[TypeID::rel] = -1.0;
00101 pcPrefit.body[TypeID::gravDelay] = -1.0;
00102 pcPrefit.body[TypeID::satPCenter] = -1.0;
00103 pcPrefit.body[TypeID::tropoSlant] = -1.0;
00104
00105
00106 lcCombination.header = TypeID::LC;
00107 lcCombination.body[TypeID::L1] = +a;
00108 lcCombination.body[TypeID::L2] = -b;
00109
00110
00111 lcPrefit.header = TypeID::prefitL;
00112 lcPrefit.body[TypeID::LC] = +1.0;
00113 lcPrefit.body[TypeID::rho] = -1.0;
00114 lcPrefit.body[TypeID::dtSat] = +1.0;
00115 lcPrefit.body[TypeID::rel] = -1.0;
00116 lcPrefit.body[TypeID::gravDelay] = -1.0;
00117 lcPrefit.body[TypeID::satPCenter] = -1.0;
00118 lcPrefit.body[TypeID::tropoSlant] = -1.0;
00119
00120 lcPrefit.body[TypeID::windUp] = -0.1069533781421467/TWO_PI;
00121
00122
00123 piCombination.header = TypeID::PI;
00124 piCombination.body[TypeID::P1] = -1.0;
00125 piCombination.body[TypeID::P2] = +1.0;
00126
00127
00128 piCombWithC1.header = TypeID::PI;
00129 piCombWithC1.body[TypeID::C1] = -1.0;
00130 piCombWithC1.body[TypeID::P2] = +1.0;
00131
00132
00133 liCombination.header = TypeID::LI;
00134 liCombination.body[TypeID::L1] = +1.0;
00135 liCombination.body[TypeID::L2] = -1.0;
00136
00137
00138 double c( L1_FREQ/(L1_FREQ + L2_FREQ) );
00139 double d( L2_FREQ/(L1_FREQ + L2_FREQ) );
00140 double e( L1_FREQ/(L1_FREQ - L2_FREQ) );
00141 double f( L2_FREQ/(L1_FREQ - L2_FREQ) );
00142
00143
00144 pdeltaCombination.header = TypeID::Pdelta;
00145 pdeltaCombination.body[TypeID::P1] = +c;
00146 pdeltaCombination.body[TypeID::P2] = +d;
00147
00148
00149
00150 pdeltaCombWithC1.header = TypeID::Pdelta;
00151 pdeltaCombWithC1.body[TypeID::C1] = +c;
00152 pdeltaCombWithC1.body[TypeID::P2] = +d;
00153
00154
00155 ldeltaCombination.header = TypeID::Ldelta;
00156 ldeltaCombination.body[TypeID::L1] = +e;
00157 ldeltaCombination.body[TypeID::L2] = -f;
00158
00159
00160 mwubbenaCombination.header = TypeID::MWubbena;
00161 mwubbenaCombination.body[TypeID::L1] = +e;
00162 mwubbenaCombination.body[TypeID::L2] = -f;
00163 mwubbenaCombination.body[TypeID::P1] = -c;
00164 mwubbenaCombination.body[TypeID::P2] = -d;
00165
00166
00167
00168
00169 mwubbenaPrefit.header = TypeID::prefitMWubbena;
00170 mwubbenaPrefit.body[TypeID::L1] = +e;
00171 mwubbenaPrefit.body[TypeID::L2] = -f;
00172 mwubbenaPrefit.body[TypeID::P1] = -c;
00173 mwubbenaPrefit.body[TypeID::P2] = -d;
00174
00175
00176
00177 mwubbenaCombWithC1.header = TypeID::MWubbena;
00178 mwubbenaCombWithC1.body[TypeID::L1] = +e;
00179 mwubbenaCombWithC1.body[TypeID::L2] = -f;
00180 mwubbenaCombWithC1.body[TypeID::C1] = -c;
00181 mwubbenaCombWithC1.body[TypeID::P2] = -d;
00182
00183
00184
00185 GRAPHIC1Combination.header = TypeID::GRAPHIC1;
00186 GRAPHIC1Combination.body[TypeID::P1] = +0.5;
00187 GRAPHIC1Combination.body[TypeID::L1] = +0.5;
00188
00189
00190
00191 GRAPHIC1CombinationWithC1.header = TypeID::GRAPHIC1;
00192 GRAPHIC1CombinationWithC1.body[TypeID::C1] = +0.5;
00193 GRAPHIC1CombinationWithC1.body[TypeID::L1] = +0.5;
00194
00195
00196
00197 GRAPHIC2Combination.header = TypeID::GRAPHIC2;
00198 GRAPHIC2Combination.body[TypeID::P2] = +0.5;
00199 GRAPHIC2Combination.body[TypeID::L2] = +0.5;
00200
00201
00202
00203 GRAPHIC5Combination.header = TypeID::GRAPHIC5;
00204 GRAPHIC5Combination.body[TypeID::C5] = +0.5;
00205 GRAPHIC5Combination.body[TypeID::L5] = +0.5;
00206
00207
00208
00209 GRAPHIC6Combination.header = TypeID::GRAPHIC6;
00210 GRAPHIC6Combination.body[TypeID::C6] = +0.5;
00211 GRAPHIC6Combination.body[TypeID::L6] = +0.5;
00212
00213
00214
00215 GRAPHIC7Combination.header = TypeID::GRAPHIC7;
00216 GRAPHIC7Combination.body[TypeID::C7] = +0.5;
00217 GRAPHIC7Combination.body[TypeID::L7] = +0.5;
00218
00219
00220
00221 GRAPHIC8Combination.header = TypeID::GRAPHIC8;
00222 GRAPHIC8Combination.body[TypeID::C8] = +0.5;
00223 GRAPHIC8Combination.body[TypeID::L8] = +0.5;
00224
00225
00226
00227 wlCombination.header = TypeID::WL;
00228 wlCombination.body[TypeID::L1] = firstFactorOfLC(1,-1);
00229 wlCombination.body[TypeID::L2] = secondFactorOfLC(1,-1);
00230
00231
00232 wlPrefit.header = TypeID::prefitWL;
00233 wlPrefit.body[TypeID::WL] = +1.0;
00234 wlPrefit.body[TypeID::rho] = -1.0;
00235 wlPrefit.body[TypeID::dtSat] = +1.0;
00236 wlPrefit.body[TypeID::rel] = -1.0;
00237 wlPrefit.body[TypeID::gravDelay] = -1.0;
00238 wlPrefit.body[TypeID::satPCenter] = -1.0;
00239 wlPrefit.body[TypeID::tropoSlant] = -1.0;
00240 wlPrefit.body[TypeID::ionoL1] = firstFactorOfLC(1,-1)
00241 +secondFactorOfLC(1,-1)*GAMMA_GPS;
00242 wlPrefit.body[TypeID::windUp] = -wavelengthOfLC(1,-1)/TWO_PI;
00243
00244
00245
00246 wl2Combination.header = TypeID::WL2;
00247 wl2Combination.body[TypeID::L1] = firstFactorOfLC(-2,3);
00248 wl2Combination.body[TypeID::L2] = secondFactorOfLC(-2,3);
00249
00250
00251 wl2Prefit.header = TypeID::prefitWL2;
00252 wl2Prefit.body[TypeID::WL2] = +1.0;
00253 wl2Prefit.body[TypeID::rho] = -1.0;
00254 wl2Prefit.body[TypeID::dtSat] = +1.0;
00255 wl2Prefit.body[TypeID::rel] = -1.0;
00256 wl2Prefit.body[TypeID::gravDelay] = -1.0;
00257 wl2Prefit.body[TypeID::satPCenter] = -1.0;
00258 wl2Prefit.body[TypeID::tropoSlant] = -1.0;
00259 wl2Prefit.body[TypeID::ionoL1] = firstFactorOfLC(-2,3)
00260 +secondFactorOfLC(-2,3)*GAMMA_GPS;
00261 wl2Prefit.body[TypeID::windUp] = -wavelengthOfLC(-2,3)/TWO_PI;
00262
00263
00264 wl4Combination.header = TypeID::WL4;
00265 wl4Combination.body[TypeID::L1] = firstFactorOfLC(4,-5);
00266 wl4Combination.body[TypeID::L2] = secondFactorOfLC(4,-5);
00267
00268
00269 wl4Prefit.header = TypeID::prefitWL4;
00270 wl4Prefit.body[TypeID::WL4] = +1.0;
00271 wl4Prefit.body[TypeID::rho] = -1.0;
00272 wl4Prefit.body[TypeID::dtSat] = +1.0;
00273 wl4Prefit.body[TypeID::rel] = -1.0;
00274 wl4Prefit.body[TypeID::gravDelay] = -1.0;
00275 wl4Prefit.body[TypeID::satPCenter] = -1.0;
00276 wl4Prefit.body[TypeID::tropoSlant] = -1.0;
00277 wl4Prefit.body[TypeID::ionoL1] = firstFactorOfLC(4,-5)
00278 +secondFactorOfLC(4,-5)*GAMMA_GPS;
00279 wl4Prefit.body[TypeID::windUp] = -wavelengthOfLC(4,-5)/TWO_PI;
00280
00281 }
00282
00283
00284
00285 double LinearCombinations::freqOfLC(int i, int j, double f1 , double f2 )
00286 {
00287 return ( double(i)*f1+double(j)*f2 );
00288 }
00289
00290
00291 double LinearCombinations::wavelengthOfLC(int i,int j,double f1,double f2)
00292 {
00293 return C_GPS_M / freqOfLC(i,j,f1,f2);
00294 }
00295
00297 double LinearCombinations::firstFactorOfLC(int i,int j,double f1,double f2)
00298 {
00299 return double(i)*f1/freqOfLC(i,j,f1,f2);
00300 }
00301
00303 double LinearCombinations::secondFactorOfLC(int i,int j,double f1,double f2 )
00304 {
00305 return double(j)*f2/freqOfLC(i,j,f1,f2);
00306 }
00307
00308
00309 }
00310
00311