gps_pvt 0.8.2 → 0.8.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b87c77fbb3844eb0fd835ef079b8a379708a6fe24e3de4ceeb6934206573f489
4
- data.tar.gz: a280c1aa82bed41319e13069907940a062a073a0b01c95eefa3d3d8c1b32c517
3
+ metadata.gz: e2f23806309c4244499a91877edba1a5dfacb1a9108596527dffad650c9cd9ee
4
+ data.tar.gz: dc33e31c739a79dc7e7c28ad0d6f404b65788499dfa2f53f9b93edae7b589e7e
5
5
  SHA512:
6
- metadata.gz: 761d7e99868e04d93adb48fac0345ff71467068657c544efe857ed4f6206ed8d11698871ad7dc73c232f4bd51094cf13c6752d96fc17307caccb4a2eab8dbe03
7
- data.tar.gz: fd70c1d59dbf3885e7a2286726a9c16e0cfbec3097a105bbffde59e3a65ee22eb09f1d0b4032b371faf2d1695b074b0752f37763ef6b5716dd4214fed4566755
6
+ metadata.gz: 2a3ec484712ccbd06b99a08a672ef20980d68e5f1670b07b093f1d6e4d0480dce974cbe8a181ecb0e8d6074cc60c1c122778113e962625f57b41a7a85b61fc4a
7
+ data.tar.gz: 5368619df05a35b6295702e3ad64958aab84e92652b01747f31b5bb98974243ac56a5b4fc25bde1075109bd4d586eac14bf64e1c2ac6b5a31d9bc990ece92fd7
data/README.md CHANGED
@@ -27,7 +27,7 @@ For Windows users, this gem requires Devkit because of native compilation.
27
27
 
28
28
  ## Usage
29
29
 
30
- ### For user who just generate PVT solution
30
+ ### For user who just wants to generate PVT solution
31
31
  An attached executable is useful. After installation, type
32
32
 
33
33
  $ gps_pvt file_or_URI(s)
@@ -36,12 +36,12 @@ The format of file is automatically determined with its extension, such as .ubx
36
36
 
37
37
  | specification | recoginized as |
38
38
  ----|----
39
- | --rinex_nav=file_or_URI | [RINEX](https://www.igs.org/wg/rinex/#documents-formats) navigation file |
40
- | --rinex_obs=file_or_URI | [RINEX](https://www.igs.org/wg/rinex/#documents-formats) observation file |
41
- | --ubx=file_or_URI | [U-blox](https://www.u-blox.com/) dedicated format |
39
+ | <a name=opt_rinex_nav>--rinex_nav=file_or_URI</a> | [RINEX](https://www.igs.org/wg/rinex/#documents-formats) navigation file |
40
+ | <a name=opt_rinex_obs>--rinex_obs=file_or_URI</a> | [RINEX](https://www.igs.org/wg/rinex/#documents-formats) observation file |
41
+ | <a name=opt_ubx>--ubx=file_or_URI</a> | [U-blox](https://www.u-blox.com/) dedicated format |
42
42
  | --sp3=file_or_URI | [Standard Product 3 Orbit Format](https://files.igs.org/pub/data/format/sp3c.txt) (supported gps_pvt version >= 0.6.0) |
43
43
  | --antex=file_or_URI | [Antenna Exchange Format](https://igs.org/wg/antenna#files) (supported gps_pvt version >= 0.6.0) |
44
- | --rinex_clk=file_or_URI | [RINEX clock](https://files.igs.org/pub/data/format/rinex_clock304.txt) file (supported gps_pvt version >= 0.7.0) |
44
+ | --rinex_clk=file_or_URI | [RINEX clock](https://files.igs.org/pub/data/format/rinex_clock304.txt) file (supported gps_pvt version >= 0.7.0) |
45
45
 
46
46
  Since version 0.2.0, SBAS and QZSS are supported in addition to GPS. Since version 0.4.0, GLONASS is also available. QZSS ranging is activated in default, however, SBAS is just utilized for ionospheric correction. GLONASS is also turned off by default. If you want to activate SBAS or GLONASS ranging, "--with=(system or PRN)" options are used with gps_pvt executable like
47
47
 
@@ -49,13 +49,13 @@ Since version 0.2.0, SBAS and QZSS are supported in addition to GPS. Since versi
49
49
 
50
50
  Additionally, the following command options *--key=value* are available.
51
51
 
52
- | key | value | comment | version |
52
+ | key | value | comment | since |
53
53
  ----|----|----|----
54
54
  | base_station | 3 \* (numeric+coordinate) | base position used for relative ENU position calculation. XYZ, NEU formats are acceptable. *ex1) --base_station=0X,0Y,0Z*, *ex2) --base_station=12.34N,56.789E,0U* | v0.1.7 |
55
55
  | elevation_mask_deg | numeric | satellite elevation mask specified in degrees. *ex) --elevation_mask_deg=10* | v0.3.0 |
56
56
  | start_time | time string | start time to perform solution. GPS, UTC and other formats are supported. *ex1) --start_time=1234:5678* represents 5678 seconds in 1234 GPS week, *ex2) --start_time="2000-01-01 00:00:00 UTC"* is in UTC format. | v0.3.3 |
57
57
  | end_time | time string | end time to perform solution. Its format is the same as start_time. | v0.3.3 |
58
- | online_ephemeris | | based on observation, automatically load ephemeris which is previously broadcasted from satellite and currently published online | v0.5.0 |
58
+ | <a name=opt_online_ephemeris>online_ephemeris</a> | URL string | based on observation, ephemeris which is previously broadcasted from satellite and currently published online will automatically be loaded. If value is not given, the default source "ftp://gssc.esa.int/gnss/data/daily/%Y/brdc/BRDC00IGS_R_%Y%j0000_01D_MN.rnx.gz" is used. The value string is converted with [strftime](https://docs.ruby-lang.org/en/master/strftime_formatting_rdoc.html) before actual use. | v0.8.1 |
59
59
 
60
60
  ### For developer
61
61
 
@@ -148,6 +148,21 @@ receiver.solver.correction = { # provide by using a Hash
148
148
  }
149
149
  ```
150
150
 
151
+ ## Additional utilities
152
+
153
+ ### [to_ubx](exe/to_ubx)
154
+
155
+ Utility to convert observation into u-blox ubx format and dump standard input. After installation of gps_pvt, to type
156
+
157
+ $ to_ubx file_or_URI(s) (options) > out.ubx
158
+
159
+ saves resultant into out.ubx by using redirection. The shared options with gps_pvt executable are [rinex_obs](#opt_rinex_obs), [rinex_nav](#opt_rinex_nav), [ubx](#opt_ubx), and [online_ephemeris](#opt_online_ephemeris). In addition, the following options are available.
160
+
161
+ | key | value | comment | since |
162
+ ----|----|----|----
163
+ | ubx_rawx | | Change output packet types to UBX-RAWX from its default UBX-RAW. | v0.8.1 |
164
+ | broadcast_data | | In addition to observation, ephemeris is inserted by using UBX-SFRB packets. If ubx_rawx option is specified, UBX-SFRBX is used instead of UBX-SFRB. | v0.8.1 |
165
+
151
166
  ## Development
152
167
 
153
168
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake` to build library and run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
data/exe/gps_pvt CHANGED
@@ -59,7 +59,7 @@ options.reject!{|opt|
59
59
  misc_options[opt[0]] = t
60
60
  true
61
61
  when :online_ephemeris
62
- misc_options[opt[0]] = opt[1]
62
+ (misc_options[opt[0]] ||= []) << opt[1]
63
63
  true
64
64
  else
65
65
  false
data/exe/to_ubx CHANGED
@@ -40,6 +40,7 @@ files.collect!{|fname, ftype|
40
40
  ftype ||= case fname
41
41
  when /\.\d{2}[nhqg](?:\.gz)?$/; :rinex_nav
42
42
  when /\.\d{2}o(?:\.gz)?$/; :rinex_obs
43
+ when /\.ubx$/; :ubx
43
44
  else
44
45
  raise "Format cannot be guessed, use --(format, ex. rinex_obs)=#{fname}"
45
46
  end
@@ -55,9 +56,12 @@ files.collect!{|fname, ftype|
55
56
 
56
57
  options.reject!{|opt|
57
58
  case opt[0]
58
- when :ubx_rawx, :online_ephemeris, :broadcast_data, :eph_interval
59
+ when :ubx_rawx, :broadcast_data, :eph_interval
59
60
  misc_options[opt[0]] = opt[1]
60
61
  true
62
+ when :online_ephemeris
63
+ (misc_options[opt[0]] ||= []) << opt[1]
64
+ true
61
65
  else
62
66
  false
63
67
  end
@@ -95,14 +99,37 @@ files.each{|fname, ftype|
95
99
  # other files
96
100
  files.each{|fname, ftype|
97
101
  case ftype
102
+ when :ubx; rcv.parse_ubx(fname){}
98
103
  when :rinex_obs; rcv.parse_rinex_obs(fname){}
99
104
  end
100
105
  }
101
106
 
102
107
  obs.sort!{|a, b| a[0] <=> b[0]} # Sort by measurement time
103
108
 
104
- # Add dummy before actual first observation in order to notify time to solver
105
- obs.unshift([obs[0][0] - 1, GPS_PVT::GPS::Measurement::new])
109
+ # Time packet for solution of leap seconds
110
+ gen_gpstime = proc{
111
+ tmpl = [0xB5, 0x62, 0x01, 0x20, 16, 0]
112
+ gpst = GPS_PVT::GPS::Time
113
+ t_next = gpst::new(*gpst::leap_second_events.find{|wn, sec, leap| leap == 1}[0..1])
114
+ proc{|t_meas, meas|
115
+ next nil if t_meas < t_next
116
+ t_next = t_meas + 60 # 1 min. interval
117
+ ubx = tmpl.clone
118
+ t_sec = t_meas.seconds
119
+ t_msec = (t_sec * 1E3).round
120
+ t_nsec = ((t_sec * 1E3 - t_msec) * 1E6).round
121
+ leap = rcv.leap_seconds(t_meas)
122
+ ubx += [
123
+ t_msec, # ITOW ms GPS Millisecond time of Week
124
+ t_nsec, # Frac ns Nanoseconds remainder of rounded ms above, range -500000 .. 500000
125
+ t_meas.week, # week - GPS week (GPS time)
126
+ leap || 0, # LeapS s Leap Seconds (GPS-UTC)
127
+ leap ? 0x07 : 0x03, # validity bit field (0x01=ToW, 0x02=WN, 0x04=UTC)
128
+ 10000, # TAcc ns Time Accuracy Estimate
129
+ ].pack("Vl<vcCV").unpack("C*")
130
+ GPS_PVT::UBX::update(ubx + [0, 0]).pack("C*")
131
+ }
132
+ }.call
106
133
 
107
134
  gen_sfrb, gen_sfrbx = proc{
108
135
  cache = {}
@@ -335,6 +362,7 @@ gen_rawx = proc{|t_meas, meas| # Convert to RXM-RAWX(0x15)
335
362
  }
336
363
 
337
364
  gen_list = []
365
+ gen_list << gen_gpstime unless misc_options[:ubx_rawx]
338
366
  gen_list << (misc_options[:ubx_rawx] ? gen_sfrbx : gen_sfrb) if misc_options[:broadcast_data]
339
367
  gen_list << (misc_options[:ubx_rawx] ? gen_rawx : gen_raw)
340
368
  STDOUT.binmode
@@ -1866,56 +1866,55 @@ int SWIG_Ruby_arity( VALUE proc, int minimal )
1866
1866
  #define SWIGTYPE_p_GPS_SpaceNodeT_double_t__Ionospheric_UTC_Parameters swig_types[16]
1867
1867
  #define SWIGTYPE_p_GPS_SpaceNodeT_double_t__SatelliteProperties__Ephemeris swig_types[17]
1868
1868
  #define SWIGTYPE_p_GPS_TimeT_double_t swig_types[18]
1869
- #define SWIGTYPE_p_GPS_TimeT_double_t__leap_second_event_t swig_types[19]
1870
- #define SWIGTYPE_p_GPS_TimeT_double_t__leap_year_prop_res_t swig_types[20]
1871
- #define SWIGTYPE_p_GPS_User_PVTT_double_t swig_types[21]
1872
- #define SWIGTYPE_p_MatrixT_ComplexT_double_t_Array2D_DenseT_ComplexT_double_t_t_MatrixViewBaseT_t_t swig_types[22]
1873
- #define SWIGTYPE_p_MatrixT_double_Array2D_DenseT_double_t_MatrixViewBaseT_t_t swig_types[23]
1874
- #define SWIGTYPE_p_MatrixViewBaseT_t swig_types[24]
1875
- #define SWIGTYPE_p_MatrixViewFilterT_MatrixViewBaseT_t_t swig_types[25]
1876
- #define SWIGTYPE_p_Matrix_FrozenT_double_Array2D_DenseT_double_t_MatrixViewBaseT_t_t swig_types[26]
1877
- #define SWIGTYPE_p_PushableData swig_types[27]
1878
- #define SWIGTYPE_p_RINEX_ClockT_double_t swig_types[28]
1879
- #define SWIGTYPE_p_RINEX_ObservationT_double_t swig_types[29]
1880
- #define SWIGTYPE_p_SBAS_EphemerisT_double_t swig_types[30]
1881
- #define SWIGTYPE_p_SBAS_SolverOptionsT_double_t swig_types[31]
1882
- #define SWIGTYPE_p_SBAS_SpaceNodeT_double_t swig_types[32]
1883
- #define SWIGTYPE_p_SBAS_SpaceNodeT_double_t__SatelliteProperties__Ephemeris swig_types[33]
1884
- #define SWIGTYPE_p_SP3T_double_t swig_types[34]
1885
- #define SWIGTYPE_p_System_ENUT_double_WGS84_t swig_types[35]
1886
- #define SWIGTYPE_p_System_LLHT_double_WGS84_t swig_types[36]
1887
- #define SWIGTYPE_p_System_XYZT_double_WGS84_t swig_types[37]
1888
- #define SWIGTYPE_p_available_satellites_t swig_types[38]
1889
- #define SWIGTYPE_p_char swig_types[39]
1890
- #define SWIGTYPE_p_double swig_types[40]
1891
- #define SWIGTYPE_p_enu_t swig_types[41]
1892
- #define SWIGTYPE_p_eph_t swig_types[42]
1893
- #define SWIGTYPE_p_float_t swig_types[43]
1894
- #define SWIGTYPE_p_gps_space_node_t swig_types[44]
1895
- #define SWIGTYPE_p_gps_time_t swig_types[45]
1896
- #define SWIGTYPE_p_int swig_types[46]
1897
- #define SWIGTYPE_p_int_t swig_types[47]
1898
- #define SWIGTYPE_p_llh_t swig_types[48]
1899
- #define SWIGTYPE_p_p_GPS_Solver_RAIM_LSRT_double_GPS_Solver_Base_DebugT_double_GPS_Solver_BaseT_double_t_t_t__user_pvt_t__detection_t swig_types[49]
1900
- #define SWIGTYPE_p_p_GPS_Solver_RAIM_LSRT_double_GPS_Solver_Base_DebugT_double_GPS_Solver_BaseT_double_t_t_t__user_pvt_t__exclusion_t swig_types[50]
1901
- #define SWIGTYPE_p_p_double swig_types[51]
1902
- #define SWIGTYPE_p_range_correction_list_t swig_types[52]
1903
- #define SWIGTYPE_p_s16_t swig_types[53]
1904
- #define SWIGTYPE_p_s32_t swig_types[54]
1905
- #define SWIGTYPE_p_s8_t swig_types[55]
1906
- #define SWIGTYPE_p_satellites_t swig_types[56]
1907
- #define SWIGTYPE_p_self_t swig_types[57]
1908
- #define SWIGTYPE_p_std__vectorT_std__pairT_int_SBAS_SpaceNodeT_double_t__Satellite_const_p_t_t swig_types[58]
1909
- #define SWIGTYPE_p_super_t swig_types[59]
1910
- #define SWIGTYPE_p_swig__GC_VALUE swig_types[60]
1911
- #define SWIGTYPE_p_u16_t swig_types[61]
1912
- #define SWIGTYPE_p_u32_t swig_types[62]
1913
- #define SWIGTYPE_p_u8_t swig_types[63]
1914
- #define SWIGTYPE_p_uint_t swig_types[64]
1915
- #define SWIGTYPE_p_unsigned_int swig_types[65]
1916
- #define SWIGTYPE_p_xyz_t swig_types[66]
1917
- static swig_type_info *swig_types[68];
1918
- static swig_module_info swig_module = {swig_types, 67, 0, 0, 0, 0};
1869
+ #define SWIGTYPE_p_GPS_TimeT_double_t__leap_year_prop_res_t swig_types[19]
1870
+ #define SWIGTYPE_p_GPS_User_PVTT_double_t swig_types[20]
1871
+ #define SWIGTYPE_p_MatrixT_ComplexT_double_t_Array2D_DenseT_ComplexT_double_t_t_MatrixViewBaseT_t_t swig_types[21]
1872
+ #define SWIGTYPE_p_MatrixT_double_Array2D_DenseT_double_t_MatrixViewBaseT_t_t swig_types[22]
1873
+ #define SWIGTYPE_p_MatrixViewBaseT_t swig_types[23]
1874
+ #define SWIGTYPE_p_MatrixViewFilterT_MatrixViewBaseT_t_t swig_types[24]
1875
+ #define SWIGTYPE_p_Matrix_FrozenT_double_Array2D_DenseT_double_t_MatrixViewBaseT_t_t swig_types[25]
1876
+ #define SWIGTYPE_p_PushableData swig_types[26]
1877
+ #define SWIGTYPE_p_RINEX_ClockT_double_t swig_types[27]
1878
+ #define SWIGTYPE_p_RINEX_ObservationT_double_t swig_types[28]
1879
+ #define SWIGTYPE_p_SBAS_EphemerisT_double_t swig_types[29]
1880
+ #define SWIGTYPE_p_SBAS_SolverOptionsT_double_t swig_types[30]
1881
+ #define SWIGTYPE_p_SBAS_SpaceNodeT_double_t swig_types[31]
1882
+ #define SWIGTYPE_p_SBAS_SpaceNodeT_double_t__SatelliteProperties__Ephemeris swig_types[32]
1883
+ #define SWIGTYPE_p_SP3T_double_t swig_types[33]
1884
+ #define SWIGTYPE_p_System_ENUT_double_WGS84_t swig_types[34]
1885
+ #define SWIGTYPE_p_System_LLHT_double_WGS84_t swig_types[35]
1886
+ #define SWIGTYPE_p_System_XYZT_double_WGS84_t swig_types[36]
1887
+ #define SWIGTYPE_p_available_satellites_t swig_types[37]
1888
+ #define SWIGTYPE_p_char swig_types[38]
1889
+ #define SWIGTYPE_p_double swig_types[39]
1890
+ #define SWIGTYPE_p_enu_t swig_types[40]
1891
+ #define SWIGTYPE_p_eph_t swig_types[41]
1892
+ #define SWIGTYPE_p_float_t swig_types[42]
1893
+ #define SWIGTYPE_p_gps_space_node_t swig_types[43]
1894
+ #define SWIGTYPE_p_gps_time_t swig_types[44]
1895
+ #define SWIGTYPE_p_int swig_types[45]
1896
+ #define SWIGTYPE_p_int_t swig_types[46]
1897
+ #define SWIGTYPE_p_llh_t swig_types[47]
1898
+ #define SWIGTYPE_p_p_GPS_Solver_RAIM_LSRT_double_GPS_Solver_Base_DebugT_double_GPS_Solver_BaseT_double_t_t_t__user_pvt_t__detection_t swig_types[48]
1899
+ #define SWIGTYPE_p_p_GPS_Solver_RAIM_LSRT_double_GPS_Solver_Base_DebugT_double_GPS_Solver_BaseT_double_t_t_t__user_pvt_t__exclusion_t swig_types[49]
1900
+ #define SWIGTYPE_p_p_double swig_types[50]
1901
+ #define SWIGTYPE_p_range_correction_list_t swig_types[51]
1902
+ #define SWIGTYPE_p_s16_t swig_types[52]
1903
+ #define SWIGTYPE_p_s32_t swig_types[53]
1904
+ #define SWIGTYPE_p_s8_t swig_types[54]
1905
+ #define SWIGTYPE_p_satellites_t swig_types[55]
1906
+ #define SWIGTYPE_p_self_t swig_types[56]
1907
+ #define SWIGTYPE_p_std__vectorT_std__pairT_int_SBAS_SpaceNodeT_double_t__Satellite_const_p_t_t swig_types[57]
1908
+ #define SWIGTYPE_p_super_t swig_types[58]
1909
+ #define SWIGTYPE_p_swig__GC_VALUE swig_types[59]
1910
+ #define SWIGTYPE_p_u16_t swig_types[60]
1911
+ #define SWIGTYPE_p_u32_t swig_types[61]
1912
+ #define SWIGTYPE_p_u8_t swig_types[62]
1913
+ #define SWIGTYPE_p_uint_t swig_types[63]
1914
+ #define SWIGTYPE_p_unsigned_int swig_types[64]
1915
+ #define SWIGTYPE_p_xyz_t swig_types[65]
1916
+ static swig_type_info *swig_types[67];
1917
+ static swig_module_info swig_module = {swig_types, 66, 0, 0, 0, 0};
1919
1918
  #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1920
1919
  #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1921
1920
 
@@ -6654,7 +6653,16 @@ SWIGINTERN VALUE
6654
6653
  _wrap_Time_leap_second_events_get(VALUE self) {
6655
6654
  VALUE _val;
6656
6655
 
6657
- _val = SWIG_NewPointerObj(SWIG_as_voidptr(GPS_Time< double >::leap_second_events), SWIGTYPE_p_GPS_TimeT_double_t__leap_second_event_t, 0 );
6656
+ {
6657
+ _val = rb_ary_new2(sizeof(GPS_Time< double >::leap_second_events) / sizeof(GPS_Time< double >::leap_second_events[0]));
6658
+ for(std::size_t i(0); i < sizeof(GPS_Time< double >::leap_second_events) / sizeof(GPS_Time< double >::leap_second_events[0]); ++i){
6659
+ rb_ary_push(_val,
6660
+ rb_ary_new3(3,
6661
+ SWIG_From_int (GPS_Time< double >::leap_second_events[i].corrected.week),
6662
+ swig::from(GPS_Time< double >::leap_second_events[i].corrected.seconds),
6663
+ SWIG_From_int (GPS_Time< double >::leap_second_events[i].leap_seconds)));
6664
+ }
6665
+ }
6658
6666
  return _val;
6659
6667
  }
6660
6668
 
@@ -27470,7 +27478,6 @@ static swig_type_info _swigt__p_GPS_SpaceNodeT_double_t = {"_p_GPS_SpaceNodeT_do
27470
27478
  static swig_type_info _swigt__p_GPS_SpaceNodeT_double_t__Ionospheric_UTC_Parameters = {"_p_GPS_SpaceNodeT_double_t__Ionospheric_UTC_Parameters", "GPS_SpaceNode< double >::Ionospheric_UTC_Parameters *", 0, 0, (void*)0, 0};
27471
27479
  static swig_type_info _swigt__p_GPS_SpaceNodeT_double_t__SatelliteProperties__Ephemeris = {"_p_GPS_SpaceNodeT_double_t__SatelliteProperties__Ephemeris", "GPS_SpaceNode< double >::SatelliteProperties::Ephemeris *", 0, 0, (void*)0, 0};
27472
27480
  static swig_type_info _swigt__p_GPS_TimeT_double_t = {"_p_GPS_TimeT_double_t", "GPS_SpaceNode< double >::gps_time_t *|SBAS_SpaceNode< double >::gps_time_t *|GPS_Time< GLONASS_SpaceNode< double >::float_t > *|GPS_Time< GPS_Time< double >::float_t > *|GPS_Time< double > *", 0, 0, (void*)0, 0};
27473
- static swig_type_info _swigt__p_GPS_TimeT_double_t__leap_second_event_t = {"_p_GPS_TimeT_double_t__leap_second_event_t", "GPS_Time< double >::leap_second_event_t *", 0, 0, (void*)0, 0};
27474
27481
  static swig_type_info _swigt__p_GPS_TimeT_double_t__leap_year_prop_res_t = {"_p_GPS_TimeT_double_t__leap_year_prop_res_t", "GPS_Time< double >::leap_year_prop_res_t *", 0, 0, (void*)0, 0};
27475
27482
  static swig_type_info _swigt__p_GPS_User_PVTT_double_t = {"_p_GPS_User_PVTT_double_t", "GPS_User_PVT< double > *", 0, 0, (void*)0, 0};
27476
27483
  static swig_type_info _swigt__p_MatrixT_ComplexT_double_t_Array2D_DenseT_ComplexT_double_t_t_MatrixViewBaseT_t_t = {"_p_MatrixT_ComplexT_double_t_Array2D_DenseT_ComplexT_double_t_t_MatrixViewBaseT_t_t", "Matrix< Complex< double >,Array2D_Dense< Complex< double > > > *|Matrix< Complex< double >,Array2D_Dense< Complex< double > >,MatrixViewBase< > > *", 0, 0, (void*)0, 0};
@@ -27539,7 +27546,6 @@ static swig_type_info *swig_type_initial[] = {
27539
27546
  &_swigt__p_GPS_SpaceNodeT_double_t__Ionospheric_UTC_Parameters,
27540
27547
  &_swigt__p_GPS_SpaceNodeT_double_t__SatelliteProperties__Ephemeris,
27541
27548
  &_swigt__p_GPS_TimeT_double_t,
27542
- &_swigt__p_GPS_TimeT_double_t__leap_second_event_t,
27543
27549
  &_swigt__p_GPS_TimeT_double_t__leap_year_prop_res_t,
27544
27550
  &_swigt__p_GPS_User_PVTT_double_t,
27545
27551
  &_swigt__p_MatrixT_ComplexT_double_t_Array2D_DenseT_ComplexT_double_t_t_MatrixViewBaseT_t_t,
@@ -27608,7 +27614,6 @@ static swig_cast_info _swigc__p_GPS_SpaceNodeT_double_t[] = { {&_swigt__p_GPS_S
27608
27614
  static swig_cast_info _swigc__p_GPS_SpaceNodeT_double_t__Ionospheric_UTC_Parameters[] = { {&_swigt__p_GPS_Ionospheric_UTC_ParametersT_double_t, _p_GPS_Ionospheric_UTC_ParametersT_double_tTo_p_GPS_SpaceNodeT_double_t__Ionospheric_UTC_Parameters, 0, 0}, {&_swigt__p_GPS_SpaceNodeT_double_t__Ionospheric_UTC_Parameters, 0, 0, 0},{0, 0, 0, 0}};
27609
27615
  static swig_cast_info _swigc__p_GPS_SpaceNodeT_double_t__SatelliteProperties__Ephemeris[] = { {&_swigt__p_GPS_SpaceNodeT_double_t__SatelliteProperties__Ephemeris, 0, 0, 0}, {&_swigt__p_GPS_EphemerisT_double_t, _p_GPS_EphemerisT_double_tTo_p_GPS_SpaceNodeT_double_t__SatelliteProperties__Ephemeris, 0, 0},{0, 0, 0, 0}};
27610
27616
  static swig_cast_info _swigc__p_GPS_TimeT_double_t[] = { {&_swigt__p_GPS_TimeT_double_t, 0, 0, 0},{0, 0, 0, 0}};
27611
- static swig_cast_info _swigc__p_GPS_TimeT_double_t__leap_second_event_t[] = { {&_swigt__p_GPS_TimeT_double_t__leap_second_event_t, 0, 0, 0},{0, 0, 0, 0}};
27612
27617
  static swig_cast_info _swigc__p_GPS_TimeT_double_t__leap_year_prop_res_t[] = { {&_swigt__p_GPS_TimeT_double_t__leap_year_prop_res_t, 0, 0, 0},{0, 0, 0, 0}};
27613
27618
  static swig_cast_info _swigc__p_GPS_User_PVTT_double_t[] = { {&_swigt__p_GPS_User_PVTT_double_t, 0, 0, 0},{0, 0, 0, 0}};
27614
27619
  static swig_cast_info _swigc__p_MatrixT_ComplexT_double_t_Array2D_DenseT_ComplexT_double_t_t_MatrixViewBaseT_t_t[] = { {&_swigt__p_MatrixT_ComplexT_double_t_Array2D_DenseT_ComplexT_double_t_t_MatrixViewBaseT_t_t, 0, 0, 0},{0, 0, 0, 0}};
@@ -27677,7 +27682,6 @@ static swig_cast_info *swig_cast_initial[] = {
27677
27682
  _swigc__p_GPS_SpaceNodeT_double_t__Ionospheric_UTC_Parameters,
27678
27683
  _swigc__p_GPS_SpaceNodeT_double_t__SatelliteProperties__Ephemeris,
27679
27684
  _swigc__p_GPS_TimeT_double_t,
27680
- _swigc__p_GPS_TimeT_double_t__leap_second_event_t,
27681
27685
  _swigc__p_GPS_TimeT_double_t__leap_year_prop_res_t,
27682
27686
  _swigc__p_GPS_User_PVTT_double_t,
27683
27687
  _swigc__p_MatrixT_ComplexT_double_t_Array2D_DenseT_ComplexT_double_t_t_MatrixViewBaseT_t_t,
@@ -158,6 +158,16 @@ static std::string inspect_str(const VALUE &v){
158
158
  %typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER) const std::tm & {
159
159
  $1 = (TYPE($input) == T_ARRAY) ? 1 : 0;
160
160
  }
161
+ %typemap(varout,fragment="SWIG_Traits_frag(FloatT)") leap_second_event_t [] {
162
+ $result = rb_ary_new2(sizeof($1) / sizeof($1[0]));
163
+ for(std::size_t i(0); i < sizeof($1) / sizeof($1[0]); ++i){
164
+ rb_ary_push($result,
165
+ rb_ary_new3(3,
166
+ SWIG_From(int)($1[i].corrected.week),
167
+ swig::from($1[i].corrected.seconds),
168
+ SWIG_From(int)($1[i].leap_seconds)));
169
+ }
170
+ }
161
171
  #endif
162
172
  %ignore canonicalize();
163
173
  %ignore GPS_Time(const int &_week, const float_t &_seconds);
@@ -759,6 +759,10 @@ __RINEX_CLK_TEXT__
759
759
  puts "Measurement time: #{t_meas.to_a} (a.k.a #{"%d/%d/%d %02d:%02d:%02d UTC"%[*t_meas.c_tm]})"
760
760
  expect(t_meas.c_tm).to eq([2015, 6, 15, 23, 53, 33])
761
761
  expect(GPS::Time::new(0, t_meas.serialize)).to eq(t_meas)
762
+ expect(t_meas.leap_seconds).to eq(sn.iono_utc.delta_t_LS)
763
+ expect(GPS::Time::leap_second_events.select{|wn, sec, leap|
764
+ t_meas >= GPS::Time::new(wn, sec)
765
+ }[0][2]).to eq(sn.iono_utc.delta_t_LS)
762
766
 
763
767
  sn.update_all_ephemeris(t_meas)
764
768
 
@@ -29,15 +29,24 @@ class Receiver
29
29
  return (eph.valid?(t) ? eph : nil)
30
30
  end
31
31
 
32
- def attach_online_ephemeris(uri_template = nil)
33
- if (!uri_template) || (uri_template =~ /^\s*$/) then
34
- uri_template = "ftp://gssc.esa.int/gnss/data/daily/%Y/brdc/BRDC00IGS_R_%Y%j0000_01D_MN.rnx.gz"
35
- end
32
+ def attach_online_ephemeris(uri_template = [nil])
33
+ uri_template = uri_template.collect{|v|
34
+ if (!v) || (v =~ /^\s*$/) then
35
+ "ftp://gssc.esa.int/gnss/data/daily/%Y/brdc/BRDC00IGS_R_%Y%j0000_01D_MN.rnx.gz"
36
+ else
37
+ v
38
+ end
39
+ }.uniq
36
40
  loader = proc{|t_meas|
37
41
  utc = Time::utc(*t_meas.c_tm)
38
- uri = URI::parse(utc.strftime(uri_template))
39
- self.parse_rinex_nav(uri)
40
- uri
42
+ uri_template.each{|v|
43
+ uri = URI::parse(utc.strftime(v))
44
+ begin
45
+ self.parse_rinex_nav(uri)
46
+ rescue Net::FTPError, Net::HTTPExceptions => e
47
+ $stderr.puts "Skip to read due to %s (%s)"%[e.inspect.gsub(/[\r\n]/, ' '), uri]
48
+ end
49
+ }
41
50
  }
42
51
  run_orig = self.method(:run)
43
52
  eph_list = {}
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GPS_PVT
4
- VERSION = "0.8.2"
4
+ VERSION = "0.8.3"
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.8.2
4
+ version: 0.8.3
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-11-20 00:00:00.000000000 Z
11
+ date: 2022-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyserial