-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-AATC now supports using the Open Weather Map service to lookup the weather at a given coordinate for a flight in order to make ajustments to the estimated flight time. Two settings can be used: 1. Estimate speed from start and end coordinate. 2. Estimate speed from each pair of coordinates. 1. This is less accurate for waypoint ETA, however it requires fewer requests and will be similarly accurate for total ETA. (Default) 2. This method queries the wind speed for each set of coordinates. The program will take longer to run due to multiple requests and must sleep between requests in order to not exceed the request limit.
- Loading branch information
Scratchcat1
authored
Nov 26, 2017
1 parent
63f0e68
commit 20164b3
Showing
10 changed files
with
137 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import pyowm, AATC_Coordinate, math,time | ||
|
||
def Get_OWM(): | ||
owm = pyowm.OWM('5b943c4857a45d75ef7ee9b301666fa8') | ||
|
||
class OWM_Control: | ||
def __init__(self): | ||
self.owm = pyowm.OWM('5b943c4857a45d75ef7ee9b301666fa8') | ||
|
||
def Get_Ajusted_Speed(self,CoordA,CoordB,Speed,At_Time = time.time()): | ||
try: | ||
|
||
forecast = self.owm.daily_forecast_at_coords(CoordA.Get_Y(),CoordA.Get_X()) | ||
wind = forecast.get_weather_at(int(At_Time)).get_wind() | ||
|
||
bearing = AATC_Coordinate.GetBearing(CoordA,CoordB) | ||
wind_bearing = AATC_Coordinate.Reverse_Angle(wind["deg"]) | ||
|
||
Vx = Speed*math.sin(AATC_Coordinate.toRadian(bearing))+ wind["speed"]*math.sin(AATC_Coordinate.toRadian(wind_bearing)) | ||
Vy = Speed*math.cos(AATC_Coordinate.toRadian(bearing))+ wind["speed"]*math.cos(AATC_Coordinate.toRadian(wind_bearing)) | ||
V = math.sqrt(Vx**2+Vy**2) | ||
return V | ||
except: | ||
return Speed | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20164b3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-Added TimeWarp feature to AATC_Monitor. Movement now independant of framerate.