RinexObsID_custom_example.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 
46 #include <iostream>
47 #include <string>
48 #include <map>
49 #include <set>
50 
51 #include "ObsID.hpp"
52 #include "RinexObsID.hpp"
53 #include "Exception.hpp"
54 #include "Rinex3ObsHeader.hpp"
55 
56 
57 int main(int argc, char *argv[])
58 {
59  using namespace gnsstk;
60  using namespace std;
61 
62  map< RinexObsID, string> i2s;
63 
64  // abbreviate.
66  i2s[RinexObsID("C1C", cv)] = "C1C";
67  i2s[RinexObsID("L1C", cv)] = "L1C";
68  i2s[RinexObsID("D1C", cv)] = "D1C";
69  i2s[RinexObsID("S1C", cv)] = "S1C";
70  i2s[RinexObsID("L1W", cv)] = "L1W";
71  i2s[RinexObsID("D2Z", cv)] = "D2Z";
72  i2s[RinexObsID("S1X", cv)] = "S1X";
73  i2s[RinexObsID("L5Q", cv)] = "L5Q";
74  i2s[RinexObsID("EL5Q", cv)] = "EL5Q";
75  i2s[RinexObsID("EC1C", cv)] = "EC1C";
76  // Note that you can just start using custom id's
77  i2s[RinexObsID("C4x", cv)] = "C4x";
78  i2s[RinexObsID("C4y", cv)] = "C4y";
79 
80  // You can also explicitly create one so it can have a good description
81  RinexObsID dfif = RinexObsID::newID("C3 ", "Ionosphere-free pseudorange");
82  i2s[dfif] = "C3 ";
83 
84  // You can also fix up the descriptions manually
85  RinexObsID C4y("C4y", cv);
86  ObsID::tcDesc[C4y.code] = "y";
87  ObsID::cbDesc[C4y.band] = "L4";
88 
90  i2s[l1lc] = "cust";
91 
92  i2s[RinexObsID("C1 ", cv)] = "C1 ";
93 
94  try
95  {
96  RinexObsID garbage = RinexObsID::newID("C1C", "this should fail");
97  cerr << "Error:" << StringUtils::asString(garbage) << " didn't fail "
98  << garbage << endl;
99  }
100  catch (Exception& e)
101  {
102  cerr << e << endl;
103  }
104 
105  // Dump the map of obs ids
106  cout << "Rinex Ctor Description" << endl;
107  for (const auto& i : i2s)
108  {
109  cout << left << setw(7) << RinexObsID(i.first).asString()
110  << " " << setw(7) << i.second
111  << " " << i.first << endl;
112  }
113  return 0;
114 }
gnsstk::ObservationType::TrackLen
@ TrackLen
Number of continuous epochs of 'good' tracking.
gnsstk::RinexObsID::asString
std::string asString() const
Definition: RinexObsID.hpp:190
gnsstk::TrackingCode::Y
@ Y
Encrypted legacy GPS precise code.
gnsstk::ObsID::tcDesc
static GNSSTK_EXPORT std::map< TrackingCode, std::string > tcDesc
These strings are for forming a somewhat verbose description.
Definition: ObsID.hpp:216
gnsstk::StringUtils::asString
std::string asString(IonexStoreStrategy e)
Convert a IonexStoreStrategy to a whitespace-free string name.
Definition: IonexStoreStrategy.cpp:46
gnsstk::ObsID::band
CarrierBand band
Definition: ObsID.hpp:200
gnsstk::Rinex3ObsBase::currentVersion
static const GNSSTK_EXPORT double currentVersion
Definition: Rinex3ObsBase.hpp:72
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::Exception
Definition: Exception.hpp:151
RinexObsID.hpp
Rinex3ObsHeader.hpp
gnsstk::ObsID::code
TrackingCode code
Definition: ObsID.hpp:201
gnsstk::CarrierBand::L1
@ L1
GPS L1, Galileo E1, SBAS L1, QZSS L1, BeiDou L1.
gnsstk::RinexObsID
Definition: RinexObsID.hpp:102
ObsID.hpp
Exception.hpp
std
Definition: Angle.hpp:142
gnsstk::RinexObsID::newID
static RinexObsID newID(const std::string &id, const std::string &desc="")
Definition: RinexObsID.cpp:380
gnsstk::ObsID::cbDesc
static GNSSTK_EXPORT std::map< CarrierBand, std::string > cbDesc
Definition: ObsID.hpp:217
main
int main(int argc, char *argv[])
Definition: RinexObsID_custom_example.cpp:57


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