def check(groundspeed, bearing, positions): print("Aircraft groundspeed: %f Bearing: %f" % (groundspeed, bearing)) for index, aircraftPos in enumerate(positions): aircraftECEF = Geo.sphericalToECEF(aircraftPos) aircraftECEFVel = Geo.ecefVelocities(aircraftPos, Geo.knotsToKms(groundspeed), bearing) LOSSpeed = Geo.LOSSpeed(satelliteInfos[index]['XYZ'], satelliteInfos[index]['Velocity'], aircraftECEF, aircraftECEFVel) pingRadius = Geo.greatCircleDistance(aircraftPos, satelliteInfos[index]['LatLon']) print(aircraftPos, Geo.KmsToKmh(LOSSpeed), Geo.KmsToKnots(LOSSpeed), Geo.kmToNm(pingRadius))
def groundCheckGeoSat(groundspeed, bearing, aircraftPos): aircraftECEF = Geo.sphericalToECEF(aircraftPos) aircraftECEFVel = Geo.ecefVelocities(aircraftPos, groundspeed, bearing) LOSSpeed = Geo.LOSSpeed(satelliteGeo['XYZ'], satelliteGeo['Velocity'], aircraftECEF, aircraftECEFVel) print(Geo.KmsToKnots(LOSSpeed), Geo.KmsToKnots(LOSSpeed) * 2.82)
# GlobusMax digitized southern track print('GlobusMax 454 Southern Check') track5 = [(-3.28,93.25), (-10.67,91.68), (-18.18,90.72), (-25.71,90.10), (-37.13,88.91)] lastBearing = 0.0 for index, pos in enumerate(track5): if index < len(track5)-1: bearing = Geo.bearing(pos, track5[index+1]) lastBearing = bearing else: bearing = lastBearing aircraftECEF = Geo.sphericalToECEF(pos) aircraftECEFVel = Geo.ecefVelocities(pos, Geo.knotsToKms(454), bearing) LOSSpeed = Geo.LOSSpeed(satelliteInfos[index]['XYZ'], satelliteInfos[index]['Velocity'], aircraftECEF, aircraftECEFVel) * -1.0 print(pos, bearing, Geo.kmToNm(Geo.greatCircleDistance(pos,satelliteInfos[index]['LatLon'])), Geo.KmsToKnots(LOSSpeed)) print('GlobusMax 394 Southern Check') track6 = [(0.63,93.47), (-5.92,93.69), (-12.47,94.01), (-18.73,96.02), (-28.28,99.06)] lastBearing = 0.0 for index, pos in enumerate(track6): if index < len(track6)-1: bearing = Geo.bearing(pos, track6[index+1]) lastBearing = bearing else: bearing = lastBearing aircraftECEF = Geo.sphericalToECEF(pos) aircraftECEFVel = Geo.ecefVelocities(pos, Geo.knotsToKms(394), bearing) LOSSpeed = Geo.LOSSpeed(satelliteInfos[index]['XYZ'], satelliteInfos[index]['Velocity'], aircraftECEF, aircraftECEFVel) * -1.0