00001 #pragma ident "$Id: ComputeMelbourneWubbena.cpp 1325 2008-07-29 14:33:43Z architest $"
00002
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #include "ComputeMelbourneWubbena.hpp"
00033
00034
00035 namespace gpstk
00036 {
00037
00038
00039 int ComputeMelbourneWubbena::classIndex = 2200000;
00040
00041
00042
00043 int ComputeMelbourneWubbena::getIndex() const
00044 { return index; }
00045
00046
00047
00048 std::string ComputeMelbourneWubbena::getClassName() const
00049 { return "ComputeMelbourneWubbena"; }
00050
00051
00052
00053 ComputeMelbourneWubbena::ComputeMelbourneWubbena()
00054 : type3(TypeID::L1), type4(TypeID::L2), DEN1(L1_FREQ + L2_FREQ),
00055 DEN2(L1_FREQ - L2_FREQ)
00056 {
00057 type1 = TypeID::P1;
00058 type2 = TypeID::P2;
00059 resultType = TypeID::MWubbena;
00060 setIndex();
00061 }
00062
00063
00064
00065
00066
00067
00068
00069 satTypeValueMap& ComputeMelbourneWubbena::Process(satTypeValueMap& gData)
00070 throw(ProcessingException)
00071 {
00072
00073 try
00074 {
00075
00076 double value1(0.0);
00077 double value2(0.0);
00078 double value3(0.0);
00079 double value4(0.0);
00080
00081 SatIDSet satRejectedSet;
00082
00083
00084 satTypeValueMap::iterator it;
00085 for (it = gData.begin(); it != gData.end(); ++it)
00086 {
00087 try
00088 {
00089
00090 value1 = (*it).second(type1);
00091 value2 = (*it).second(type2);
00092 value3 = (*it).second(type3);
00093 value4 = (*it).second(type4);
00094 }
00095 catch(...)
00096 {
00097
00098
00099 satRejectedSet.insert( (*it).first );
00100 continue;
00101 }
00102
00103
00104
00105 (*it).second[resultType] = getCombination( value1,
00106 value2,
00107 value3,
00108 value4 );
00109 }
00110
00111
00112 gData.removeSatID(satRejectedSet);
00113
00114 return gData;
00115
00116 }
00117 catch(Exception& u)
00118 {
00119
00120 ProcessingException e( getClassName() + ":"
00121 + StringUtils::asString( getIndex() ) + ":"
00122 + u.what() );
00123
00124 GPSTK_THROW(e);
00125
00126 }
00127
00128 }
00129
00130
00131
00132
00133 double ComputeMelbourneWubbena::getCombination( const double& p1,
00134 const double& p2,
00135 const double& l1,
00136 const double& l2 )
00137 {
00138
00139 return ( ( L1_FREQ*l1 - L2_FREQ*l2 ) / ( DEN2 )
00140 - ( L1_FREQ*p1 + L2_FREQ*p2 ) / ( DEN1 ) );
00141
00142 }
00143
00144
00145
00146 }