RefFrame.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 // This software was developed by Applied Research Laboratories at the
28 // University of Texas at Austin, under contract to an agency or agencies
29 // within the U.S. Department of Defense. The U.S. Government retains all
30 // rights to use, duplicate, distribute, disclose, or release this software.
31 //
32 // Pursuant to DoD Directive 523024
33 //
34 // DISTRIBUTION STATEMENT A: This software has been approved for public
35 // release, distribution is unlimited.
36 //
37 //==============================================================================
38 
39 #include "RefFrame.hpp"
40 #include "StringUtils.hpp"
41 
42 namespace gnsstk
43 {
46  : system(RefFrameSys::Unknown),
47  realization(RefFrameRlz::Unknown)
48  {
49  }
50 
51 
54  : realization(rlz),
55  system(getRefFrameSys(rlz))
56  {
57  }
58 
59 
62  : system(sys),
63  realization(getRefFrameRlz(sys,when))
64  {
65  }
66 
67 
69  RefFrame(const std::string& str, const gnsstk::CommonTime& when)
70  {
73  {
75  }
76  else
77  {
78  // try again but treat str as a system rather than a realization
81  }
82  }
83 
84 
85  bool RefFrame ::
86  operator<(const RefFrame& right) const noexcept
87  {
88  if (system < right.system) return true;
89  if (right.system < system) return false;
90  if (realization < right.realization) return true;
91  return false;
92  }
93 
94 
95  bool RefFrame ::
96  operator==(ReferenceFrame orf) const noexcept
97  {
98  // Only compare the reference frame SYSTEMS because that's
99  // how it's being used in HelmertTransform.
100  return (((orf == ReferenceFrame::Unknown) &&
101  (system == RefFrameSys::Unknown)) ||
102  ((orf == ReferenceFrame::WGS84) &&
103  (system == RefFrameSys::WGS84)) ||
104  ((orf == ReferenceFrame::ITRF) &&
105  (system == RefFrameSys::ITRF)) ||
106  ((orf == ReferenceFrame::PZ90) &&
107  (system == RefFrameSys::PZ90)) ||
108  ((orf == ReferenceFrame::CGCS2000) &&
109  (system == RefFrameSys::CGCS2000)));
110  }
111 
112 
115  {
116  switch (orf)
117  {
119  *this = RefFrame(RefFrameSys::WGS84, when);
120  break;
123  break;
126  break;
129  break;
132  break;
135  break;
137  *this = RefFrame(RefFrameSys::ITRF, when);
138  break;
140  *this = RefFrame(RefFrameRlz::ITRF94);
141  break;
143  *this = RefFrame(RefFrameRlz::ITRF96);
144  break;
146  *this = RefFrame(RefFrameRlz::ITRF97);
147  break;
150  break;
153  break;
156  break;
159  break;
161  *this = RefFrame(RefFrameSys::PZ90, when);
162  break;
165  break;
167  *this = RefFrame(RefFrameSys::CGCS2000, when);
168  break;
169  default:
170  {
171  InvalidParameter exc("Invalid ReferenceFrame " +
172  StringUtils::asString((int)orf));
173  GNSSTK_THROW(exc);
174  break;
175  }
176  }
177  }
178 } // namespace gnsstk
gnsstk::RefFrameRlz::ITRF2008
@ ITRF2008
ITRF, 2008 version.
gnsstk::ReferenceFrame
ReferenceFrame
Definition: ReferenceFrame.hpp:52
gnsstk::RefFrameRlz::WGS84G1762
@ WGS84G1762
WGS84, GPS week 1762 version.
gnsstk::RefFrameSys::PZ90
@ PZ90
The reference frame used by Glonass.
gnsstk::ReferenceFrame::WGS84G1674
@ WGS84G1674
WGS84, GPS week 1674 version.
gnsstk::RefFrame::operator==
bool operator==(const RefFrame &right) const noexcept
Compare this with right.
Definition: RefFrame.hpp:84
gnsstk::StringUtils::asRefFrameRlz
RefFrameRlz asRefFrameRlz(const std::string &s) noexcept
Convert a string name to an RefFrameRlz.
Definition: RefFrameRlz.cpp:210
gnsstk::RefFrameRlz::ITRF2014
@ ITRF2014
ITRF, 2014 version.
gnsstk::RefFrameSys::ITRF
@ ITRF
The reference frame used by Galileo.
StringUtils.hpp
gnsstk::ReferenceFrame::Unknown
@ Unknown
unknown frame
gnsstk::RefFrameRlz::WGS84G873
@ WGS84G873
WGS84, GPS week 873 version.
gnsstk::RefFrame::RefFrame
RefFrame()
Set both system and realization to Unknown.
Definition: RefFrame.cpp:45
gnsstk::RefFrame::realization
RefFrameRlz realization
The reference frame realization this object represents.
Definition: RefFrame.hpp:110
gnsstk::RefFrameRlz::ITRF96
@ ITRF96
ITRF, 1996 version.
gnsstk::ReferenceFrame::WGS84G1762
@ WGS84G1762
WGS84, GPS week 1762 version.
gnsstk::ReferenceFrame::ITRF94
@ ITRF94
ITRF, 1994 version.
gnsstk::RefFrameRlz::ITRF2005
@ ITRF2005
ITRF, 2005 version.
gnsstk::StringUtils::asString
std::string asString(IonexStoreStrategy e)
Convert a IonexStoreStrategy to a whitespace-free string name.
Definition: IonexStoreStrategy.cpp:46
gnsstk::RefFrameSys::Unknown
@ Unknown
Unknown system or uninitialized value.
gnsstk::RefFrameRlz
RefFrameRlz
Reference frame realizations. For general systems, see RefFrameSys.
Definition: RefFrameRlz.hpp:51
gnsstk::RefFrame::operator<
bool operator<(const RefFrame &right) const noexcept
Ordering for maps etc.
Definition: RefFrame.cpp:86
gnsstk::RefFrame
Definition: RefFrame.hpp:53
gnsstk::RefFrameRlz::ITRF97
@ ITRF97
ITRF, 1997 version.
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::IonexStoreStrategy::Unknown
@ Unknown
Unknown or uninitialized stategy value.
gnsstk::ReferenceFrame::ITRF2008
@ ITRF2008
ITRF, 2008 version.
gnsstk::ReferenceFrame::WGS84G730
@ WGS84G730
WGS84, GPS week 730 version.
RefFrame.hpp
gnsstk::RefFrameRlz::Unknown
@ Unknown
Unknown system or uninitialized value.
gnsstk::ReferenceFrame::ITRF2000
@ ITRF2000
ITRF, 2000 version.
gnsstk::CommonTime
Definition: CommonTime.hpp:84
gnsstk::ReferenceFrame::ITRF2014
@ ITRF2014
ITRF, 2014 version.
gnsstk::ReferenceFrame::WGS84
@ WGS84
WGS84, assumed to be the latest version.
gnsstk::RefFrameRlz::WGS84G1674
@ WGS84G1674
WGS84, GPS week 1674 version.
gnsstk::RefFrameSys::WGS84
@ WGS84
The reference frame used by GPS.
gnsstk::ReferenceFrame::ITRF
@ ITRF
ITRF, assumed to be the latest version.
gnsstk::RefFrameSys
RefFrameSys
Reference frame systems. For specific realizations, see RefFrameRlz.
Definition: RefFrameSys.hpp:51
gnsstk::ReferenceFrame::WGS84G1150
@ WGS84G1150
WGS84, GPS week 1150 version.
gnsstk::ReferenceFrame::PZ90KGS
@ PZ90KGS
PZ90 the "original".
gnsstk::RefFrameRlz::WGS84G730
@ WGS84G730
WGS84, GPS week 730 version.
gnsstk::ReferenceFrame::ITRF97
@ ITRF97
ITRF, 1997 version.
gnsstk::RefFrameRlz::WGS84G1150
@ WGS84G1150
WGS84, GPS week 1150 version.
gnsstk::ReferenceFrame::PZ90
@ PZ90
PZ90 (GLONASS)
gnsstk::ReferenceFrame::ITRF96
@ ITRF96
ITRF, 1996 version.
gnsstk::RefFrameRlz::PZ90KGS
@ PZ90KGS
PZ90 the "original".
gnsstk::RefFrameSys::CGCS2000
@ CGCS2000
The reference frame used by BeiDou.
gnsstk::getRefFrameSys
RefFrameSys getRefFrameSys(RefFrameRlz rlz) noexcept
Definition: RefFrameRlz.cpp:48
gnsstk::RefFrameRlz::ITRF94
@ ITRF94
ITRF, 1994 version.
GNSSTK_THROW
#define GNSSTK_THROW(exc)
Definition: Exception.hpp:366
gnsstk::StringUtils::asRefFrameSys
RefFrameSys asRefFrameSys(const std::string &s) noexcept
Convert a string name to an RefFrameSys.
Definition: RefFrameSys.cpp:62
gnsstk::ReferenceFrame::CGCS2000
@ CGCS2000
CGCS200 (BDS)
gnsstk::ReferenceFrame::ITRF2005
@ ITRF2005
ITRF, 2005 version.
gnsstk::getRefFrameRlz
RefFrameRlz getRefFrameRlz(RefFrameSys sys, const CommonTime &when)
Definition: RefFrameRlz.cpp:77
gnsstk::RefFrameRlz::ITRF2000
@ ITRF2000
ITRF, 2000 version.
gnsstk::RefFrame::system
RefFrameSys system
The reference frame system this object represents.
Definition: RefFrame.hpp:108
gnsstk::ReferenceFrame::WGS84G873
@ WGS84G873
WGS84, GPS week 873 version.


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