Module: GPS_PVT::RTCM3::Packet::MSM1_2_3

Includes:
MSM
Defined in:
lib/gps_pvt/rtcm3.rb

Constant Summary

Constants included from MSM

GPS_PVT::RTCM3::Packet::MSM::SPEED_OF_LIGHT

Instance Method Summary collapse

Methods included from MSM_Header

#more_data?, #property

Instance Method Details

#rangesObject



391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
# File 'lib/gps_pvt/rtcm3.rb', line 391

def ranges
  sats, cells, offset = property.values_at(:sats, :cells, :header_items)
  nsat, ncell = [sats.size, cells.size]
  res = {:sat_sig => cells}
  range_rough = cells.collect{|sat, sig| # DF398
    self[offset + sats.find_index(sat)][0]
  }
  add_proc = proc{|idx_cell|
    values = self[offset + (nsat * 1) + (ncell * idx_cell), ncell]
    next if values.empty? 
    k = {400 => :pseudo_range_rem, 401 => :phase_range_rem}[values[0][1]]
    next unless k
    res[k] = values.zip(range_rough).collect{|(v, df), v_base|
      ((v_base + v) * SPEED_OF_LIGHT) rescue nil
    }
  }
  add_proc.call(0)
  add_proc.call(1)
  res[:halfc_amb] = self[-ncell, ncell].transpose[0] if self[-1][1] == 420
  res
end