285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
|
# File 'lib/gps_pvt/rtcm3.rb', line 285
def ranges
res = {
:sat => select{|v, df| df == 38}.transpose[0],
:freq_ch => select{|v, df| df == 40}.transpose[0],
:pseudo_range_rem => select{|v, df| df == 41}.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, 44, :pseudo_range_rem)
suffix = res[:pseudo_range] ? "" : "_rem"
base = "pseudo_range#{suffix}".to_sym
add_proc.call("phase_range#{suffix}".to_sym, 42, base)
add_proc.call(:cn, 45)
add_proc.call("pseudo_range_L2#{suffix}".to_sym, 47, base)
add_proc.call("phase_range_L2#{suffix}".to_sym, 48, base)
add_proc.call(:cn_L2, 50)
res
end
|