SatMetaDataStore.hpp
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 #ifndef GNSSTK_SATMETADATASTORE_HPP
40 #define GNSSTK_SATMETADATASTORE_HPP
41 
42 #include <map>
43 #include <set>
44 #include "SatMetaData.hpp"
45 #include "SatMetaDataSort.hpp"
46 #include "NavID.hpp"
47 
48 namespace gnsstk
49 {
139  {
140  public:
142  struct Signal
143  {
148  {}
151  : carrier(c), code(r), nav(n)
152  {}
154  inline bool operator<(const Signal& right) const;
156  inline bool operator==(const Signal& right) const;
158  inline bool operator!=(const Signal& right) const
159  { return !operator==(right); }
163  };
166  {
167  public:
168  inline bool operator<(const SystemBlock& right) const;
170  std::string blk;
171  };
173  class SVNID
174  {
175  public:
176  SVNID();
177  SVNID(SatelliteSystem sys, const std::string& svn);
179  std::string id;
180  bool operator<(const SVNID& right) const;
181  };
184  {
185  public:
188  std::string type;
189  std::string mission;
190  };
192  typedef std::set<Signal> SignalSet;
194  typedef std::map<std::string, SignalSet> SignalMap;
196  typedef std::multiset<SatMetaData, SatMetaDataSort> SatSet;
198  typedef std::map<SatelliteSystem, SatSet> SatMetaMap;
200  typedef std::vector<SatMetaData::ClockType> ClockVec;
202  typedef std::map<SystemBlock, ClockVec> ClockConfigMap;
204  typedef std::map<SVNID, LaunchConfig> LaunchMap;
206  typedef std::map<SVNID, unsigned long> NORADMap;
207 
209  SatMetaDataStore() = default;
210 
215  virtual bool loadData(const std::string& sourceName);
216 
225  bool findSat(SatelliteSystem sys, uint32_t prn,
226  const gnsstk::CommonTime& when,
227  SatMetaData& sat)
228  const;
229 
237  bool findSat(const SatID& prn,
238  const gnsstk::CommonTime& when,
239  SatMetaData& sat)
240  const
241  { return findSat(prn.system, prn.id, when, sat); }
242 
252  bool getSVN(SatelliteSystem sys, uint32_t prn,
253  const gnsstk::CommonTime& when,
254  std::string& svn)
255  const;
256 
264  bool getSVN(const SatID& sat, const gnsstk::CommonTime& when,
265  std::string& svn)
266  const
267  { return getSVN(sat.system, sat.id, when, svn); }
268 
277  bool findSatBySVN(SatelliteSystem sys, const std::string& svn,
278  const gnsstk::CommonTime& when,
279  SatMetaData& sat)
280  const;
281 
294  bool findSatBySlotFdma(uint32_t slotID,
295  int32_t channel,
296  const gnsstk::CommonTime& when,
297  SatMetaData& sat)
298  const;
299 
309  bool getPRN(SatelliteSystem sys, const std::string& svn,
310  const gnsstk::CommonTime& when,
311  uint32_t& prn)
312  const;
313 
319  std::set<std::string> getSignalSet(const Signal& sig)
320  const;
321 
328  std::set<std::string> getSignalSet(const SignalSet& signals)
329  const;
330 
338  std::set<std::string> getSignalSet(CarrierBand band, TrackingCode code,
339  NavType nav)
340  const
341  { return getSignalSet(Signal(band,code,nav)); }
342 
348  SatSet getSatsBySignal(const SignalSet& signals);
349 
357  SatSet getSatsBySignal(const SignalSet& signals, const CommonTime& when);
358 
374  const SignalSet& signals,
375  const CommonTime& beginTime,
376  const CommonTime& endTime,
377  const std::set<SatMetaData::Status>& status = {
381 
392 
393  protected:
399  bool addSat(const std::vector<std::string>& vals, unsigned long lineNo);
405  bool addSignal(const std::vector<std::string>& vals,
406  unsigned long lineNo);
412  bool addClock(const std::vector<std::string>& vals, unsigned long lineNo);
418  bool addLaunch(const std::vector<std::string>& vals,
419  unsigned long lineNo);
425  bool addNORAD(const std::vector<std::string>& vals, unsigned long lineNo);
426  }; // class SatMetaDataStore
427 
428 
430  operator<(const Signal& right)
431  const
432  {
433  if (static_cast<int>(carrier) < static_cast<int>(right.carrier))
434  {
435  return true;
436  }
437  if (static_cast<int>(carrier) > static_cast<int>(right.carrier))
438  {
439  return false;
440  }
441  if (static_cast<int>(code) < static_cast<int>(right.code))
442  {
443  return true;
444  }
445  if (static_cast<int>(code) > static_cast<int>(right.code))
446  {
447  return false;
448  }
449  if (static_cast<int>(nav) < static_cast<int>(right.nav))
450  {
451  return true;
452  }
453  return false;
454  }
455 
456 
458  operator==(const Signal& right)
459  const
460  {
461  if ((carrier != CarrierBand::Any) &&
462  (right.carrier != CarrierBand::Any) &&
463  (carrier != right.carrier))
464  {
465  return false;
466  }
467  if ((code != TrackingCode::Any) &&
468  (right.code != TrackingCode::Any) &&
469  (code != right.code))
470  {
471  return false;
472  }
473  if ((nav != NavType::Any) &&
474  (right.nav != NavType::Any) &&
475  (nav != right.nav))
476  {
477  return false;
478  }
479  return true;
480  }
481 
482 
485  const
486  {
487  if (static_cast<int>(sys) < static_cast<int>(right.sys))
488  return true;
489  if (static_cast<int>(sys) > static_cast<int>(right.sys))
490  return false;
491  return blk < right.blk;
492  }
493 
494 
495  inline std::ostream& operator<<(std::ostream& s,
496  const SatMetaDataStore::SystemBlock& sblk)
497  {
498  s << gnsstk::StringUtils::asString(sblk.sys) << " " << sblk.blk;
499  return s;
500  }
501 
502 
503  inline std::ostream& operator<<(std::ostream& s,
504  const SatMetaDataStore::SVNID& svn)
505  {
506  s << gnsstk::StringUtils::asString(svn.system) << " " << svn.id;
507  return s;
508  }
509 
510 } // namespace gnsstk
511 
512 #endif // GNSSTK_SATMETADATASTORE_HPP
gnsstk::SatMetaDataStore::SatMetaDataStore
SatMetaDataStore()=default
Nothin doin.
gnsstk::SatMetaDataStore::Signal::code
TrackingCode code
Tracking code.
Definition: SatMetaDataStore.hpp:161
gnsstk::SatMetaDataStore::addNORAD
bool addNORAD(const std::vector< std::string > &vals, unsigned long lineNo)
Definition: SatMetaDataStore.cpp:420
gnsstk::SatMetaDataStore::SystemBlock::blk
std::string blk
Definition: SatMetaDataStore.hpp:170
gnsstk::SatID::id
int id
Satellite identifier, e.g. PRN.
Definition: SatID.hpp:154
gnsstk::SatMetaDataStore::getSignalSet
std::set< std::string > getSignalSet(CarrierBand band, TrackingCode code, NavType nav) const
Definition: SatMetaDataStore.hpp:338
gnsstk::SatMetaData
Definition: SatMetaData.hpp:56
gnsstk::SatMetaDataStore::SystemBlock::operator<
bool operator<(const SystemBlock &right) const
Definition: SatMetaDataStore.hpp:484
gnsstk::SatMetaDataStore::LaunchConfig
Launch configuration.
Definition: SatMetaDataStore.hpp:183
gnsstk::SatMetaDataStore::findSatBySlotFdma
bool findSatBySlotFdma(uint32_t slotID, int32_t channel, const gnsstk::CommonTime &when, SatMetaData &sat) const
Definition: SatMetaDataStore.cpp:531
gnsstk::SatMetaDataStore::LaunchConfig::mission
std::string mission
Mission number.
Definition: SatMetaDataStore.hpp:189
gnsstk::SatMetaDataStore::Signal::nav
NavType nav
Navigation code.
Definition: SatMetaDataStore.hpp:162
gnsstk::CarrierBand
CarrierBand
Definition: CarrierBand.hpp:54
gnsstk::SatMetaDataStore::getSignalSet
std::set< std::string > getSignalSet(const Signal &sig) const
Definition: SatMetaDataStore.cpp:601
gnsstk::SatMetaDataStore::LaunchMap
std::map< SVNID, LaunchConfig > LaunchMap
Map SVN to launch time.
Definition: SatMetaDataStore.hpp:204
gnsstk::SatelliteSystem
SatelliteSystem
Supported satellite systems.
Definition: SatelliteSystem.hpp:55
gnsstk::CarrierBand::Any
@ Any
Used to match any carrier band.
gnsstk::SatID
Definition: SatID.hpp:89
gnsstk::SatMetaData::Status::Decommissioned
@ Decommissioned
gnsstk::StringUtils::asString
std::string asString(IonexStoreStrategy e)
Convert a IonexStoreStrategy to a whitespace-free string name.
Definition: IonexStoreStrategy.cpp:46
gnsstk::SatMetaDataStore::satMap
SatMetaMap satMap
Storage of all the satellite metadata.
Definition: SatMetaDataStore.hpp:383
gnsstk::SatMetaDataStore::SystemBlock
Key of GNSS and satellite block.
Definition: SatMetaDataStore.hpp:165
gnsstk::SatMetaDataStore::Signal::carrier
CarrierBand carrier
Carrier frequency.
Definition: SatMetaDataStore.hpp:160
gnsstk::SatMetaDataStore::SatMetaMap
std::map< SatelliteSystem, SatSet > SatMetaMap
Satellites grouped by system.
Definition: SatMetaDataStore.hpp:198
gnsstk::SatMetaDataStore::findSat
bool findSat(const SatID &prn, const gnsstk::CommonTime &when, SatMetaData &sat) const
Definition: SatMetaDataStore.hpp:237
gnsstk::SatMetaDataStore::LaunchConfig::svn
SVNID svn
Definition: SatMetaDataStore.hpp:186
gnsstk::SatMetaDataStore::Signal
Specifies a single GNSS signal.
Definition: SatMetaDataStore.hpp:142
gnsstk::SatMetaDataStore::Signal::operator!=
bool operator!=(const Signal &right) const
Comparison operator that allows "Any" to be a wildcard.
Definition: SatMetaDataStore.hpp:158
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::SatMetaDataStore::addClock
bool addClock(const std::vector< std::string > &vals, unsigned long lineNo)
Definition: SatMetaDataStore.cpp:348
gnsstk::IonexStoreStrategy::Unknown
@ Unknown
Unknown or uninitialized stategy value.
gnsstk::SatMetaDataStore::getSVN
bool getSVN(SatelliteSystem sys, uint32_t prn, const gnsstk::CommonTime &when, std::string &svn) const
Definition: SatMetaDataStore.cpp:569
gnsstk::SatMetaDataStore::SVNID::system
SatelliteSystem system
Definition: SatMetaDataStore.hpp:178
SatMetaDataSort.hpp
gnsstk::SatMetaDataStore::clkMap
ClockConfigMap clkMap
Map satellite block to clock types.
Definition: SatMetaDataStore.hpp:387
gnsstk::NavType::Any
@ Any
Used to match any nav code.
gnsstk::SatMetaDataStore::noradMap
NORADMap noradMap
Map SVN to NORAD ID.
Definition: SatMetaDataStore.hpp:391
gnsstk::SatMetaDataStore::Signal::Signal
Signal(CarrierBand c, TrackingCode r, NavType n)
Initialize using complete set of specified values.
Definition: SatMetaDataStore.hpp:150
gnsstk::SatMetaDataStore::NORADMap
std::map< SVNID, unsigned long > NORADMap
Map SVN to NORAD ID.
Definition: SatMetaDataStore.hpp:206
gnsstk::SatMetaDataStore::loadData
virtual bool loadData(const std::string &sourceName)
Definition: SatMetaDataStore.cpp:79
gnsstk::SatMetaDataStore::findSat
bool findSat(SatelliteSystem sys, uint32_t prn, const gnsstk::CommonTime &when, SatMetaData &sat) const
Definition: SatMetaDataStore.cpp:447
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::SatMetaDataStore::Signal::operator<
bool operator<(const Signal &right) const
Ordering for template/container.
Definition: SatMetaDataStore.hpp:430
gnsstk::SatMetaDataStore::SignalSet
std::set< Signal > SignalSet
Set of signals that may be transmitted by a satellite.
Definition: SatMetaDataStore.hpp:192
gnsstk::SatMetaDataStore::LaunchConfig::type
std::string type
Typically block number.
Definition: SatMetaDataStore.hpp:188
gnsstk::SatMetaDataStore::getSVN
bool getSVN(const SatID &sat, const gnsstk::CommonTime &when, std::string &svn) const
Definition: SatMetaDataStore.hpp:264
gnsstk::SatMetaDataStore
Definition: SatMetaDataStore.hpp:138
gnsstk::SatMetaDataStore::ClockConfigMap
std::map< SystemBlock, ClockVec > ClockConfigMap
Clock configuration information.
Definition: SatMetaDataStore.hpp:202
gnsstk::SatMetaDataStore::SystemBlock::sys
SatelliteSystem sys
Definition: SatMetaDataStore.hpp:169
gnsstk::SatMetaDataStore::SVNID
Like SatID but for SVN which is a string.
Definition: SatMetaDataStore.hpp:173
gnsstk::SatMetaDataStore::addLaunch
bool addLaunch(const std::vector< std::string > &vals, unsigned long lineNo)
Definition: SatMetaDataStore.cpp:380
gnsstk::SatMetaDataStore::SVNID::id
std::string id
Definition: SatMetaDataStore.hpp:179
gnsstk::SatMetaDataStore::LaunchConfig::launchTime
gnsstk::CommonTime launchTime
Definition: SatMetaDataStore.hpp:187
gnsstk::SatID::system
SatelliteSystem system
System for this satellite.
Definition: SatID.hpp:156
gnsstk::SatMetaDataStore::addSat
bool addSat(const std::vector< std::string > &vals, unsigned long lineNo)
Definition: SatMetaDataStore.cpp:181
gnsstk::SatMetaDataStore::getPRN
bool getPRN(SatelliteSystem sys, const std::string &svn, const gnsstk::CommonTime &when, uint32_t &prn) const
Definition: SatMetaDataStore.cpp:585
gnsstk::SatMetaDataStore::SVNID::operator<
bool operator<(const SVNID &right) const
Definition: SatMetaDataStore.cpp:64
gnsstk::SatMetaDataStore::launchMap
LaunchMap launchMap
Launch time of satellites.
Definition: SatMetaDataStore.hpp:389
gnsstk::SatMetaDataStore::SatSet
std::multiset< SatMetaData, SatMetaDataSort > SatSet
Set of satellites ordered by PRN or channel/slotID.
Definition: SatMetaDataStore.hpp:196
gnsstk::TrackingCode
TrackingCode
Definition: TrackingCode.hpp:64
gnsstk::SatMetaDataStore::SVNID::SVNID
SVNID()
Definition: SatMetaDataStore.cpp:50
gnsstk::SatMetaDataStore::addSignal
bool addSignal(const std::vector< std::string > &vals, unsigned long lineNo)
Definition: SatMetaDataStore.cpp:298
gnsstk::SatMetaDataStore::findSatBySVN
bool findSatBySVN(SatelliteSystem sys, const std::string &svn, const gnsstk::CommonTime &when, SatMetaData &sat) const
Definition: SatMetaDataStore.cpp:496
gnsstk::SatMetaDataStore::Signal::operator==
bool operator==(const Signal &right) const
Comparison operator that allows "Any" to be a wildcard.
Definition: SatMetaDataStore.hpp:458
gnsstk::SatMetaData::Status::Operational
@ Operational
NavID.hpp
gnsstk::SatMetaDataStore::ClockVec
std::vector< SatMetaData::ClockType > ClockVec
Types of clocks on a satellite (hardware-specific positional idx).
Definition: SatMetaDataStore.hpp:200
gnsstk::SatMetaDataStore::sigMap
SignalMap sigMap
Map signal set name to the actual signals.
Definition: SatMetaDataStore.hpp:385
gnsstk::SatMetaDataStore::getSatsBySignal
SatSet getSatsBySignal(const SignalSet &signals)
Definition: SatMetaDataStore.cpp:661
gnsstk::SatMetaDataStore::SignalMap
std::map< std::string, SignalSet > SignalMap
Map of signal set name to signal set.
Definition: SatMetaDataStore.hpp:194
gnsstk::NavType
NavType
Supported navigation types.
Definition: NavType.hpp:58
gnsstk::SatMetaDataStore::Signal::Signal
Signal()
Initialize everything to unknown.
Definition: SatMetaDataStore.hpp:145
gnsstk::TrackingCode::Any
@ Any
Used to match any tracking code.


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