gnss-converters 0.1.5 → 0.1.6
raw patch · 2 files changed
+9/−7 lines, 2 files
Files
- gnss-converters.cabal +1/−1
- src/Data/RTCM3/SBP.hs +8/−6
gnss-converters.cabal view
@@ -1,5 +1,5 @@ name: gnss-converters-version: 0.1.5+version: 0.1.6 synopsis: GNSS Converters. description: Haskell bindings for GNSS converters. homepage: http://github.com/swift-nav/gnss-converters
src/Data/RTCM3/SBP.hs view
@@ -16,7 +16,6 @@ import BasicPrelude import Control.Lens-import Data.Bits import Data.Time import Data.Word import Data.RTCM3@@ -48,16 +47,19 @@ toL :: GpsL1Observation -> GpsL1ExtObservation -> CarrierPhase toL l1 l1e = CarrierPhase- { _carrierPhase_i = fromIntegral $ iint `shiftR` 8- , _carrierPhase_f = fromIntegral $ iint .&. 0xFF+ { _carrierPhase_i = fromIntegral li+ , _carrierPhase_f = fromIntegral lf } where p = 0.02 * fromIntegral (l1 ^. gpsL1Observation_pseudorange) + 299792.458 * fromIntegral (l1e ^. gpsL1ExtObservation_ambiguity) lm :: Double lm = p + 0.0005 * fromIntegral (l1 ^. gpsL1Observation_carrierMinusCode)- l = (lm - 22e6) / 0.190293673- iint :: Int64- iint = - round (l * 255.0)+ l = -lm / (299792458.0 / 1.57542e9)+ li :: Int32+ li = floor (l)+ lf :: Word8+ lf = truncate ((l - fromIntegral li) * 256)+ toCn0 :: GpsL1ExtObservation -> Word8 toCn0 = (^. gpsL1ExtObservation_cnr)