SolverPPP.cpp

Go to the documentation of this file.
00001 #pragma ident "$Id: SolverPPP.cpp 2645 2011-06-08 03:23:24Z yanweignss $"
00002 
00008 //============================================================================
00009 //
00010 //  This file is part of GPSTk, the GPS Toolkit.
00011 //
00012 //  The GPSTk is free software; you can redistribute it and/or modify
00013 //  it under the terms of the GNU Lesser General Public License as published
00014 //  by the Free Software Foundation; either version 2.1 of the License, or
00015 //  any later version.
00016 //
00017 //  The GPSTk is distributed in the hope that it will be useful,
00018 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00019 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020 //  GNU Lesser General Public License for more details.
00021 //
00022 //  You should have received a copy of the GNU Lesser General Public
00023 //  License along with GPSTk; if not, write to the Free Software Foundation,
00024 //  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00025 //
00026 //  Dagoberto Salazar - gAGE ( http://www.gage.es ). 2008, 2009
00027 //
00028 //============================================================================
00029 
00030 
00031 #include "SolverPPP.hpp"
00032 #include "MatrixFunctors.hpp"
00033 
00034 
00035 namespace gpstk
00036 {
00037 
00038       // Index initially assigned to this class
00039    int SolverPPP::classIndex = 9300000;
00040 
00041 
00042       // Returns an index identifying this object.
00043    int SolverPPP::getIndex() const
00044    { return index; }
00045 
00046 
00047       // Returns a string identifying this object.
00048    std::string SolverPPP::getClassName() const
00049    { return "SolverPPP"; }
00050 
00051 
00052       /* Common constructor.
00053        *
00054        * @param useNEU   If true, will compute dLat, dLon, dH coordinates;
00055        *                 if false (the default), will compute dx, dy, dz.
00056        */
00057    SolverPPP::SolverPPP(bool useNEU)
00058       : firstTime(true)
00059    {
00060 
00061          // Set the equation system structure
00062       setNEU(useNEU);
00063 
00064          // Set the class index
00065       setIndex();
00066 
00067          // Call initializing method
00068       Init();
00069 
00070    }  // End of 'SolverPPP::SolverPPP()'
00071 
00072 
00073 
00074       // Initializing method.
00075    void SolverPPP::Init(void)
00076    {
00077 
00078          // Set qdot value for default random walk stochastic model
00079       rwalkModel.setQprime(3e-8);
00080 
00081          // Pointer to default stochastic model for troposphere (random walk)
00082       pTropoStoModel = &rwalkModel;
00083 
00084          // Set default coordinates stochastic model (constant)
00085       setCoordinatesModel( &constantModel );
00086 
00087       whitenoiseModelX.setSigma(100.0);
00088       whitenoiseModelY.setSigma(100.0);
00089       whitenoiseModelZ.setSigma(100.0);
00090 
00091          // Pointer to default receiver clock stochastic model (white noise)
00092       pClockStoModel = &whitenoiseModel;
00093 
00094          // Pointer to stochastic model for phase biases
00095       pBiasStoModel  = &biasModel;
00096 
00097          // Set default factor that multiplies phase weights
00098          // If code sigma is 1 m and phase sigma is 1 cm, the ratio is 100:1
00099       weightFactor = 10000.0;       // 100^2
00100 
00101 
00102    }  // End of method 'SolverPPP::Init()'
00103 
00104 
00105 
00106       /* Compute the solution of the given equations set.
00107        *
00108        * @param prefitResiduals   Vector of prefit residuals
00109        * @param designMatrix      Design matrix for the equation system
00110        * @param weightVector      Vector of weights assigned to each
00111        *                          satellite.
00112        *
00113        * \warning A typical Kalman filter works with the measurements noise
00114        * covariance matrix, instead of the vector of weights. Beware of this
00115        * detail, because this method uses the later.
00116        *
00117        * @return
00118        *  0 if OK
00119        *  -1 if problems arose
00120        */
00121    int SolverPPP::Compute( const Vector<double>& prefitResiduals,
00122                            const Matrix<double>& designMatrix,
00123                            const Vector<double>& weightVector )
00124       throw(InvalidSolver)
00125    {
00126 
00127          // By default, results are invalid
00128       valid = false;
00129 
00130          // First, check that everyting has a proper size
00131       int wSize = static_cast<int>(weightVector.size());
00132       int pSize = static_cast<int>(prefitResiduals.size());
00133       if (!(wSize==pSize))
00134       {
00135          InvalidSolver e("prefitResiduals size does not match dimension \
00136 of weightVector");
00137          GPSTK_THROW(e);
00138       }
00139 
00140       Matrix<double> wMatrix(wSize,wSize,0.0);  // Declare a weight matrix
00141 
00142          // Fill the weight matrix diagonal with the content of
00143          // the weights vector
00144       for( int i=0; i<wSize; i++ )
00145       {
00146          wMatrix(i,i) = weightVector(i);
00147       }
00148 
00149          // Call the more general SolverPPP::Compute() method
00150       return SolverPPP::Compute( prefitResiduals,
00151                                  designMatrix,
00152                                  wMatrix );
00153 
00154    }  // End of method 'SolverPPP::Compute()'
00155 
00156 
00157 
00158       // Compute the solution of the given equations set.
00159       //
00160       // @param prefitResiduals   Vector of prefit residuals
00161       // @param designMatrix      Design matrix for equation system
00162       // @param weightMatrix      Matrix of weights
00163       //
00164       // \warning A typical Kalman filter works with the measurements noise
00165       // covariance matrix, instead of the matrix of weights. Beware of this
00166       // detail, because this method uses the later.
00167       //
00168       // @return
00169       //  0 if OK
00170       //  -1 if problems arose
00171       //
00172    int SolverPPP::Compute( const Vector<double>& prefitResiduals,
00173                            const Matrix<double>& designMatrix,
00174                            const Matrix<double>& weightMatrix )
00175       throw(InvalidSolver)
00176    {
00177 
00178          // By default, results are invalid
00179       valid = false;
00180 
00181       if (!(weightMatrix.isSquare()))
00182       {
00183          InvalidSolver e("Weight matrix is not square");
00184          GPSTK_THROW(e);
00185       }
00186 
00187       int wRow = static_cast<int>(weightMatrix.rows());
00188       int pRow = static_cast<int>(prefitResiduals.size());
00189       if (!(wRow==pRow))
00190       {
00191          InvalidSolver e("prefitResiduals size does not match dimension of \
00192 weightMatrix");
00193          GPSTK_THROW(e);
00194       }
00195 
00196       int gRow = static_cast<int>(designMatrix.rows());
00197       if (!(gRow==pRow))
00198       {
00199          InvalidSolver e("prefitResiduals size does not match dimension \
00200 of designMatrix");
00201          GPSTK_THROW(e);
00202       }
00203 
00204       if (!(phiMatrix.isSquare()))
00205       {
00206          InvalidSolver e("phiMatrix is not square");
00207          GPSTK_THROW(e);
00208       }
00209 
00210       int phiRow = static_cast<int>(phiMatrix.rows());
00211       if (!(phiRow==numUnknowns))
00212       {
00213          InvalidSolver e("Number of unknowns does not match dimension \
00214 of phiMatrix");
00215          GPSTK_THROW(e);
00216       }
00217 
00218       if (!(qMatrix.isSquare()))
00219       {
00220          InvalidSolver e("qMatrix is not square");
00221          GPSTK_THROW(e);
00222       }
00223 
00224       int qRow = static_cast<int>(qMatrix.rows());
00225       if (!(qRow==numUnknowns))
00226       {
00227          InvalidSolver e("Number of unknowns does not match dimension \
00228 of qMatrix");
00229          GPSTK_THROW(e);
00230       }
00231 
00232          // After checking sizes, let's invert the matrix of weights in order
00233          // to get the measurements noise covariance matrix, which is what we
00234          // use in the "SimpleKalmanFilter" class
00235       Matrix<double> measNoiseMatrix;
00236 
00237       try
00238       {
00239          measNoiseMatrix = inverseChol(weightMatrix);
00240       }
00241       catch(...)
00242       {
00243          InvalidSolver e("Correct(): Unable to compute measurements noise \
00244 covariance matrix.");
00245          GPSTK_THROW(e);
00246       }
00247 
00248 
00249       try
00250       {
00251 
00252             // Call the Kalman filter object.
00253          kFilter.Compute( phiMatrix,
00254                           qMatrix,
00255                           prefitResiduals,
00256                           designMatrix,
00257                           measNoiseMatrix );
00258 
00259       }
00260       catch(InvalidSolver& e)
00261       {
00262          GPSTK_RETHROW(e);
00263       }
00264 
00265          // Store the solution
00266       solution = kFilter.xhat;
00267 
00268          // Store the covariance matrix of the solution
00269       covMatrix = kFilter.P;
00270 
00271          // Compute the postfit residuals Vector
00272       postfitResiduals = prefitResiduals - (designMatrix * solution);
00273 
00274          // If everything is fine so far, then the results should be valid
00275       valid = true;
00276 
00277       return 0;
00278 
00279    }  // End of method 'SolverPPP::Compute()'
00280 
00281 
00282 
00283       /* Returns a reference to a gnnsSatTypeValue object after
00284        * solving the previously defined equation system.
00285        *
00286        * @param gData    Data object holding the data.
00287        */
00288    gnssSatTypeValue& SolverPPP::Process(gnssSatTypeValue& gData)
00289       throw(ProcessingException)
00290    {
00291 
00292       try
00293       {
00294 
00295             // Build a gnssRinex object and fill it with data
00296          gnssRinex g1;
00297          g1.header = gData.header;
00298          g1.body = gData.body;
00299 
00300             // Call the Process() method with the appropriate input object
00301          Process(g1);
00302 
00303             // Update the original gnssSatTypeValue object with the results
00304          gData.body = g1.body;
00305 
00306          return gData;
00307 
00308       }
00309       catch(Exception& u)
00310       {
00311             // Throw an exception if something unexpected happens
00312          ProcessingException e( getClassName() + ":"
00313                                 + StringUtils::asString( getIndex() ) + ":"
00314                                 + u.what() );
00315 
00316          GPSTK_THROW(e);
00317 
00318       }
00319 
00320    }  // End of method 'SolverPPP::Process()'
00321 
00322 
00323 
00324       /* Returns a reference to a gnnsRinex object after solving
00325        * the previously defined equation system.
00326        *
00327        * @param gData     Data object holding the data.
00328        */
00329    gnssRinex& SolverPPP::Process(gnssRinex& gData)
00330       throw(ProcessingException)
00331    {
00332 
00333       try
00334       {
00335 
00336             // Please note that there are two different sets being defined:
00337             //
00338             // - "currSatSet" stores satellites currently in view, and it is
00339             //   related with the number of measurements.
00340             //
00341             // - "satSet" stores satellites being processed; this set is
00342             //   related with the number of unknowns.
00343             //
00344 
00345 
00346             // Get a set with all satellites present in this GDS
00347          SatIDSet currSatSet( gData.body.getSatID() );
00348 
00349             // Get the number of satellites currently visible
00350          int numCurrentSV( gData.numSats() );
00351 
00352             // Update set with satellites being processed so far
00353          satSet.insert( currSatSet.begin(), currSatSet.end() );
00354 
00355             // Get the number of satellites to be processed
00356          int numSV( satSet.size() );
00357 
00358             // Number of measurements is twice the number of visible satellites
00359          numMeas = 2 * numCurrentSV;
00360 
00361             // Number of 'core' variables: Coordinates, RX clock, troposphere
00362          numVar = defaultEqDef.body.size();
00363 
00364             // Total number of unknowns is defined as variables + processed SVs
00365          numUnknowns = numVar + numSV;
00366 
00367             // State Transition Matrix (PhiMatrix)
00368          phiMatrix.resize(numUnknowns, numUnknowns, 0.0);
00369 
00370             // Noise covariance matrix (QMatrix)
00371          qMatrix.resize(numUnknowns, numUnknowns, 0.0);
00372 
00373 
00374             // Build the vector of measurements (Prefit-residuals): Code + phase
00375          measVector.resize(numMeas, 0.0);
00376 
00377          Vector<double> prefitC(gData.getVectorOfTypeID(defaultEqDef.header));
00378          Vector<double> prefitL(gData.getVectorOfTypeID(TypeID::prefitL));
00379          for( int i=0; i<numCurrentSV; i++ )
00380          {
00381             measVector( i                ) = prefitC(i);
00382             measVector( numCurrentSV + i ) = prefitL(i);
00383          }
00384 
00385 
00386             // Weights matrix
00387          rMatrix.resize(numMeas, numMeas, 0.0);
00388 
00389             // Generate the appropriate weights matrix
00390             // Try to extract weights from GDS
00391          satTypeValueMap dummy(gData.body.extractTypeID(TypeID::weight));
00392 
00393             // Check if weights match
00394          if ( dummy.numSats() == numCurrentSV )
00395          {
00396 
00397                // If we have weights information, let's load it
00398             Vector<double>
00399                weightsVector(gData.getVectorOfTypeID(TypeID::weight));
00400 
00401             for( int i=0; i<numCurrentSV; i++ )
00402             {
00403 
00404                rMatrix( i               , i         ) = weightsVector(i);
00405                rMatrix( i + numCurrentSV, i + numCurrentSV )
00406                                              = weightsVector(i) * weightFactor;
00407 
00408             }  // End of 'for( int i=0; i<numCurrentSV; i++ )'
00409 
00410          }
00411          else
00412          {
00413 
00414                // If weights don't match, assign generic weights
00415             for( int i=0; i<numCurrentSV; i++ )
00416             {
00417                rMatrix( i               , i         ) = 1.0;
00418 
00419                   // Phases weights are bigger
00420                rMatrix( i + numCurrentSV, i + numCurrentSV )
00421                                                          = 1.0 * weightFactor;
00422 
00423             }  // End of 'for( int i=0; i<numCurrentSV; i++ )'
00424 
00425          }  // End of 'if ( dummy.numSats() == numCurrentSV )'
00426 
00427 
00428 
00429             // Generate the corresponding geometry/design matrix
00430          hMatrix.resize(numMeas, numUnknowns, 0.0);
00431 
00432             // Get the values corresponding to 'core' variables
00433          Matrix<double> dMatrix(gData.body.getMatrixOfTypes(defaultEqDef.body));
00434 
00435             // Let's fill 'hMatrix'
00436          for( int i=0; i<numCurrentSV; i++ )
00437          {
00438 
00439                // First, fill the coefficients related to tropo, coord and clock
00440             for( int j=0; j<numVar; j++ )
00441             {
00442 
00443                hMatrix( i               , j ) = dMatrix(i,j);
00444                hMatrix( i + numCurrentSV, j ) = dMatrix(i,j);
00445 
00446             }
00447 
00448          }  // End of 'for( int i=0; i<numCurrentSV; i++ )'
00449 
00450 
00451             // Now, fill the coefficients related to phase biases
00452             // We must be careful because not all processed satellites
00453             // are currently visible
00454          int count1(0);
00455          for( SatIDSet::const_iterator itSat = currSatSet.begin();
00456               itSat != currSatSet.end();
00457               ++itSat )
00458          {
00459 
00460                // Find in which position of 'satSet' is the current '(*itSat)'
00461                // Please note that 'currSatSet' is a subset of 'satSet'
00462             int j(0);
00463             SatIDSet::const_iterator itSat2( satSet.begin() );
00464             while( (*itSat2) != (*itSat) )
00465             {
00466                ++j;
00467                ++itSat2;
00468             }
00469 
00470 
00471                // Put coefficient in the right place
00472             hMatrix( count1 + numCurrentSV, j + numVar ) = 1.0;
00473 
00474             ++count1;
00475 
00476          }  // End of 'for( itSat = satSet.begin(); ... )'
00477 
00478 
00479 
00480             // Now, let's fill the Phi and Q matrices
00481          SatID  dummySat;
00482 
00483             // First, the troposphere
00484          pTropoStoModel->Prepare( dummySat,
00485                                   gData );
00486          phiMatrix(0,0) = pTropoStoModel->getPhi();
00487          qMatrix(0,0)   = pTropoStoModel->getQ();
00488 
00489 
00490             // Second, the coordinates
00491          pCoordXStoModel->Prepare(dummySat, gData);
00492          phiMatrix(1,1) = pCoordXStoModel->getPhi();
00493          qMatrix(1,1)   = pCoordXStoModel->getQ();
00494 
00495          pCoordYStoModel->Prepare(dummySat, gData);
00496          phiMatrix(2,2) = pCoordYStoModel->getPhi();
00497          qMatrix(2,2)   = pCoordYStoModel->getQ();
00498 
00499          pCoordZStoModel->Prepare(dummySat, gData);
00500          phiMatrix(3,3) = pCoordZStoModel->getPhi();
00501          qMatrix(3,3)   = pCoordZStoModel->getQ();
00502 
00503 
00504             // Third, the receiver clock
00505          pClockStoModel->Prepare( dummySat,
00506                                   gData );
00507          phiMatrix(4,4) = pClockStoModel->getPhi();
00508          qMatrix(4,4)   = pClockStoModel->getQ();
00509 
00510 
00511             // Finally, the phase biases
00512          int count2(numVar);     // Note that for PPP, 'numVar' is always 5!!!
00513          for( SatIDSet::const_iterator itSat = satSet.begin();
00514               itSat != satSet.end();
00515               ++itSat )
00516          {
00517 
00518                // Prepare stochastic model
00519             pBiasStoModel->Prepare( *itSat,
00520                                     gData );
00521 
00522                // Get values into phi and q matrices
00523             phiMatrix(count2,count2) = pBiasStoModel->getPhi();
00524             qMatrix(count2,count2)   = pBiasStoModel->getQ();
00525 
00526             ++count2;
00527          }
00528 
00529 
00530 
00531             // Feed the filter with the correct state and covariance matrix
00532          if(firstTime)
00533          {
00534 
00535             Vector<double> initialState(numUnknowns, 0.0);
00536             Matrix<double> initialErrorCovariance( numUnknowns,
00537                                                    numUnknowns,
00538                                                    0.0 );
00539 
00540 
00541                // Fill the initialErrorCovariance matrix
00542 
00543                // First, the zenital wet tropospheric delay
00544             initialErrorCovariance(0,0) = 0.25;          // (0.5 m)**2
00545 
00546                // Second, the coordinates
00547             for( int i=1; i<4; i++ )
00548             {
00549                initialErrorCovariance(i,i) = 10000.0;    // (100 m)**2
00550             }
00551 
00552                // Third, the receiver clock
00553             initialErrorCovariance(4,4) = 9.0e10;        // (300 km)**2
00554 
00555                // Finally, the phase biases
00556             for( int i=5; i<numUnknowns; i++ )
00557             {
00558                initialErrorCovariance(i,i) = 4.0e14;     // (20000 km)**2
00559             }
00560 
00561 
00562                // Reset Kalman filter
00563             kFilter.Reset( initialState, initialErrorCovariance );
00564 
00565                // No longer first time
00566             firstTime = false;
00567 
00568          }
00569          else
00570          {
00571 
00572                // Adapt the size to the current number of unknowns
00573             Vector<double> currentState(numUnknowns, 0.0);
00574             Matrix<double> currentErrorCov(numUnknowns, numUnknowns, 0.0);
00575 
00576 
00577                // Set first part of current state vector and covariance matrix
00578             for( int i=0; i<numVar; i++ )
00579             {
00580                currentState(i) = solution(i);
00581 
00582                   // This fills the upper left quadrant of covariance matrix
00583                for( int j=0; j<numVar; j++ )
00584                {
00585                   currentErrorCov(i,j) =  covMatrix(i,j);
00586                }
00587             }
00588 
00589 
00590                // Fill in the rest of state vector and covariance matrix
00591                // These are values that depend on satellites being processed
00592             int c1(numVar);
00593             for( SatIDSet::const_iterator itSat = satSet.begin();
00594                  itSat != satSet.end();
00595                  ++itSat )
00596             {
00597 
00598                   // Put ambiguities into state vector
00599                currentState(c1) = KalmanData[*itSat].ambiguity;
00600 
00601                   // Put ambiguities covariance values into covariance matrix
00602                   // This fills the lower right quadrant of covariance matrix
00603                int c2(numVar);
00604                SatIDSet::const_iterator itSat2;
00605                for( itSat2 = satSet.begin(); itSat2 != satSet.end(); ++itSat2 )
00606                {
00607 
00608                   currentErrorCov(c1,c2) = KalmanData[*itSat].aCovMap[*itSat2];
00609                   currentErrorCov(c2,c1) = KalmanData[*itSat].aCovMap[*itSat2];
00610 
00611                   ++c2;
00612                }
00613 
00614                   // Put variables X ambiguities covariances into
00615                   // covariance matrix. This fills the lower left and upper
00616                   // right quadrants of covariance matrix
00617                int c3(0);
00618                TypeIDSet::const_iterator itType;
00619                for( itType  = defaultEqDef.body.begin();
00620                     itType != defaultEqDef.body.end();
00621                     ++itType )
00622                {
00623 
00624                   currentErrorCov(c1,c3) = KalmanData[*itSat].vCovMap[*itType];
00625                   currentErrorCov(c3,c1) = KalmanData[*itSat].vCovMap[*itType];
00626 
00627                   ++c3;
00628                }
00629 
00630                ++c1;
00631             }
00632 
00633 
00634                // Reset Kalman filter to current state and covariance matrix
00635             kFilter.Reset( currentState, currentErrorCov );
00636 
00637          }  // End of 'if(firstTime)'
00638 
00639 
00640 
00641             // Call the Compute() method with the defined equation model.
00642             // This equation model MUST HAS BEEN previously set, usually when
00643             // creating the SolverPPP object with the appropriate
00644             // constructor.
00645          Compute( measVector,
00646                   hMatrix,
00647                   rMatrix );
00648 
00649 
00650 
00651             // Store those values of current state and covariance matrix
00652             // that depend on satellites currently in view
00653          int c1(numVar);
00654          for( SatIDSet::const_iterator itSat = satSet.begin();
00655               itSat != satSet.end();
00656               ++itSat )
00657          {
00658 
00659                // Store ambiguities
00660             KalmanData[*itSat].ambiguity = solution(c1);
00661 
00662                // Store ambiguities covariance values
00663             int c2(numVar);
00664             SatIDSet::const_iterator itSat2;
00665             for( itSat2 = satSet.begin(); itSat2 != satSet.end(); ++itSat2 )
00666             {
00667 
00668                KalmanData[*itSat].aCovMap[*itSat2] = covMatrix(c1,c2);
00669 
00670                ++c2;
00671             }
00672 
00673                // Store variables X ambiguities covariances
00674             int c3(0);
00675             TypeIDSet::const_iterator itType;
00676             for( itType  = defaultEqDef.body.begin();
00677                  itType != defaultEqDef.body.end();
00678                  ++itType )
00679             {
00680 
00681                KalmanData[*itSat].vCovMap[*itType] = covMatrix(c1,c3);
00682 
00683                ++c3;
00684             }
00685 
00686             ++c1;
00687 
00688          }  // End of 'for( itSat = satSet.begin(); ...'
00689 
00690 
00691             // Now we have to add the new values to the data structure
00692          Vector<double> postfitCode(numCurrentSV,0.0);
00693          Vector<double> postfitPhase(numCurrentSV,0.0);
00694          for( int i=0; i<numCurrentSV; i++ )
00695          {
00696             postfitCode(i)  = postfitResiduals( i                );
00697             postfitPhase(i) = postfitResiduals( i + numCurrentSV );
00698          }
00699 
00700          gData.insertTypeIDVector(TypeID::postfitC, postfitCode);
00701          gData.insertTypeIDVector(TypeID::postfitL, postfitPhase);
00702 
00703             // Update set of satellites to be used in next epoch
00704          satSet = currSatSet;
00705 
00706          return gData;
00707 
00708       }
00709       catch(Exception& u)
00710       {
00711             // Throw an exception if something unexpected happens
00712          ProcessingException e( getClassName() + ":"
00713                                 + StringUtils::asString( getIndex() ) + ":"
00714                                 + u.what() );
00715 
00716          GPSTK_THROW(e);
00717 
00718       }
00719 
00720    }  // End of method 'SolverPPP::Process()'
00721 
00722 
00723 
00724       /* Sets if a NEU system will be used.
00725        *
00726        * @param useNEU  Boolean value indicating if a NEU system will
00727        *                be used
00728        *
00729        */
00730    SolverPPP& SolverPPP::setNEU( bool useNEU )
00731    {
00732 
00733          // First, let's define a set with the typical code-based unknowns
00734       TypeIDSet tempSet;
00735          // Watch out here: 'tempSet' is a 'std::set', and all sets order their
00736          // elements. According to 'TypeID' class, this is the proper order:
00737       tempSet.insert(TypeID::wetMap);  // BEWARE: The first is wetMap!!!
00738 
00739       if (useNEU)
00740       {
00741          tempSet.insert(TypeID::dLat); // #2
00742          tempSet.insert(TypeID::dLon); // #3
00743          tempSet.insert(TypeID::dH);   // #4
00744       }
00745       else
00746       {
00747          tempSet.insert(TypeID::dx);   // #2
00748          tempSet.insert(TypeID::dy);   // #3
00749          tempSet.insert(TypeID::dz);   // #4
00750       }
00751       tempSet.insert(TypeID::cdt);     // #5
00752 
00753          // Now, we build the basic equation definition
00754       defaultEqDef.header = TypeID::prefitC;
00755       defaultEqDef.body = tempSet;
00756 
00757       return (*this);
00758 
00759    }  // End of method 'SolverPPP::setNEU()'
00760 
00761 
00762 
00763       /* Set a single coordinates stochastic model to ALL coordinates.
00764        *
00765        * @param pModel      Pointer to StochasticModel associated with
00766        *                    coordinates.
00767        *
00768        * @warning Do NOT use this method to set the SAME state-aware
00769        * stochastic model (like RandomWalkModel, for instance) to ALL
00770        * coordinates, because the results will certainly be erroneous. Use
00771        * this method only with non-state-aware stochastic models like
00772        * 'StochasticModel' (constant coordinates) or 'WhiteNoiseModel'.
00773        */
00774    SolverPPP& SolverPPP::setCoordinatesModel( StochasticModel* pModel )
00775    {
00776 
00777          // All coordinates will have the same model
00778       pCoordXStoModel = pModel;
00779       pCoordYStoModel = pModel;
00780       pCoordZStoModel = pModel;
00781 
00782       return (*this);
00783 
00784    }  // End of method 'SolverPPP::setCoordinatesModel()'
00785 
00786 
00787    
00790    SolverPPP& SolverPPP::setKinematic( bool kinematicMode,
00791                                        double sigmaX,
00792                                        double sigmaY,
00793                                        double sigmaZ )
00794    {
00795       if(kinematicMode)
00796       {
00797          whitenoiseModelX.setSigma(sigmaX);
00798          whitenoiseModelY.setSigma(sigmaY);
00799          whitenoiseModelZ.setSigma(sigmaZ);
00800 
00801          setXCoordinatesModel(&whitenoiseModelX);
00802          setYCoordinatesModel(&whitenoiseModelY);
00803          setZCoordinatesModel(&whitenoiseModelZ);
00804       }
00805       else
00806       {
00807          setCoordinatesModel(&constantModel);
00808       }
00809 
00810       return (*this);
00811 
00812    }  // End of method 'SolverPPP::setKinematic()'
00813 
00814 
00815 }  // End of namespace gpstk

Generated on Tue May 22 03:31:01 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1