print('==================== find the run-ways ==================== ') runWaysDB = RunWayDataBase() if runWaysDB.read(): print('runways DB correctly read') else: raise ValueError('runways not read correctly') print('==================== find the run-ways ==================== ') for arrivalRunway in runWaysDB.getRunWays(): print('==================== run-way ==================== ') print(arrivalRunway) airportIcaoCode = arrivalRunway.getAirportICAOcode() airport = airportsDb.getAirportFromICAOCode(airportIcaoCode) print('==================== airport ==================== ') print(airport) climbRamp = ClimbRamp(runway=arrivalRunway, aircraft=acA320, departureAirport=airport) climbRamp.buildClimbRamp() climbRamp.createXlsxOutputFile() descentSlope = DescentGlideSlope(runway=arrivalRunway, aircraft=acA320, arrivalAirport=airport) descentSlope.buildGlideSlope() descentSlope.createXlsxOutputFile()
aircraft.initStateVector( elapsedTimeSeconds=elapsedTimeSeconds, trueAirSpeedMetersSecond=tasMetersPerSecond, altitudeMeanSeaLevelMeters=firstGlideSlopeWayPoint. getAltitudeMeanSeaLevelMeters(), deltaDistanceFlownMeters=0.0) aircraft.setApproachConfiguration(0.0) aircraftMassKilograms = 49000.0 aircraft.setAircraftMassKilograms(aircraftMassKilograms) print( '===================== final 3 degrees descending glide slope ================' ) descentGlideSlope = DescentGlideSlope(runway=arrivalRunway, aircraft=aircraft, arrivalAirport=arrivalAirport, descentGlideSlopeDegrees=3.0) descentGlideSlope.buildGlideSlope(elapsedTimeSeconds=0.0, initialWayPoint=firstGlideSlopeWayPoint, flownDistanceMeters=300000.0, distanceStillToFlyMeters=10000.0) print('================= create output files =========================') descentGlideSlope.createXlsxOutputFile() descentGlideSlope.createKmlOutputFile() aircraft.createStateVectorOutputFile() print('===================== end of simulation ================')
def test_DescentGlideSlope_Two(self): atmosphere = Atmosphere() earth = Earth() print( '==================== three degrees Descent Slope Start ==================== ' + time.strftime("%c")) acBd = BadaAircraftDatabase() aircraftICAOcode = 'A320' aircraft = None if acBd.read(): if (acBd.aircraftExists(aircraftICAOcode) and acBd.aircraftPerformanceFileExists(aircraftICAOcode)): print( '==================== aircraft found ==================== ' + time.strftime("%c")) aircraft = BadaAircraft( ICAOcode=aircraftICAOcode, aircraftFullName=acBd.getAircraftFullName( aircraftICAOcode), badaPerformanceFilePath=acBd.getAircraftPerformanceFile( aircraftICAOcode), atmosphere=atmosphere, earth=earth) aircraft.dump() assert not (aircraft is None) print('==================== runways database ==================== ' + time.strftime("%c")) runWaysDatabase = RunWayDataBase() assert runWaysDatabase.read() runway = runWaysDatabase.getFilteredRunWays(airportICAOcode='LFPG', runwayName='08L') print(runway) print("=========== airports =========== " + time.strftime("%c")) airportsDB = AirportsDatabase() assert (airportsDB.read()) CharlesDeGaulle = airportsDB.getAirportFromICAOCode('LFPG') print(CharlesDeGaulle) print("=========== descent glide slope =========== " + time.strftime("%c")) threeDegreesGlideSlope = DescentGlideSlope( runway=runway, aircraft=aircraft, arrivalAirport=CharlesDeGaulle) threeDegreesGlideSlope.buildSimulatedGlideSlope( descentGlideSlopeSizeNautics=5.0) print("=========== DescentGlideSlope =========== " + time.strftime("%c")) for node in threeDegreesGlideSlope.getVertices(): print(node) print("=========== DescentGlideSlope length =========== " + time.strftime("%c")) print("get number of vertices= {0}".format( threeDegreesGlideSlope.getNumberOfVertices())) print("get number of edges= {0}".format( threeDegreesGlideSlope.getNumberOfEdges())) print('Glide Slope overall length= {0} meters'.format( threeDegreesGlideSlope.computeLengthMeters())) threeDegreesGlideSlope.createKmlOutputFile() threeDegreesGlideSlope.createXlsxOutputFile() print( '==================== three degrees Descent Slope End ==================== ' + time.strftime("%c"))
def test_DescentGlideSlope_One(self): atmosphere = Atmosphere() earth = Earth() print( '==================== three degrees Descent Slope Start ==================== ' + time.strftime("%c")) acBd = BadaAircraftDatabase() aircraftICAOcode = 'A320' aircraft = None if acBd.read(): if (acBd.aircraftExists(aircraftICAOcode) and acBd.aircraftPerformanceFileExists(aircraftICAOcode)): print( '==================== aircraft found ==================== ' + time.strftime("%c")) aircraft = BadaAircraft( ICAOcode=aircraftICAOcode, aircraftFullName=acBd.getAircraftFullName( aircraftICAOcode), badaPerformanceFilePath=acBd.getAircraftPerformanceFile( aircraftICAOcode), atmosphere=atmosphere, earth=earth) aircraft.dump() assert not (aircraft is None) print('==================== runways database ==================== ' + time.strftime("%c")) runWaysDatabase = RunWayDataBase() assert runWaysDatabase.read() runway = runWaysDatabase.getFilteredRunWays(airportICAOcode='LFML', runwayName='') print(runway) print("=========== airports =========== " + time.strftime("%c")) airportsDB = AirportsDatabase() assert (airportsDB.read()) MarseilleMarignane = airportsDB.getAirportFromICAOCode('LFML') print(MarseilleMarignane) print("=========== descent glide slope =========== " + time.strftime("%c")) threeDegreesGlideSlope = DescentGlideSlope( runway=runway, aircraft=aircraft, arrivalAirport=MarseilleMarignane) print( "=========== DescentGlideSlope build the glide slope =========== " + time.strftime("%c")) # threeDegreesGlideSlope.buildGlideSlope(deltaTimeSeconds = 0.1, # elapsedTimeSeconds = 0.0, # initialWayPoint = None, # flownDistanceMeters = 0.0, # distanceStillToFlyMeters = 100000.0, # distanceToLastFixMeters = 100000.0) threeDegreesGlideSlope.buildSimulatedGlideSlope( descentGlideSlopeSizeNautics=5.0) print("=========== DescentGlideSlope =========== " + time.strftime("%c")) for node in threeDegreesGlideSlope.getVertices(): print(node) print("=========== DescentGlideSlope length =========== " + time.strftime("%c")) print("get number of vertices= {0}".format( threeDegreesGlideSlope.getNumberOfVertices())) print("get number of edges= {0}".format( threeDegreesGlideSlope.getNumberOfEdges())) print('Glide Slope overall length= {0} meters'.format( threeDegreesGlideSlope.computeLengthMeters())) threeDegreesGlideSlope.createKmlOutputFile() threeDegreesGlideSlope.createXlsxOutputFile() print( '==================== three degrees Descent Slope End ==================== ' + time.strftime("%c"))
def test_turn_leg(self): print('==================== Turn Leg ==================== ' + time.strftime("%c")) print('==================== aircraft found ==================== ' + time.strftime("%c")) self.aircraft.dump() print('==================== Get Airport ==================== ' + time.strftime("%c")) airportsDB = AirportsDatabase() assert airportsDB.read() print( '==================== Get Arrival Airport ==================== ' + time.strftime("%c")) Lisbonne = airportsDB.getAirportFromICAOCode('LPPT') print(Lisbonne) print('==================== find the run-ways ==================== ' + time.strftime("%c")) runWaysDatabase = RunWayDataBase() if runWaysDatabase.read(): print('runways DB correctly read') print('==================== take off run-way ==================== ' + time.strftime("%c")) arrivalRunway = runWaysDatabase.getFilteredRunWays( airportICAOcode='LPPT', runwayName='') print(arrivalRunway) print('==================== Ground run ==================== ' + time.strftime("%c")) groundRun = GroundRunLeg(runway=arrivalRunway, aircraft=self.aircraft, airport=Lisbonne) touchDownWayPoint = groundRun.computeTouchDownWayPoint() print(touchDownWayPoint) groundRun.buildDepartureGroundRun(deltaTimeSeconds=1.0, elapsedTimeSeconds=0.0, distanceStillToFlyMeters=0.0, distanceToLastFixMeters=0.0) print('==================== Climb Ramp ==================== ' + time.strftime("%c")) initialWayPoint = groundRun.getLastVertex().getWeight() descentGlideSlope = DescentGlideSlope(runway=arrivalRunway, aircraft=self.aircraft, arrivalAirport=Lisbonne, descentGlideSlopeDegrees=3.0) ''' if there is a fix nearer to 5 nautics of the touch-down then limit size of simulated glide slope ''' descentGlideSlope.buildSimulatedGlideSlope( descentGlideSlopeSizeNautics=5.0) descentGlideSlope.createKmlOutputFile() firstGlideSlopeWayPoint = descentGlideSlope.getVertex(v=0).getWeight() print('==================== Climb Ramp ==================== ' + time.strftime("%c")) initialWayPoint = groundRun.getLastVertex().getWeight() print(' ================== turn leg start =============== ') wayPointsDb = WayPointsDatabase() assert (wayPointsDb.read()) Exona = wayPointsDb.getWayPoint('EXONA') Rosal = wayPointsDb.getWayPoint('ROSAL') print(Rosal.getBearingDegreesTo(Exona)) initialHeadingDegrees = arrivalRunway.getTrueHeadingDegrees() lastTurnLeg = TurnLeg(initialWayPoint=firstGlideSlopeWayPoint, finalWayPoint=Exona, initialHeadingDegrees=initialHeadingDegrees, aircraft=self.aircraft, reverse=True) deltaTimeSeconds = 1.0 lastTurnLeg.buildNewSimulatedArrivalTurnLeg( deltaTimeSeconds=deltaTimeSeconds, elapsedTimeSeconds=0.0, distanceStillToFlyMeters=0.0, simulatedAltitudeSeaLevelMeters=firstGlideSlopeWayPoint. getAltitudeMeanSeaLevelMeters(), flightPathAngleDegrees=3.0) lastTurnLeg.createKmlOutputFile() descentGlideSlope.addGraph(lastTurnLeg) descentGlideSlope.createXlsxOutputFile() descentGlideSlope.createKmlOutputFile() print(' ================== turn leg end =============== ')