00001 #pragma ident "$Id: $"
00002
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #include "ComputeSimpleWeights.hpp"
00034
00035
00036 namespace gpstk
00037 {
00038
00039
00040 int ComputeSimpleWeights::classIndex = 6300000;
00041
00042
00043
00044 int ComputeSimpleWeights::getIndex() const
00045 { return index; }
00046
00047
00048
00049 std::string ComputeSimpleWeights::getClassName() const
00050 { return "ComputeSimpleWeights"; }
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060 satTypeValueMap& ComputeSimpleWeights::Process( const DayTime& time,
00061 satTypeValueMap& gData )
00062 throw(ProcessingException)
00063 {
00064
00065 try
00066 {
00067
00068
00069
00070
00071 double scaleFact( 1.509551839 );
00072
00073
00074 double tropoVar( 0.0004 );
00075 double multiVar( 0.000025 );
00076
00077
00078 NBTropModel tropoObj(0.0, 0.0, 1);
00079
00080 SatIDSet satRejectedSet;
00081
00082
00083
00084 for( satTypeValueMap::iterator it = gData.begin();
00085 it != gData.end();
00086 ++it )
00087 {
00088
00089 double elevP( 0.0 );
00090
00091 try
00092 {
00093 elevP = gData.getValue( (*it).first, TypeID::elevation );
00094 }
00095 catch(...)
00096 {
00097
00098
00099
00100 satRejectedSet.insert( (*it).first );
00101
00102 continue;
00103
00104 }
00105
00106
00107
00108 double mt( tropoObj.dry_mapping_function(elevP) );
00109
00110 double weight( 1.0 / ( scaleFact*( mt*mt*tropoVar + multiVar ) ) );
00111
00112 (*it).second[TypeID::weight] = weight;
00113
00114 }
00115
00116
00117 gData.removeSatID(satRejectedSet);
00118
00119 return gData;
00120
00121 }
00122 catch(Exception& u)
00123 {
00124
00125 ProcessingException e( getClassName() + ":"
00126 + StringUtils::asString( getIndex() ) + ":"
00127 + u.what() );
00128
00129 GPSTK_THROW(e);
00130
00131 }
00132
00133 }
00134
00135
00136
00137
00138
00139
00140
00141
00142 gnssSatTypeValue& ComputeSimpleWeights::Process(gnssSatTypeValue& gData)
00143 throw(ProcessingException)
00144 {
00145
00146 try
00147 {
00148
00149 Process(gData.header.epoch, gData.body);
00150
00151 return gData;
00152
00153 }
00154 catch(Exception& u)
00155 {
00156
00157 ProcessingException e( getClassName() + ":"
00158 + StringUtils::asString( getIndex() ) + ":"
00159 + u.what() );
00160
00161 GPSTK_THROW(e);
00162
00163 }
00164
00165 }
00166
00167
00168
00169
00170
00171
00172
00173
00174 gnssRinex& ComputeSimpleWeights::Process(gnssRinex& gData)
00175 throw(ProcessingException)
00176 {
00177
00178 try
00179 {
00180
00181 Process(gData.header.epoch, gData.body);
00182
00183 return gData;
00184
00185 }
00186 catch(Exception& u)
00187 {
00188
00189 ProcessingException e( getClassName() + ":"
00190 + StringUtils::asString( getIndex() ) + ":"
00191 + u.what() );
00192
00193 GPSTK_THROW(e);
00194
00195 }
00196
00197 }
00198
00199
00200 }