CorrectionResults.cpp
Go to the documentation of this file.
1 //==============================================================================
2 //
3 // This file is part of GNSSTk, the ARL:UT GNSS Toolkit.
4 //
5 // The GNSSTk is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published
7 // by the Free Software Foundation; either version 3.0 of the License, or
8 // any later version.
9 //
10 // The GNSSTk is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with GNSSTk; if not, write to the Free Software Foundation,
17 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18 //
19 // This software was developed by Applied Research Laboratories at the
20 // University of Texas at Austin.
21 // Copyright 2004-2022, The Board of Regents of The University of Texas System
22 //
23 //==============================================================================
24 
25 
26 //==============================================================================
27 //
28 // This software was developed by Applied Research Laboratories at the
29 // University of Texas at Austin, under contract to an agency or agencies
30 // within the U.S. Department of Defense. The U.S. Government retains all
31 // rights to use, duplicate, distribute, disclose, or release this software.
32 //
33 // Pursuant to DoD Directive 523024
34 //
35 // DISTRIBUTION STATEMENT A: This software has been approved for public
36 // release, distribution is unlimited.
37 //
38 //==============================================================================
39 
40 #include "CorrectionResults.hpp"
41 
42 namespace gnsstk
43 {
46  {
47  results.push_back(res);
48  }
49 
50 
52  getResults() const
53  {
54  return results;
55  }
56 
57 
60  {
61  double rv = 0.0;
62  // Collected results (intermediate stage for dealing with duplicates)
63  std::map<CorrectorType, double> coll;
64  for (const auto& res : results)
65  {
66  switch (dups)
67  {
68  // Computation is already done at this point, so treat
69  // ComputeFirst and UseFirst the same here.
72  if (coll.find(res.source->corrType) == coll.end())
73  {
74  // This is the first result of this type, so add it.
75  coll[res.source->corrType] = res.result;
76  }
77  break;
79  // Just add the result, and it will automatically
80  // end up with the last result in the map.
81  coll[res.source->corrType] = res.result;
82  break;
83  default:
84  {
85  InvalidParameter exc("Invalid CorrDupHandling value: " +
86  StringUtils::asString((int)dups));
87  GNSSTK_THROW(exc);
88  }
89  }
90  }
91  if (coll.empty())
92  {
93  // no data, so return nan.
94  return std::numeric_limits<double>::quiet_NaN();
95  }
96  for (const auto& ci : coll)
97  {
98  rv += ci.second;
99  }
100  return rv;
101  }
102 
103 
106  {
107  results.clear();
108  }
109 
110 } // namespace gnsstk
gnsstk::CorrDupHandling
CorrDupHandling
Definition: CorrDupHandling.hpp:60
gnsstk::CorrectionResults::clear
void clear()
Empty the contents of results.
Definition: CorrectionResults.cpp:105
gnsstk::StringUtils::asString
std::string asString(IonexStoreStrategy e)
Convert a IonexStoreStrategy to a whitespace-free string name.
Definition: IonexStoreStrategy.cpp:46
gnsstk::CorrDupHandling::UseFirst
@ UseFirst
Sum includes first valid correction of type, all computed.
gnsstk::CorrectionResults::getCorrSum
double getCorrSum(CorrDupHandling dups) const
Definition: CorrectionResults.cpp:59
gnsstk::CorrectionResult
Definition: CorrectionResult.hpp:55
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::CorrDupHandling::ComputeLast
@ ComputeLast
Sum includes last valid correction of a type.
gnsstk::CorrDupHandling::ComputeFirst
@ ComputeFirst
Sum includes first valid correction, no duplication.
gnsstk::CorrectionResults::getResults
const CorrectionResultList & getResults() const
Get the ordered list of results.
Definition: CorrectionResults.cpp:52
gnsstk::CorrectionResults::addResult
void addResult(const CorrectionResult &res)
Definition: CorrectionResults.cpp:45
gnsstk::CorrectionResults::results
CorrectionResultList results
The computed biases.
Definition: CorrectionResults.hpp:78
CorrectionResults.hpp
GNSSTK_THROW
#define GNSSTK_THROW(exc)
Definition: Exception.hpp:366
gnsstk::CorrectionResultList
std::list< CorrectionResult > CorrectionResultList
Just an ordered list of group path correction results.
Definition: CorrectionResult.hpp:73


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:38