⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 doubledifference.cpp

📁 gpstk1.5的有关内容 对于刚刚接触gps有一定的帮助 很有用的啊
💻 CPP
📖 第 1 页 / 共 2 页
字号:
#pragma ident "$Id: DoubleDifference.cpp 185 2006-10-05 18:21:39Z btolman $"//============================================================================////  This file is part of GPSTk, the GPS Toolkit.////  The GPSTk is free software; you can redistribute it and/or modify//  it under the terms of the GNU Lesser General Public License as published//  by the Free Software Foundation; either version 2.1 of the License, or//  any later version.////  The GPSTk is distributed in the hope that it will be useful,//  but WITHOUT ANY WARRANTY; without even the implied warranty of//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the//  GNU Lesser General Public License for more details.////  You should have received a copy of the GNU Lesser General Public//  License along with GPSTk; if not, write to the Free Software Foundation,//  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA//  //  Copyright 2004, The University of Texas at Austin////============================================================================//============================================================================////This software developed by Applied Research Laboratories at the University of//Texas at Austin, under contract to an agency or agencies within the U.S. //Department of Defense. The U.S. Government retains all rights to use,//duplicate, distribute, disclose, or release this software. ////Pursuant to DoD Directive 523024 //// DISTRIBUTION STATEMENT A: This software has been approved for public //                           release, distribution is unlimited.////=============================================================================/** * @file DoubleDifference.cpp * Form double differences and buffer them, for program DDBase. *///------------------------------------------------------------------------------------// TD DoubleDifference.cpp make small limit on DD buff size an input parameter// TD DoubleDifference.cpp do we allow 'gaps' in ref sat's data?//------------------------------------------------------------------------------------// system includes// GPSTk// DDBase#include "DDBase.hpp"//------------------------------------------------------------------------------------using namespace std;using namespace gpstk;//------------------------------------------------------------------------------------// prototypes -- this module onlyvoid ComputeSingleDifferences(string baseline, map<SDid,RawData>& SDmap);int ComputeDoubleDifferences(map<SDid,RawData>& SDmap);//int OutputDDData(void);                      // DataIO.cpp//------------------------------------------------------------------------------------// other prototypesbool ElevationMask(double elevation, double azimuth);       // ElevationMask.cpp//------------------------------------------------------------------------------------int DoubleDifference(void){try {   int n,i,j,k;      // map to hold all buffered single differences for one baseline   map<SDid,RawData> SDmap;   if(CI.Verbose) oflog << "BEGIN DoubleDifference()" << endl;      // clear any existing DDs   DDDataMap.clear();      // loop over baselines   for(n=0; n<Baselines.size(); n++) {         // ----------------------------------------------------------         // for this baseline, compute all SDs, then DDs, and buffer them      if(CI.Verbose) oflog << "DoubleDifference() for baseline "         << Baselines[n] << endl;         // clear the SD map      SDmap.clear();         // ----------------------------------------------------------         // compute all single differences for this baseline         // give it same ordering as Baseline      ComputeSingleDifferences(Baselines[n],SDmap);         // loop over SD data, edit small ones and dump summary      if(CI.Verbose) oflog << "Single difference summary for baseline "          << Baselines[n] << endl;      vector<SDid> Remove;    // these will be small dataset to delete later      map<SDid,RawData>::const_iterator kt;      for(k=1,kt=SDmap.begin(); kt != SDmap.end(); k++,kt++) {         if(CI.Verbose) {            oflog << " " << setw(2) << k << " " << kt->first                  << " " << setw(5) << kt->second.count.size();            if(kt->second.count.size() > 0)               oflog << " " << setw(5) << kt->second.count.at(0) << " - "                     << setw(5) << kt->second.count.at(kt->second.count.size()-1);            else               oflog << "    na -    na";               // gaps - (count : number of pts)            if(kt->second.count.size() > 0) {      // gcc needs this ...               for(i=0; i<kt->second.count.size()-1; i++) {                  j = kt->second.count.at(i+1) - kt->second.count.at(i);                  if(j > 1) oflog                     << " (" << kt->second.count.at(i)+1 << ":" << j-1 << ")";               }            }         }            // ignore small datasets         if(kt->second.count.size() < 10) {   // TD make input parameter            Remove.push_back(kt->first);            if(CI.Verbose) oflog << " **Rejected";         }         if(CI.Verbose) oflog << endl;      }  // end summary loop         // delete marked SD buffers      for(i=0; i<Remove.size(); i++) SDmap.erase(Remove[i]);            // ----------------------------------------------------------         // now compute double differences - according to timetable      if(ComputeDoubleDifferences(SDmap)) return 1;   }  // end loop over baselines      // dump buffers to a file   // no - do after editing OutputDDData();   return 0;}catch(Exception& e) { GPSTK_RETHROW(e); }catch(exception& e) { Exception E("std except: "+string(e.what())); GPSTK_THROW(E); }catch(...) { Exception e("Unknown exception"); GPSTK_THROW(e); }}   // end DoubleDifference()//------------------------------------------------------------------------------------// Compute all single differences 'site1' - 'site2', using the RawDataBuffers in// Stations[site], and store the results in the given map<SDid,RawData>.void ComputeSingleDifferences(string baseline, map<SDid,RawData>& SDmap){try {   int i,j,beg,end;   GSatID sat;      // decompose the baseline   string site1=StringUtils::word(baseline,0,'-');   string site2=StringUtils::word(baseline,1,'-');      // find the beginning and ending *counts* of good data for this baseline   if(QueryTimeTable(baseline,beg,end)) {      oflog << "ERROR - baseline " << baseline         << " not found in timetable. No single differences computed." << endl;      return;   }      // find satellites in common   map<GSatID,RawData>::const_iterator it1,it2;      // loop over satellites at first site   for(it1 = Stations[site1].RawDataBuffers.begin();       it1 != Stations[site1].RawDataBuffers.end(); it1++) {      sat = it1->first;      // it1->second is RawData={ L1,L2,P1,P2,elev,az,count buffers = vector<> }         // does this sat have data at the other station?      it2 = Stations[site2].RawDataBuffers.find(sat);      if(it2 == Stations[site2].RawDataBuffers.end()) continue;    // no         // compute single differences for this satellite         // here is where you define the ordering of sites: first(1) - second(2)      SDid sdid(site1,site2,sat);      RawData sddata;         // loop over epochs, finding common data. start and stop the loop         // at times determined by the timetable, NOT by the raw data buffers.      i = j = 0;      while(i < it1->second.count.size() && j < it2->second.count.size()) {            // impose limits from timetable              if(it1->second.count[i] > end) break;         else if(it2->second.count[j] > end) break;         else if(it1->second.count[i] < beg) i++;         else if(it2->second.count[j] < beg) j++;            // i and j are the same count (epoch)         else if(it1->second.count[i] == it2->second.count[j]) {               // reject data below MinElevation here            //if(it1->second.elev[i] > CI.MinElevation &&               //it2->second.elev[j] > CI.MinElevation) {            if(ElevationMask(it1->second.elev[i],it1->second.az[i]) &&               ElevationMask(it2->second.elev[j],it2->second.az[j])) {                              // buffer the differences               sddata.count.push_back(it1->second.count[i]);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -