262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
|
# File 'lib/gps_pvt/rtcm3.rb', line 262
def ranges
res = {
:sat => select{|v, df| df == 9}.transpose[0],
:pseudo_range_rem => select{|v, df| df == 11}.transpose[0],
}
add_proc = proc{|k, df, base|
values = select{|v, df_| df_ == df}
next if values.empty?
res[k] = values.transpose[0]
res[k] = res[k].zip(res[base]).collect{|a, b| (a + b) rescue nil} if base
}
add_proc.call(:pseudo_range, 14, :pseudo_range_rem)
suffix = res[:pseudo_range] ? "" : "_rem"
base = "pseudo_range#{suffix}".to_sym
add_proc.call("phase_range#{suffix}".to_sym, 12, base)
add_proc.call(:cn, 15)
add_proc.call("pseudo_range_L2#{suffix}".to_sym, 17, base)
add_proc.call("phase_range_L2#{suffix}".to_sym, 18, base)
add_proc.call(:cn_L2, 20)
res
end
|