gps_pvt 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7ae7a4026e4f061c13eda89c325a64eba31907fc358433104a8f8bb2b185be4a
4
- data.tar.gz: 2271e46713a750224bb700292552d670d7a3f483c3f6499b8fc719f686e3a88a
3
+ metadata.gz: 8059818f19a2c05d02838cdadc8e4c80f8587cc1d820cef940a1bd9c3c07e734
4
+ data.tar.gz: 65e9a8dddcf5a9f8ce3e434e19438401565f445f141c6ba1ba139b83631032fa
5
5
  SHA512:
6
- metadata.gz: 69b901d4cd1b31c72423acfe0e6e2185a44c5df4b2eae7f6969e9525dec9cb807bab49fd1e1ae1e05c582b596cd0ebdbf0738d2cdbdc42fe87a4c2feb9510be5
7
- data.tar.gz: 8bec3d3eac56beb25895dcdae4ffa084acf4967ae6c9b06b5234574bcca7197cdc01937ec27ef4547013e0bdd4b3e1e5e69a8f7494d1052d4bfc0b6cd47fba06
6
+ metadata.gz: f06f11c40ed2ab98a0c275df92e92a130aefefb2c6632fe2dcdb9f22021124f3082c176f84a9dcdf754896ae6fe1313bc42f3c5180a3ad44f689ebeab40349ae
7
+ data.tar.gz: 4f2011f3b622ca7ba2e3d0b0dcb809fceeac9f7afaa23e45fe48d452f686675c3281ba220251491b667577d8dea4a0fccdc75d2c02736c22538d0630c5178f2c
@@ -846,29 +846,37 @@ class RINEX_NAV_Reader : public RINEX_Reader<> {
846
846
  int year, month, day;
847
847
  FloatT tau_c_neg, tau_GPS; // TODO check tau_GPS polarity
848
848
  int leap_sec;
849
+ int flags;
850
+ enum {
851
+ TAU_C_NEG = 0x01,
852
+ TAU_GPS = 0x02,
853
+ LEAP_SEC = 0x04,
854
+ };
849
855
  };
850
856
  static const typename super_t::convert_item_t t_corr_glonass_v2[4];
851
857
 
852
858
  bool extract_t_corr_glonass_v2(t_corr_glonass_t &t_corr_glonass) const {
853
- bool utc, leap;
859
+ t_corr_glonass.flags = 0;
854
860
  super_t::header_t::const_iterator it;
855
861
 
856
- if(utc = ((it = _header.find("CORR TO SYSTEM TIME")) != _header.end())){
862
+ if((it = _header.find("CORR TO SYSTEM TIME")) != _header.end()){
857
863
  super_t::convert(t_corr_glonass_v2, it->second.front(), &t_corr_glonass);
864
+ t_corr_glonass.flags |= t_corr_glonass_t::TAU_C_NEG;
858
865
  }
859
866
 
860
- if(leap = ((it = _header.find("LEAP SECONDS")) != _header.end())){
867
+ if((it = _header.find("LEAP SECONDS")) != _header.end()){
861
868
  iono_utc_t iono_utc;
862
869
  super_t::convert(utc_leap_v2, it->second.front(), &iono_utc);
863
870
  t_corr_glonass.leap_sec = iono_utc.delta_t_LS;
871
+ t_corr_glonass.flags |= t_corr_glonass_t::LEAP_SEC;
864
872
  }
865
873
 
866
- return utc && leap;
874
+ return t_corr_glonass.flags > 0;
867
875
  }
868
876
 
869
877
  bool extract_t_corr_glonass_v3(t_corr_glonass_t &t_corr_glonass) const {
870
878
  iono_utc_t iono_utc;
871
- bool utc(false), leap(false);
879
+ t_corr_glonass.flags = 0;
872
880
  typedef super_t::header_t::const_iterator it_t;
873
881
  typedef super_t::header_t::mapped_type::const_iterator it2_t;
874
882
 
@@ -880,11 +888,12 @@ class RINEX_NAV_Reader : public RINEX_Reader<> {
880
888
  super_t::convert(utc_v3, *it2, &iono_utc);
881
889
  t_corr_glonass.year = t_corr_glonass.month = t_corr_glonass.day = 0;
882
890
  t_corr_glonass.tau_c_neg = iono_utc.A0;
891
+ t_corr_glonass.flags |= t_corr_glonass_t::TAU_C_NEG;
883
892
  }else if(it2->find("GLGP") != it2->npos){
884
893
  super_t::convert(utc_v3, *it2, &iono_utc);
885
894
  t_corr_glonass.tau_GPS = iono_utc.A0;
895
+ t_corr_glonass.flags |= t_corr_glonass_t::TAU_GPS;
886
896
  }
887
- utc = true;
888
897
  }
889
898
  }
890
899
 
@@ -895,10 +904,10 @@ class RINEX_NAV_Reader : public RINEX_Reader<> {
895
904
  super_t::convert(utc_leap_v2, it->second.front(), &iono_utc);
896
905
  }
897
906
  t_corr_glonass.leap_sec = iono_utc.delta_t_LS;
898
- leap = true;
907
+ t_corr_glonass.flags |= t_corr_glonass_t::LEAP_SEC;
899
908
  }
900
909
 
901
- return utc && leap;
910
+ return t_corr_glonass.flags > 0;
902
911
  }
903
912
 
904
913
  struct space_node_list_t {
@@ -955,8 +964,11 @@ class RINEX_NAV_Reader : public RINEX_Reader<> {
955
964
  typename message_glonass_t::eph_t eph0(reader.msg_glonass);
956
965
  eph0.tau_c = -t_corr_glonass.tau_c_neg;
957
966
  eph0.tau_GPS = t_corr_glonass.tau_GPS;
958
- typename GLONASS_SpaceNode<FloatT>
959
- ::SatelliteProperties::Ephemeris_with_GPS_Time eph(eph0, t_corr_glonass.leap_sec);
967
+ typename GLONASS_SpaceNode<FloatT>::SatelliteProperties::Ephemeris_with_GPS_Time eph(
968
+ eph0,
969
+ (t_corr_glonass.flags & t_corr_glonass_t::LEAP_SEC)
970
+ ? t_corr_glonass.leap_sec
971
+ : GPS_Time<FloatT>::guess_leap_seconds(reader.msg_glonass.date_tm));
960
972
  space_nodes.glonass->satellite(reader.msg_glonass.svid).register_ephemeris(eph);
961
973
  res++;
962
974
  break;
@@ -770,6 +770,11 @@ class SP3_Reader {
770
770
  dst_t &dst;
771
771
  int &res;
772
772
  epoch_t epoch;
773
+ enum {
774
+ TS_UNKNOWN,
775
+ TS_GPS,
776
+ TS_UTC
777
+ } time_system;
773
778
  struct pv_t {
774
779
  position_clock_t pos;
775
780
  velocity_rate_t vel;
@@ -777,12 +782,15 @@ class SP3_Reader {
777
782
  };
778
783
  typedef std::map<int, pv_t> entries_t;
779
784
  entries_t entries;
780
- buf_t(dst_t &dst_, int &res_) : dst(dst_), res(res_), entries(){
785
+ buf_t(dst_t &dst_, int &res_) : dst(dst_), res(res_), time_system(TS_UNKNOWN), entries(){
781
786
  epoch.symbols[0] = 0;
782
787
  }
783
788
  void flush(){
784
789
  if(!epoch.symbols[0]){return;}
785
790
  GPS_Time<FloatT> gpst(epoch);
791
+ if(time_system == TS_UTC){
792
+ gpst += GPS_Time<FloatT>::guess_leap_seconds(gpst);
793
+ }
786
794
  for(typename entries_t::const_iterator it(entries.begin()), it_end(entries.end());
787
795
  it != it_end; ++it){
788
796
  if(it->second.pos.symbol[0]){
@@ -807,6 +815,14 @@ class SP3_Reader {
807
815
  while(src.has_next()){
808
816
  parsed_t parsed(src.parse_line());
809
817
  switch(parsed.type){
818
+ case parsed_t::L21_22: // check time system
819
+ if(buf.time_system != buf_t::TS_UNKNOWN){break;}
820
+ if(std::strncmp(parsed.item.l21_22.time_system, "GPS", 3) == 0){
821
+ buf.time_system = buf_t::TS_GPS;
822
+ }else if(std::strncmp(parsed.item.l21_22.time_system, "UTC", 3) == 0){
823
+ buf.time_system = buf_t::TS_UTC;
824
+ }
825
+ break;
810
826
  case parsed_t::EPOCH:
811
827
  buf.flush();
812
828
  buf.epoch = parsed.item.epoch;
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GPS_PVT
4
- VERSION = "0.6.0"
4
+ VERSION = "0.6.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gps_pvt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - fenrir(M.Naruoka)
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-14 00:00:00.000000000 Z
11
+ date: 2022-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake