Changeset 6405 in ntrip for trunk/BNC/src
- Timestamp:
- Dec 22, 2014, 6:09:12 PM (10 years ago)
- Location:
- trunk/BNC/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/bncantex.cpp
r6041 r6405 71 71 //////////////////////////////////////////////////////////////////////////// 72 72 void bncAntex::print() const { 73 QMapIterator<QString, t_antMap*> it (_maps);74 while (it .hasNext()) {75 it .next();76 t_antMap* map = it .value();73 QMapIterator<QString, t_antMap*> itAnt(_maps); 74 while (itAnt.hasNext()) { 75 itAnt.next(); 76 t_antMap* map = itAnt.value(); 77 77 cout << map->antName.toAscii().data() << endl; 78 78 cout << " " << map->zen1 << " " << map->zen2 << " " << map->dZen << endl; 79 if (map->frqMapL1) { 80 cout << " " << map->frqMapL1->neu[0] << " " 81 << map->frqMapL1->neu[1] << " " 82 << map->frqMapL1->neu[2] << endl; 83 cout << " " << map->frqMapL1->pattern.t(); 84 } 85 if (map->frqMapL2) { 86 cout << " " << map->frqMapL2->neu[0] << " " 87 << map->frqMapL2->neu[1] << " " 88 << map->frqMapL2->neu[2] << endl; 89 cout << " " << map->frqMapL2->pattern.t(); 79 QMapIterator<t_frequency::type, t_frqMap*> itFrq(map->frqMap); 80 while (itFrq.hasNext()) { 81 itFrq.next(); 82 const t_frqMap* frqMap = itFrq.value(); 83 cout << " " << frqMap->neu[0] << " " 84 << frqMap->neu[1] << " " 85 << frqMap->neu[2] << endl; 86 cout << " " << frqMap->pattern.t(); 90 87 } 91 88 cout << endl; … … 171 168 else if (line.indexOf("END OF FREQUENCY") == 60) { 172 169 if (newFrqMap) { 173 if (line.indexOf("G01") == 3 || line.indexOf("R01") == 3) { 174 delete newAntMap->frqMapL1; 175 newAntMap->frqMapL1 = newFrqMap; 176 } 177 else if (line.indexOf("G02") == 3 || line.indexOf("R02") == 3) { 178 delete newAntMap->frqMapL2; 179 newAntMap->frqMapL2 = newFrqMap; 170 t_frequency::type frqType = t_frequency::dummy; 171 if (line.indexOf("G01") == 3) { 172 frqType = t_frequency::G1; 173 } 174 else if (line.indexOf("G02") == 3) { 175 frqType = t_frequency::G2; 176 } 177 else if (line.indexOf("R01") == 3) { 178 frqType = t_frequency::R1; 179 } 180 else if (line.indexOf("R02") == 3) { 181 frqType = t_frequency::R2; 182 } 183 if (frqType != t_frequency::dummy) { 184 if (newAntMap->frqMap.find(frqType) != newAntMap->frqMap.end()) { 185 delete newAntMap->frqMap[frqType]; 186 } 187 newAntMap->frqMap[frqType] = newFrqMap; 180 188 } 181 189 else { … … 226 234 const ColumnVector& xSat, ColumnVector& dx) { 227 235 236 t_frequency::type frqType = t_frequency::dummy; 237 if (prn[0] == 'G') { 238 frqType = t_frequency::G1; 239 } 240 else if (prn[0] == 'R') { 241 frqType = t_frequency::R1; 242 } 243 228 244 QMap<QString, t_antMap*>::const_iterator it = _maps.find(prn); 229 245 if (it != _maps.end()) { 230 246 t_antMap* map = it.value(); 231 double* neu = map->frqMapL1->neu; 232 233 // Unit Vectors sz, sy, sx 234 // ----------------------- 235 ColumnVector sz = -xSat; 236 sz /= sqrt(DotProduct(sz,sz)); 237 238 ColumnVector xSun = BNC_PPP::t_astro::Sun(Mjd); 239 xSun /= sqrt(DotProduct(xSun,xSun)); 247 if (map->frqMap.find(frqType) != map->frqMap.end()) { 248 249 double* neu = map->frqMap[frqType]->neu; 250 251 // Unit Vectors sz, sy, sx 252 // ----------------------- 253 ColumnVector sz = -xSat; 254 sz /= sqrt(DotProduct(sz,sz)); 255 256 ColumnVector xSun = BNC_PPP::t_astro::Sun(Mjd); 257 xSun /= sqrt(DotProduct(xSun,xSun)); 240 258 241 ColumnVector sy = crossproduct(sz, xSun);242 sy /= sqrt(DotProduct(sy,sy));259 ColumnVector sy = crossproduct(sz, xSun); 260 sy /= sqrt(DotProduct(sy,sy)); 243 261 244 ColumnVector sx = crossproduct(sy, sz); 245 246 dx[0] = sx[0] * neu[0] + sy[0] * neu[1] + sz[0] * neu[2]; 247 dx[1] = sx[1] * neu[0] + sy[1] * neu[1] + sz[1] * neu[2]; 248 dx[2] = sx[2] * neu[0] + sy[2] * neu[1] + sz[2] * neu[2]; 249 250 return success; 251 } 252 else { 253 return failure; 254 } 255 } 256 257 // Phase Center Offset (Receiver Antenna and GPS only) 258 //////////////////////////////////////////////////////////////////////////// 259 double bncAntex::pco(const QString& antName, double eleSat, bool& found) const { 260 261 static const double f1 = t_CST::freq(t_frequency::G1, 0); 262 static const double f2 = t_CST::freq(t_frequency::G2, 0); 263 static const double c1 = f1 * f1 / (f1 * f1 - f2 * f2); 264 static const double c2 = - f2 * f2 / (f1 * f1 - f2 * f2); 265 266 QMap<QString, t_antMap*>::const_iterator it = _maps.find(antName); 267 if (it != _maps.end()) { 262 ColumnVector sx = crossproduct(sy, sz); 263 264 dx[0] = sx[0] * neu[0] + sy[0] * neu[1] + sz[0] * neu[2]; 265 dx[1] = sx[1] * neu[0] + sy[1] * neu[1] + sz[1] * neu[2]; 266 dx[2] = sx[2] * neu[0] + sy[2] * neu[1] + sz[2] * neu[2]; 267 268 return success; 269 } 270 } 271 272 return failure; 273 } 274 275 // 276 //////////////////////////////////////////////////////////////////////////// 277 double bncAntex::rcvCorr(const string& antName, t_frequency::type frqType, 278 double eleSat, double /* azSat */, bool& found) const { 279 280 if (antName.find("NULLANTENNA") != string::npos) { 268 281 found = true; 269 t_antMap* map = it.value(); 270 if (map->frqMapL1 && map->frqMapL2) { 271 double corr1 = -map->frqMapL1->neu[2] * sin(eleSat); 272 double corr2 = -map->frqMapL2->neu[2] * sin(eleSat); 273 return c1 * corr1 + c2 * corr2; 274 } 275 } 276 else { 282 return 0.0; 283 } 284 285 QString antNameQ = antName.c_str(); 286 287 if (_maps.find(antNameQ) == _maps.end()) { 277 288 found = false; 278 } 279 280 return 0.0; 281 } 282 283 // 284 //////////////////////////////////////////////////////////////////////////// 285 double bncAntex::rcvCorr(const std::string& antName, double eleSat, bool& found) const { 286 return pco(QString(antName.c_str()), eleSat, found); 287 } 289 return 0.0; 290 } 291 292 t_antMap* map = _maps[antNameQ]; 293 294 if (map->frqMap.find(frqType) == map->frqMap.end()) { 295 found = false; 296 return 0.0; 297 } 298 299 t_frqMap* frqMap = map->frqMap[frqType]; 300 301 double var = 0.0; 302 if (frqMap->pattern.ncols() > 0) { 303 double zenDiff = 999.999; 304 double zenSat = 90.0 - eleSat * 180.0 / M_PI; 305 unsigned iZen = 0; 306 for (double zen = map->zen1; zen <= map->zen2; zen += map->dZen) { 307 iZen += 1; 308 double newZenDiff = fabs(zen - zenSat); 309 if (newZenDiff < zenDiff) { 310 zenDiff = newZenDiff; 311 var = frqMap->pattern(iZen); 312 } 313 } 314 } 315 316 found = true; 317 return var - frqMap->neu[2] * sin(eleSat); 318 } -
trunk/BNC/src/bncantex.h
r6015 r6405 37 37 bncAntex(); 38 38 ~bncAntex(); 39 t_irc readFile(const QString& fileName);40 void print() const;41 double pco(const QString& antName, double eleSat, bool& found) const;42 double rcvCorr(const std::string& antName, double eleSat, bool& found) const;39 t_irc readFile(const QString& fileName); 40 void print() const; 41 double rcvCorr(const std::string& antName, t_frequency::type frqType, 42 double eleSat, double azSat, bool& found) const; 43 43 t_irc satCoMcorrection(const QString& prn, double Mjd, 44 44 const ColumnVector& xSat, ColumnVector& dx); 45 45 46 46 private: 47 48 47 class t_frqMap { 49 48 public: … … 54 53 class t_antMap { 55 54 public: 56 t_antMap() { 57 frqMapL1 = 0; 58 frqMapL2 = 0; 55 t_antMap() {} 56 ~t_antMap() { 57 QMapIterator<t_frequency::type, t_frqMap*> it(frqMap); 58 while (it.hasNext()) { 59 it.next(); 60 delete it.value(); 61 } 59 62 } 60 ~t_antMap() { 61 delete frqMapL1; 62 delete frqMapL2; 63 } 64 QString antName; 65 double zen1; 66 double zen2; 67 double dZen; 68 t_frqMap* frqMapL1; 69 t_frqMap* frqMapL2; 70 bncTime validFrom; 71 bncTime validTo; 63 QString antName; 64 double zen1; 65 double zen2; 66 double dZen; 67 QMap<t_frequency::type, t_frqMap*> frqMap; 68 bncTime validFrom; 69 bncTime validTo; 72 70 }; 73 71 -
trunk/BNC/src/bncconst.h
r6319 r6405 38 38 E8, // E5(E5a+E5b) / 1191.795 39 39 E6, // E6 / 1278.75 40 41 42 43 44 45 46 47 48 40 J1, // 1575.42 41 J2, // 1227.60 42 J5, // 1176.45 43 J6, // Lex(6) 1278.75 44 S1, // 1575.42 45 S5, // 1176.45 46 C1, // 1561.098 47 C7, // 1207.14 48 C6, // 1268.52 49 49 max}; 50 50
Note:
See TracChangeset
for help on using the changeset viewer.