예제 #1
0
    def SurroundingRegion(self,
                          Point,
                          UTCTimestamp,
                          MaxDistanceDifference=100,
                          Above25000=True):
        Return = []

        for Waypoint in self.Waypoints:
            DistanceToWaypointKilometers = Geography.DistanceBetweenPoints(
                Waypoint["Position"], Point)

            # if the time difference is < 1 hour, the distance is < 50, and the altitude is > 25000
            if (
                (Above25000 and Waypoint["Altitude"] > 25000) or
                (not Above25000 and Waypoint["Altitude"] < 25000)
            ) and DistanceToWaypointKilometers <= MaxDistanceDifference and abs(
                    UTCTimestamp - Waypoint["Timestamp"]) < 3600:
                WindVector = Geometry.VectorFromSpeedBearing(
                    Waypoint["WindSpeed"], Waypoint["WindDirection"])
                Return.append(WindVector)

        return Return