def getDictQZSSL1CANavigationMessageFromBinary(binaryMessage): sfID = int(binaryMessage[49:52], 2) svID = int(binaryMessage[62:68], 2) preamble = int(binaryMessage[0:8], 2) if preamble != 0b10001011: raise ValueError( 'Preambule value is wrong! Make sure your file has the correct format (check header commas).' ) dictToUse = {} if sfID in L1CAQZSSDictEphemeris: dictToUse = L1CAQZSSDictEphemeris[sfID] else: if svID in [1, 2, 3, 4, 5, 6, 7, 8, 9]: dictToUse = L1CADictAlmanac if svID == 51: dictToUse = L1CADictAlmanacEpochAndHealth elif svID == 55: dictToUse = L1CADictSpecialMessage elif svID in [56, 61]: dictToUse = L1CADictIONOAndUTC else: dictToUse = L1CADictReserved return utility.fillDict(binaryMessage, dictToUse)
def getDictGalileoINavigationMessage(message): binaryMessage = decodeGalileoINavigationMessageInBinary(message, 256) dictToUse = {} type = int(binaryMessage[2:8], 2) if type in INavDictAll: dictToUse = INavDictAll[type] else: return dictToUse return utility.fillDict(binaryMessage, dictToUse)
def getDictGalileoFNavigationMessage(message): binaryMessage = utility.convertToBinaryNavigationMessage(message, 256) dictToUse = {} type = int(binaryMessage[0:6], 2) if type in FNavDictAll: dictToUse = FNavDictAll[type] else: return dictToUse return utility.fillDict(binaryMessage, dictToUse)
def getDictSBASL1NavigationMessage(message): binaryMessage = utility.convertToBinaryNavigationMessage(message, 256) dictToUse = {} type = int(binaryMessage[8:14], 2) if type == 24: dictToUse = SBASL1NavDict24[int(binaryMessage[120], 2)] elif type == 25: dictToUse = SBASL1NavDict25[int(binaryMessage[14], 2) << 1 | int(binaryMessage[120], 2)] elif type in SBASL1NavDictAll: dictToUse = SBASL1NavDictAll[type] else: return dictToUse return utility.fillDict(binaryMessage, dictToUse)
def getDictQZSSL1SNavigationMessageFromBinary(binaryMessage): msgType = int(binaryMessage[8:14], 2) dictToUse = L1SDictBase if msgType == 47: dictToUse = L1SDictStationInfo elif msgType == 48: dictToUse = L1SDictPrnMask elif msgType == 49: dictToUse = L1SDictDataIssueNumber elif msgType == 50: dictToUse = L1SDictDGPSCorrection elif msgType == 51: dictToUse = L1SDictHealth return utility.fillDict(binaryMessage, dictToUse)
def getDictGLONASSNavigationMessage(message, frameId): binaryMessage = utility.convertToBinaryNavigationMessage(message, 96) stringID = int(binaryMessage[1:5], 2) dictToUse = {} if stringID in GLONASSNavDictAll: dictToUse = GLONASSNavDictAll[stringID] elif stringID == 14 and frameId == 5: dictToUse = GLONASSNavDictF5String14 elif stringID == 15 and frameId == 5: dictToUse = GLONASSNavDictF5String15 elif stringID in [6, 8, 10, 12, 14]: dictToUse = GLONASSNavDictAlmanacP1 elif stringID in [7, 9, 11, 13, 15]: dictToUse = GLONASSNavDictAlmanacP2 else: return dictToUse return utility.fillDict(binaryMessage, dictToUse)