SatMetaData.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 "SatMetaData.hpp"
40 #include "TimeString.hpp"
41 
42 namespace gnsstk
43 {
46  : prn(0),
47  svn(""),
48  norad(0),
49  chl(0),
50  slotID(0),
52  launchTime(gnsstk::CommonTime::END_OF_TIME),
53  startTime(gnsstk::CommonTime::END_OF_TIME),
54  endTime(gnsstk::CommonTime::END_OF_TIME),
55  plane(""),
56  slot(""),
57  type(""),
58  mission(""),
59  status(Status::Unknown),
60  activeClock(0)
61  {
62  for (unsigned i = 0; i < NUMCLOCKS; i++)
63  {
65  }
66  }
67 
68 
69  std::string SatMetaData ::
71  {
72  switch (s)
73  {
74  case Status::Unknown:
75  return "Unknown";
77  return "Operational";
79  return "Decommissioned";
80  case Status::Test:
81  return "Test";
82  default:
83  return "???";
84  }
85  }
86 
87 
89  asStatus(const std::string& s)
90  {
91  if (s == "Operational")
92  return Status::Operational;
93  if (s == "Decommissioned")
95  if (s == "Test")
96  return Status::Test;
97  return Status::Unknown;
98  }
99 
100 
101  std::string SatMetaData ::
103  {
104  switch (s)
105  {
106  case ClockType::Unknown:
107  return "Unknown";
108  case ClockType::Crystal:
109  return "Crystal";
110  case ClockType::Cesium:
111  return "Cesium";
112  case ClockType::Rubidium:
113  return "Rubidium";
114  case ClockType::Hydrogen:
115  return "Hydrogen";
116  case ClockType::USNO:
117  return "USNO";
118  default:
119  return "???";
120  }
121  }
122 
123 
125  asClockType(const std::string& s)
126  {
127  if (s == "Crystal")
128  return ClockType::Crystal;
129  if (s == "Cesium")
130  return ClockType::Cesium;
131  if (s == "Rubidium")
132  return ClockType::Rubidium;
133  if (s == "Hydrogen")
134  return ClockType::Hydrogen;
135  if (s == "USNO")
136  return ClockType::USNO;
137  return ClockType::Unknown;
138  }
139 
140 
141  std::ostream& operator<<(std::ostream& s, const SatMetaData& smd)
142  {
143  s << smd.prn << ","
144  << smd.svn << ","
145  << smd.norad << ","
146  << smd.chl << ","
147  << smd.slotID << ","
148  << static_cast<int>(smd.sys) << ","
149  << gnsstk::printTime(smd.launchTime, "%Y,%j,%s,")
150  << gnsstk::printTime(smd.startTime, "%Y,%j,%s,")
151  << gnsstk::printTime(smd.endTime, "%Y,%j,%s,")
152  << smd.plane << ","
153  << smd.slot << ","
154  << smd.type << ","
155  << smd.mission << ","
156  << SatMetaData::asString(smd.status) << ","
157  << (unsigned)smd.activeClock;
158  for (unsigned i = 0; i < SatMetaData::NUMCLOCKS; i++)
159  s << "," << SatMetaData::asString(smd.clocks[i]);
160  s << std::endl;
161  return s;
162  }
163 }
gnsstk::SatMetaData::endTime
gnsstk::CommonTime endTime
When the satellite ceased operation.
Definition: SatMetaData.hpp:99
gnsstk::SatMetaData::ClockType::USNO
@ USNO
gnsstk::SatMetaData::ClockType::Rubidium
@ Rubidium
gnsstk::SatMetaData
Definition: SatMetaData.hpp:56
gnsstk::SatMetaData::slot
std::string slot
Slot within the plane.
Definition: SatMetaData.hpp:101
gnsstk::SatMetaData::type
std::string type
Typically block number.
Definition: SatMetaData.hpp:102
gnsstk::SatMetaData::plane
std::string plane
Satellite plane identifier.
Definition: SatMetaData.hpp:100
gnsstk::SatMetaData::sys
SatelliteSystem sys
Which GNSS this satellite is from.
Definition: SatMetaData.hpp:96
gnsstk::SatelliteSystem
SatelliteSystem
Supported satellite systems.
Definition: SatelliteSystem.hpp:55
gnsstk::SatMetaData::Status::Decommissioned
@ Decommissioned
gnsstk::SatMetaData::ClockType::Hydrogen
@ Hydrogen
gnsstk::SatMetaData::norad
int32_t norad
NORAD-assigned ID for this satellite.
Definition: SatMetaData.hpp:93
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::IonexStoreStrategy::Unknown
@ Unknown
Unknown or uninitialized stategy value.
gnsstk::SatMetaData::svn
std::string svn
Space vehicle number, a unique GNSS satellite ID.
Definition: SatMetaData.hpp:92
gnsstk::SatMetaData::status
Status status
Current satellite state.
Definition: SatMetaData.hpp:105
gnsstk::SatMetaData::prn
uint32_t prn
Pseudo-Random Number, identifies CDMA satellites.
Definition: SatMetaData.hpp:91
gnsstk::SatMetaData::ClockType
ClockType
Enumeration for the various types of frequency standards.
Definition: SatMetaData.hpp:70
gnsstk::SatMetaData::clocks
ClockType clocks[NUMCLOCKS]
Types of frequency standards available.
Definition: SatMetaData.hpp:106
gnsstk::SatMetaData::ClockType::Crystal
@ Crystal
SatMetaData.hpp
gnsstk::operator<<
std::ostream & operator<<(std::ostream &s, const ObsEpoch &oe) noexcept
Definition: ObsEpochMap.cpp:54
gnsstk::CommonTime
Definition: CommonTime.hpp:84
gnsstk::SatMetaData::Status::Test
@ Test
gnsstk::SatMetaData::slotID
uint32_t slotID
Slot ID for FDMA satellites.
Definition: SatMetaData.hpp:95
gnsstk::SatMetaData::asClockType
static ClockType asClockType(const std::string &s)
Convert string to ClockType.
Definition: SatMetaData.cpp:125
gnsstk::END_OF_TIME
const Epoch END_OF_TIME(CommonTime::END_OF_TIME)
Latest Representable Epoch.
gnsstk::SatMetaData::SatMetaData
SatMetaData()
Initialize data fields to reasonable defaults.
Definition: SatMetaData.cpp:45
gnsstk::SatMetaData::NUMCLOCKS
static const unsigned NUMCLOCKS
Maximum number of clocks on a satellite.
Definition: SatMetaData.hpp:60
gnsstk::SatMetaData::startTime
gnsstk::CommonTime startTime
When the satellite became operational.
Definition: SatMetaData.hpp:98
gnsstk::SatMetaData::Status
Status
Enumeration for the satellite usage states.
Definition: SatMetaData.hpp:62
gnsstk::SatMetaData::Status::Unknown
@ Unknown
gnsstk::SatMetaData::ClockType::Cesium
@ Cesium
gnsstk::SatMetaData::launchTime
gnsstk::CommonTime launchTime
When the satellite was launched.
Definition: SatMetaData.hpp:97
gnsstk::SatMetaData::chl
int32_t chl
Channel ID for FDMA satellites.
Definition: SatMetaData.hpp:94
gnsstk::printTime
std::string printTime(const CommonTime &t, const std::string &fmt)
Definition: TimeString.cpp:64
gnsstk::SatMetaData::mission
std::string mission
Mission number.
Definition: SatMetaData.hpp:104
gnsstk::SatMetaData::Status::Operational
@ Operational
gnsstk::SatMetaData::ClockType::Unknown
@ Unknown
gnsstk::SatMetaData::asString
static std::string asString(Status s)
Convert Status to string.
Definition: SatMetaData.cpp:70
gnsstk::SatMetaData::asStatus
static Status asStatus(const std::string &s)
Convert string to Status.
Definition: SatMetaData.cpp:89
gnsstk::SatMetaData::activeClock
uint8_t activeClock
Which of the above 4 clocks is active.
Definition: SatMetaData.hpp:107
TimeString.hpp


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