def test_flight_path_fly(self):
        flyAndGenerateConfig = FlightPath(route=self.str_route,
                                          aircraftICAOcode='A320',
                                          RequestedFlightLevel=330,
                                          cruiseMach=0.82,
                                          takeOffMassKilograms=68000.0,
                                          windSpeedMetersPerSecond=25 *
                                          Knots2MetersPerSecond,
                                          windDirectionDegrees=25)

        flyAndGenerateConfig.fly()
    def test_route(self):

        print("=========== Flight Plan start  =========== ")

        strRoute = 'ADEP/EGLL/27L-COMPTON-KENET-GAVGO-DIKAS-STRUMBLE-SLANY-'
        strRoute += 'ABAGU-TIPUR-SHANNON-MALOT-RIKAL-EBONY-SEAER-SCARS-KENNEBUNK-ADES/KJFK/04L'

        strRoute = 'ADEP/EGLL/27L-MID-DRAKE-SITET-ETRAT-DVL-LGL-SORAP-BENAR-VANAD-AMB-BALAN-LMG-VELIN-SAU-ENSAC-ADES/LFBM/27'

        flightPath = FlightPath(route=strRoute,
                                aircraftICAOcode='A320',
                                RequestedFlightLevel=310,
                                cruiseMach=0.78,
                                takeOffMassKilograms=76000.0)
        '''
        RFL:    FL 310 => 31000 feet
        Cruise Speed    => Mach 0.78                                    
        Take Off Weight    72000 kgs    
        '''
        print("=========== Flight Plan compute  =========== ")

        t0 = time.clock()
        print('time zero= ' + str(t0))
        lengthNauticalMiles = flightPath.computeLengthNauticalMiles()
        print('flight path length= {0} nautics '.format(lengthNauticalMiles))
        flightPath.computeFlight(deltaTimeSeconds=1.0)
        print('simulation duration= ' + str(time.clock() - t0) + ' seconds')

        print("=========== Flight Plan create output files  =========== ")
        flightPath.createFlightOutputFiles()
        print("=========== Flight Plan end  =========== ")
    def test_route(self):
        print("=========== Flight Plan start  =========== " +
              time.strftime("%c"))

        strRoute = 'ADEP/LFBD/11-COGNAC-FOUCO-DIBAG-LIMOGES-BEBIX-GUERE-LARON-KUKOR-'
        strRoute += 'MOULINS-PIBAT-DIJON-RESPO-DILAB-EPINAL-ADES/LFST/23'

        flightPath = FlightPath(route=strRoute,
                                aircraftICAOcode='A320',
                                RequestedFlightLevel=310,
                                cruiseMach=0.78,
                                takeOffMassKilograms=62000.0)
        '''
        RFL:    FL 310 => 31000 feet
        Cruise Speed    Mach 0.78                                    
        Take Off Weight    62000 kgs    
        '''
        print("=========== Flight Plan compute  =========== " +
              time.strftime("%c"))

        t0 = time.clock()
        print('time zero= ' + str(t0))
        lengthNauticalMiles = flightPath.computeLengthNauticalMiles()
        print(
            'flight path length= {0:.2f} nautics '.format(lengthNauticalMiles))
        flightPath.computeFlight(deltaTimeSeconds=1.0)
        print('simulation duration= ' + str(time.clock() - t0) + ' seconds')

        print("=========== Flight Plan create output files  =========== " +
              time.strftime("%c"))
        flightPath.createFlightOutputFiles()
        print("=========== Flight Plan end  =========== " +
              time.strftime("%c"))
Exemplo n.º 4
0
    def test_route(self):
    
    #sys.stdout = open('log.txt','w') #redirect all prints to this log file

        print "=========== Flight Plan start  =========== " + time.strftime("%c")
        
        strRoute = 'ADEP/CYMX/06-TAMKO-MATOR-DICEN-CHARLEVOIX-RIVIEREDULOUP-LOMSI-RESNO-NETKI-'
        strRoute += 'NIBOG-BELFAST-DUFFY-RINGA-SLYDA-ISLEOFMAN-KELLY-PENIL-ASNIP-MANCHESTER-'
        strRoute += 'DISAL-NAPEX-DOLAS-ENITO-DIBAL-BUKUT-LAMSO-EVELI-BASNO-PAMPUS-IVLUT-LUNIX-'
        strRoute += 'RENDI-EDUPO-NAPRO-DEPAD-AMOSU-MISGO-COLA-ROLIS-'
        strRoute += 'ADES/EDDF/25C'
        flightPath = FlightPath(route = strRoute, 
                                aircraftICAOcode = 'A310',
                                RequestedFlightLevel = 390, 
                                cruiseMach = 0.83, 
                                takeOffMassKilograms = 120000.0)
        '''
        RFL:    FL 310 => 31000 feet
        Cruise Speed    Mach 0.78                                    
        Take Off Weight    62000 kgs    
        '''
        print "=========== Flight Plan compute  =========== " + time.strftime("%c")
        
        t0 = time.clock()
        print 'time zero= ' + str(t0)
        lengthNauticalMiles = flightPath.computeLengthNauticalMiles()
        print 'flight path length= {0:.2f} nautics '.format(lengthNauticalMiles)
        flightPath.computeFlight(deltaTimeSeconds = 1.0)
        print 'simulation duration= ' + str(time.clock()-t0) + ' seconds'
        
        print "=========== Flight Plan create output files  =========== " + time.strftime("%c")
        flightPath.createFlightOutputFiles()
        print "=========== Flight Plan end  =========== " + time.strftime("%c")
    def test_route(self):
        print("=========== Flight Plan start  =========== " +
              time.strftime("%c"))

        strRoute = 'ADEP/LFBO-MENDE-MEZIN-LATAM-OTROT-ETREK-RUSIT-BULOL-LOGNI-MOKIP-DIJON-RESPO-DILAB-EPINAL-ADES/LFST'
        flightPath = FlightPath(route=strRoute,
                                aircraftICAOcode='A320',
                                RequestedFlightLevel=310,
                                cruiseMach=0.78,
                                takeOffMassKilograms=62000.0)
        '''
        RFL:    FL 310 => 31000 feet
        Cruise Speed    Mach 0.78                                    
        Take Off Weight    62000 kgs    
        '''
        print("=========== Flight Plan compute  =========== " +
              time.strftime("%c"))

        t0 = time.clock()
        print('time zero= ' + str(t0))
        lengthNauticalMiles = flightPath.computeLengthNauticalMiles()
        print(
            'flight path length= {0:.2f} nautics '.format(lengthNauticalMiles))
        flightPath.computeFlight(deltaTimeSeconds=1.0)
        print('simulation duration= ' + str(time.clock() - t0) + ' seconds')

        print("=========== Flight Plan create output files  =========== " +
              time.strftime("%c"))
        flightPath.createFlightOutputFiles()
        print("=========== Flight Plan end  =========== " +
              time.strftime("%c"))
    def test_route(self):

        print("=========== Flight Plan start  =========== ")

        strRoute = 'ADEP/LFPG-LATRA-LAMUT-LAKOB-OBEPA-LERGA'
        flightPath = FlightPath(route=strRoute,
                                aircraftICAOcode='A320',
                                RequestedFlightLevel=330,
                                cruiseMach=0.82,
                                takeOffMassKilograms=68000.0)
        '''
        RFL:    FL 310 => 31000 feet
        Cruise Speed    Mach 0.78                                    
        Take Off Weight    62000 kgs    
        '''
        print("=========== Flight Plan compute  =========== " +
              time.strftime("%c"))

        t0 = time.clock()
        print('time zero= ' + str(t0))
        lengthNauticalMiles = flightPath.computeLengthNauticalMiles()
        print(
            'flight path length= {0:.2f} nautics '.format(lengthNauticalMiles))
        flightPath.computeFlight(deltaTimeSeconds=1.0)
        print('simulation duration= ' + str(time.clock() - t0) + ' seconds')

        print("=========== Flight Plan create output files  =========== " +
              time.strftime("%c"))
        flightPath.createFlightOutputFiles()
        print("=========== Flight Plan end  =========== " +
              time.strftime("%c"))
Exemplo n.º 7
0
    def test_route(self):

        #sys.stdout = open('log.txt','w') #redirect all prints to this log file

        print "=========== Flight Plan start  =========== " + time.strftime(
            "%c")

        strRoute = 'ADEP/LEMD-ZMR-BARKO-ADES/LEVX'
        flightPath = FlightPath(route=strRoute,
                                aircraftICAOcode='A320',
                                RequestedFlightLevel=270,
                                cruiseMach=0.78,
                                takeOffMassKilograms=62000.0)
        '''
        RFL:    FL 310 => 31000 feet
        Cruise Speed    Mach 0.78                                    
        Take Off Weight    62000 kgs    
        '''
        print "=========== Flight Plan compute  =========== " + time.strftime(
            "%c")

        t0 = time.clock()
        print 'time zero= ' + str(t0)
        lengthNauticalMiles = flightPath.computeLengthNauticalMiles()
        print 'flight path length= {0:.2f} nautics '.format(
            lengthNauticalMiles)
        flightPath.computeFlight(deltaTimeSeconds=1.0)
        print 'simulation duration= ' + str(time.clock() - t0) + ' seconds'

        print "=========== Flight Plan create output files  =========== " + time.strftime(
            "%c")
        flightPath.createFlightOutputFiles()
        print "=========== Flight Plan end  =========== " + time.strftime("%c")
    def test_route(self):

        print("=========== Flight Plan start  =========== ")

        strRoute = 'ADEP/KJFK/31L-RIMBA-'
        strRoute += 'DELANCEY-ROKET-BINGHAMTON-ELMIRA-WOMAN-WELLSVILLE-VAIRS-JAMESTOWN-SURLY-COHOW-CARLETON-'
        strRoute += 'BENJO-GIPPER-JOLIET-MOLINE-POCIN-WAPEL-ACKLY-VOYUG-OTTUMWA-OHGEE-LAMONI-PAWNEE-HILL-'
        strRoute += 'PUEBLO-RATTLESNAKE-COCAN-RHYSS-TUBA-PEACH-ADES/KLAX/06L'

        flightPath = FlightPath(route=strRoute,
                                aircraftICAOcode='A320',
                                RequestedFlightLevel=380,
                                cruiseMach=0.78,
                                takeOffMassKilograms=76000.0)
        '''
        RFL:    FL 310 => 31000 feet
        Cruise Speed    => Mach 0.78                                    
        Take Off Weight    72000 kgs    
        '''
        print("=========== Flight Plan compute  =========== ")

        t0 = time.clock()
        print('time zero= ' + str(t0))
        lengthNauticalMiles = flightPath.computeLengthNauticalMiles()
        print('flight path length= {0} nautics '.format(lengthNauticalMiles))
        flightPath.computeFlight(deltaTimeSeconds=1.0)
        print('simulation duration= ' + str(time.clock() - t0) + ' seconds')

        print("=========== Flight Plan create output files  =========== ")
        flightPath.createFlightOutputFiles()
        print("=========== Flight Plan end  =========== ")
    def test_Route(self):

        #sys.stdout = open('log.txt','w') #redirect all prints to this log file
        print("=========== Flight Plan start  =========== ")

        strRoute = 'ADEP/SBGL-ALDEIA-NIKDO-MACAE-GIKPO-MABSI-VITORIA-GIDOD-'
        strRoute += 'ISILA-POSGA-SEGURO-BIDEV-NAXOV-IRUMI-ESLIB-MEDIT-RUBEN-KIBEG-'
        strRoute += 'AMBET-VUKSU-NORONHA-UTRAM-MEDAL-NAMBI-RAKUD-IRAVU-MOGNI-ONOBI-CABRAL-'
        strRoute += 'IPERA-ISOKA-LIMAL-UDATI-ODEGI-LOMAS-CANARIA-VASTO-SULAM-DIMSA-ATLUX-'
        strRoute += 'SUNID-AKUDA-OBOLO-PESAS-EKRIS-LUSEM-LULUT-BORDEAUX-COGNAC-ADABI-BOKNO-'
        strRoute += 'DEVRO-VANAD-KOVAK-ADES/LFPG'
        flightPath = FlightPath(route=strRoute,
                                aircraftICAOcode='A332',
                                RequestedFlightLevel=350,
                                cruiseMach=0.86,
                                takeOffMassKilograms=230000.0)

        print("=========== Flight Plan compute  =========== ")

        t0 = time.clock()
        print('time zero= ' + str(t0))
        lengthNauticalMiles = flightPath.computeLengthNauticalMiles()
        print('flight path length= {0} nautics '.format(lengthNauticalMiles))
        flightPath.computeFlight(deltaTimeSeconds=1.0)
        print('simulation duration= ' + str(time.clock() - t0) + ' seconds')

        print("=========== Flight Plan create output files  =========== ")
        flightPath.createFlightOutputFiles()
        print("=========== Flight Plan end  =========== ")
Exemplo n.º 10
0
    def test_route(self):

        print("=========== Flight Plan start  =========== ")

        strRoute = 'ADEP/LPPT/21-MONTIJO-ROSSIOTAJO-CORESES-SANTIUSTE-ROLEN-LAIGLE-ADES/LFPG/27L'

        strRoute = 'ADEP/LPPT/21-MONTIJO-MAGUM-ABRAT-PINOX-RIVRO-ZAMORA-NUBLO-RONSI-DELOG-DESAB-TEPRA-NORMI-'
        strRoute += 'MOKOR-NANTES-ANGERS-TEMTO-KEPER-ADES/LFPG/27L'

        flightPath = FlightPath(route=strRoute,
                                aircraftICAOcode='A320',
                                RequestedFlightLevel=360,
                                cruiseMach=0.82,
                                takeOffMassKilograms=50500.0)
        '''
        RFL:    FL 310 => 31000 feet
        Cruise Speed    Mach 0.78                                    
        Take Off Weight    62000 kgs    
        '''
        print("=========== Flight Plan compute  =========== " +
              time.strftime("%c"))

        t0 = time.clock()
        print('time zero= ' + str(t0))
        lengthNauticalMiles = flightPath.computeLengthNauticalMiles()
        print(
            'flight path length= {0:.2f} nautics '.format(lengthNauticalMiles))
        flightPath.computeFlight(deltaTimeSeconds=1.0)
        print('simulation duration= ' + str(time.clock() - t0) + ' seconds')

        print("=========== Flight Plan create output files  =========== " +
              time.strftime("%c"))
        flightPath.createFlightOutputFiles()
        print("=========== Flight Plan end  =========== " +
              time.strftime("%c"))
    def test_route(self):

        print("=========== Flight Plan start  =========== ")

        strRoute = 'ADEP/LFPG/26R-LAIGLE-ROLEN-PEPON-KURIS-TERPO-ERIGA-INBAB-ATLEN-DEVAR-ASTURIAS-KUVAN-BISMU-BARKO-FATIMA-ADES/LPPT/03'
        flightPath = FlightPath(route=strRoute,
                                aircraftICAOcode='A320',
                                RequestedFlightLevel=330,
                                cruiseMach=0.82,
                                takeOffMassKilograms=68000.0)
        '''
        RFL:    FL 310 => 31000 feet
        Cruise Speed    Mach 0.78                                    
        Take Off Weight    62000 kgs    
        '''
        print("=========== Flight Plan compute  =========== " +
              time.strftime("%c"))

        t0 = time.clock()
        print('time zero= ' + str(t0))
        lengthNauticalMiles = flightPath.computeLengthNauticalMiles()
        print(
            'flight path length= {0:.2f} nautics '.format(lengthNauticalMiles))
        flightPath.computeFlight(deltaTimeSeconds=1.0)
        print('simulation duration= ' + str(time.clock() - t0) + ' seconds')

        print("=========== Flight Plan create output files  =========== " +
              time.strftime("%c"))
        flightPath.createFlightOutputFiles()
        print("=========== Flight Plan end  =========== " +
              time.strftime("%c"))
 def test_route(self):
 
     print "=========== Flight Plan start  =========== " 
     
     strRoute = 'ADEP/LFPG/26R-LAIGLE-ROLEN-PEPON-KURIS-TERPO-ERIGA-INBAB-ATLEN-DEVAR-ASTURIAS-KUVAN-BISMU-BARKO-FATIMA-ADES/LPPT/03'
     flightPath = FlightPath(route = strRoute, 
                             aircraftICAOcode = 'A320',
                             RequestedFlightLevel = 330, 
                             cruiseMach = 0.82, 
                             takeOffMassKilograms = 68000.0)
     '''
     RFL:    FL 310 => 31000 feet
     Cruise Speed    Mach 0.78                                    
     Take Off Weight    62000 kgs    
     '''
     print "=========== Flight Plan compute  =========== " + time.strftime("%c")
     
     t0 = time.clock()
     print 'time zero= ' + str(t0)
     lengthNauticalMiles = flightPath.computeLengthNauticalMiles()
     print 'flight path length= {0:.2f} nautics '.format(lengthNauticalMiles)
     flightPath.computeFlight(deltaTimeSeconds = 1.0)
     print 'simulation duration= ' + str(time.clock()-t0) + ' seconds'
     
     print "=========== Flight Plan create output files  =========== " + time.strftime("%c")
     flightPath.createFlightOutputFiles()
     print "=========== Flight Plan end  =========== " + time.strftime("%c")
 def test_Route(self):
 
     print "=========== Flight Plan start  =========== " 
     
     strRoute = 'ADEP/SBGL-ALDEIA-NIKDO-MACAE-GIKPO-MABSI-VITORIA-GIDOD-'
     strRoute += 'ISILA-POSGA-SEGURO-BIDEV-NAXOV-IRUMI-ESLIB-MEDIT-RUBEN-KIBEG-'
     strRoute += 'AMBET-VUKSU-NORONHA-UTRAM-MEDAL-NAMBI-RAKUD-IRAVU-MOGNI-ONOBI-CABRAL-'
     strRoute += 'IPERA-ISOKA-LIMAL-UDATI-ODEGI-LOMAS-CANARIA-VASTO-SULAM-DIMSA-ATLUX-'
     strRoute += 'SUNID-AKUDA-OBOLO-PESAS-EKRIS-LUSEM-LULUT-BORDEAUX-COGNAC-ADABI-BOKNO-'
     strRoute += 'DEVRO-VANAD-KOVAK-ADES/LFPG'
     flightPath = FlightPath(route = strRoute, 
                             aircraftICAOcode = 'A332',
                             RequestedFlightLevel = 350, 
                             cruiseMach = 0.86, 
                             takeOffMassKilograms = 230000.0)
     
     print "=========== Flight Plan compute  =========== " 
     
     t0 = time.clock()
     print 'time zero= ' + str(t0)
     lengthNauticalMiles = flightPath.computeLengthNauticalMiles()
     print 'flight path length= {0} nautics '.format(lengthNauticalMiles)
     flightPath.computeFlight(deltaTimeSeconds = 1.0)
     print 'simulation duration= ' + str(time.clock()-t0) + ' seconds'
     
     print "=========== Flight Plan create output files  =========== "
     flightPath.createFlightOutputFiles()
     print "=========== Flight Plan end  =========== " 
 def test_route(self):
 
     departureAirportICAOcode = 'LFBO'
     arrivalAirportICAOcode = 'EDDK'
 
     print "=========== Flight Plan start  =========== " + time.strftime("%c")
     
     strRoute = 'ADEP/LFBO/32R-'
     strRoute += 'MEN-MEZIN-LATAM-OTROT-ETREK-RUSIT-'
     strRoute += 'BULOL-LOGNI-MOKIP-DJL-RESPO-DILAB-EPL-NANCY-JARNY-ROUSY-'
     strRoute += 'DIK-ADUSU-UNEPI-GEBSO-ERUKI-NOR-'
     strRoute += 'ADES/EDDK/32R'
     flightPath = FlightPath(route = strRoute, 
                             aircraftICAOcode = 'A320',
                             RequestedFlightLevel = 310, 
                             cruiseMach = 0.78, 
                             takeOffMassKilograms=62000.0)
     '''
     RFL:    FL 310 => 31000 feet
     Cruise Speed    Mach 0.78                                    
     Take Off Weight    62000 kgs    
     '''
     print "=========== Flight Plan compute  =========== " + time.strftime("%c")
     
     t0 = time.clock()
     print 'time zero= ' + str(t0)
     lengthNauticalMiles = flightPath.computeLengthNauticalMiles()
     print 'flight path length= {0:.2f} nautics '.format(lengthNauticalMiles)
     flightPath.computeFlight(deltaTimeSeconds = 1.0)
     print 'simulation duration= ' + str(time.clock()-t0) + ' seconds'
     
     print "=========== Flight Plan create output files  =========== " + time.strftime("%c")
     flightPath.createFlightOutputFiles()
     print "=========== Flight Plan end  =========== " + time.strftime("%c")
 def test_route(self):
     print "=========== Flight Plan start  =========== " + time.strftime("%c")
     
     strRoute = 'ADEP/LFBD/11-COGNAC-FOUCO-DIBAG-LIMOGES-BEBIX-GUERE-LARON-KUKOR-'
     strRoute += 'MOULINS-PIBAT-DIJON-RESPO-DILAB-EPINAL-ADES/LFST/23'
     
     flightPath = FlightPath(route = strRoute, 
                             aircraftICAOcode = 'A320',
                             RequestedFlightLevel = 310, 
                             cruiseMach = 0.78, 
                             takeOffMassKilograms=62000.0)
     '''
     RFL:    FL 310 => 31000 feet
     Cruise Speed    Mach 0.78                                    
     Take Off Weight    62000 kgs    
     '''
     print "=========== Flight Plan compute  =========== " + time.strftime("%c")
     
     t0 = time.clock()
     print 'time zero= ' + str(t0)
     lengthNauticalMiles = flightPath.computeLengthNauticalMiles()
     print 'flight path length= {0:.2f} nautics '.format(lengthNauticalMiles)
     flightPath.computeFlight(deltaTimeSeconds = 1.0)
     print 'simulation duration= ' + str(time.clock()-t0) + ' seconds'
     
     print "=========== Flight Plan create output files  =========== " + time.strftime("%c")
     flightPath.createFlightOutputFiles()
     print "=========== Flight Plan end  =========== " + time.strftime("%c")
 def test_route(self):
 
     print "=========== Flight Plan start  =========== " 
     
     strRoute = 'ADEP/EGLL/27L-COMPTON-KENET-GAVGO-DIKAS-STRUMBLE-SLANY-'
     strRoute += 'ABAGU-TIPUR-SHANNON-MALOT-RIKAL-EBONY-SEAER-SCARS-KENNEBUNK-ADES/KJFK/04L'
     
     strRoute = 'ADEP/EGLL/27L-MID-DRAKE-SITET-ETRAT-DVL-LGL-SORAP-BENAR-VANAD-AMB-BALAN-LMG-VELIN-SAU-ENSAC-ADES/LFBM/27'
     
     strRoute = 'ADEP/EGLL/27L-MAY-SFD-BENBO-HAWKE-XAMAB-VEULE-INPAX-RESMI-KOTAP-KETEX-KUSEK-KOTIS-KUKOR-OBEPA-LERGA-LATAM-ARDEG-AVN-MTG-JULEE-ADES/LFMI/33'
     
     flightPath = FlightPath(route = strRoute, 
                             aircraftICAOcode = 'A320',
                             RequestedFlightLevel = 310, 
                             cruiseMach = 0.78, 
                             takeOffMassKilograms = 76000.0)
     '''
     RFL:    FL 310 => 31000 feet
     Cruise Speed    => Mach 0.78                                    
     Take Off Weight    72000 kgs    
     '''
     print "=========== Flight Plan compute  =========== " 
     
     t0 = time.clock()
     print 'time zero= ' + str(t0)
     lengthNauticalMiles = flightPath.computeLengthNauticalMiles()
     print 'flight path length= {0} nautics '.format(lengthNauticalMiles)
     flightPath.computeFlight(deltaTimeSeconds = 1.0)
     print 'simulation duration= ' + str(time.clock()-t0) + ' seconds'
     
     print "=========== Flight Plan create output files  =========== "
     flightPath.createFlightOutputFiles()
     print "=========== Flight Plan end  =========== " 
    def test_route(self):
#============================================
        
        #sys.stdout = open('log.txt','w') #redirect all prints to this log file
        
        print "=========== Flight Plan start  =========== " + time.strftime("%c")
        
        strRoute = 'ADEP/LEMD-ZMR-BARKO-ADES/LEVX'
        strRoute = 'ADEP/LFBM/27-AGN-TOU-GAI-AMOLO-DEGOL-FJR-MARRI-ADES/LFML/31R'
    
        flightPath = FlightPath(route = strRoute, 
                                aircraftICAOcode = 'A320',
                                RequestedFlightLevel = 270, 
                                cruiseMach = 0.78, 
                                takeOffMassKilograms=62000.0)
        '''
        RFL:    FL 310 => 31000 feet
        Cruise Speed    Mach 0.78                                    
        Take Off Weight    62000 kgs    
        '''
        print "=========== Flight Plan compute  =========== " + time.strftime("%c")
        
        t0 = time.clock()
        print 'time zero= ' + str(t0)
        lengthNauticalMiles = flightPath.computeLengthNauticalMiles()
        print 'flight path length= {0:.2f} nautics '.format(lengthNauticalMiles)
        flightPath.computeFlight(deltaTimeSeconds = 1.0)
        print 'simulation duration= ' + str(time.clock()-t0) + ' seconds'
        
        print "=========== Flight Plan create output files  =========== " + time.strftime("%c")
        flightPath.createFlightOutputFiles()
        print "=========== Flight Plan end  =========== " + time.strftime("%c")
    def test_route(self):
        print "=========== Flight Plan start  =========== " + time.strftime("%c")

        strRoute = "ADEP/LFBO-MENDE-MEZIN-LATAM-OTROT-ETREK-RUSIT-BULOL-LOGNI-MOKIP-DIJON-RESPO-DILAB-EPINAL-ADES/LFST"
        flightPath = FlightPath(
            route=strRoute,
            aircraftICAOcode="A320",
            RequestedFlightLevel=310,
            cruiseMach=0.78,
            takeOffMassKilograms=62000.0,
        )
        """
        RFL:    FL 310 => 31000 feet
        Cruise Speed    Mach 0.78                                    
        Take Off Weight    62000 kgs    
        """
        print "=========== Flight Plan compute  =========== " + time.strftime("%c")

        t0 = time.clock()
        print "time zero= " + str(t0)
        lengthNauticalMiles = flightPath.computeLengthNauticalMiles()
        print "flight path length= {0:.2f} nautics ".format(lengthNauticalMiles)
        flightPath.computeFlight(deltaTimeSeconds=1.0)
        print "simulation duration= " + str(time.clock() - t0) + " seconds"

        print "=========== Flight Plan create output files  =========== " + time.strftime("%c")
        flightPath.createFlightOutputFiles()
        print "=========== Flight Plan end  =========== " + time.strftime("%c")
    def test_flight_path(self):
        flight_path = FlightPath(route=self.str_route,
                                 aircraftICAOcode='A320',
                                 RequestedFlightLevel=330,
                                 cruiseMach=0.82,
                                 takeOffMassKilograms=68000.0,
                                 windSpeedMetersPerSecond=25 *
                                 Knots2MetersPerSecond,
                                 windDirectionDegrees=25)

        expectation = []

        self.assertEqual(flight_path, expectation)
    def test_flight_path_compute_flight(self):
        flight_path = FlightPath(route=self.str_route,
                                 aircraftICAOcode='A320',
                                 RequestedFlightLevel=330,
                                 cruiseMach=0.82,
                                 takeOffMassKilograms=68000.0,
                                 windSpeedMetersPerSecond=25 *
                                 Knots2MetersPerSecond,
                                 windDirectionDegrees=25)

        # If we want to generate the whole flight using the old code, use the .computeFlight function
        flight_path.computeFlight(deltaTimeSeconds=1.0)
        flight_path.createFlightOutputFiles()
    def test_flight_path_simulate_fly(self):
        updateFlightPath = FlightPath(route=self.str_route,
                                      aircraftICAOcode='A320',
                                      RequestedFlightLevel=330,
                                      cruiseMach=0.82,
                                      takeOffMassKilograms=68000.0,
                                      windSpeedMetersPerSecond=25 *
                                      Knots2MetersPerSecond,
                                      windDirectionDegrees=25)

        # fly from index 4 for the new route
        updateFlightPath.simulateFly(4, self.str_route)
        # fly from index 4 for the new route, with speed 260 and altitude 10000
        updateFlightPath.simulateFly(4, self.str_route, 260, 10000.0)
Exemplo n.º 22
0
    def test_route(self):

        departureAirportICAOcode = 'LFBO'
        arrivalAirportICAOcode = 'EDDK'

        print "=========== Flight Plan start  =========== " + time.strftime(
            "%c")

        strRoute = 'ADEP/LFBO/32R-'
        strRoute += 'MEN-MEZIN-LATAM-OTROT-ETREK-RUSIT-'
        strRoute += 'BULOL-LOGNI-MOKIP-DJL-RESPO-DILAB-EPL-NANCY-JARNY-ROUSY-'
        strRoute += 'DIK-ADUSU-UNEPI-GEBSO-ERUKI-NOR-'
        strRoute += 'ADES/EDDK/32R'
        flightPath = FlightPath(route=strRoute,
                                aircraftICAOcode='A320',
                                RequestedFlightLevel=310,
                                cruiseMach=0.78,
                                takeOffMassKilograms=62000.0)
        '''
        RFL:    FL 310 => 31000 feet
        Cruise Speed    Mach 0.78                                    
        Take Off Weight    62000 kgs    
        '''
        print "=========== Flight Plan compute  =========== " + time.strftime(
            "%c")

        t0 = time.clock()
        print 'time zero= ' + str(t0)
        lengthNauticalMiles = flightPath.computeLengthNauticalMiles()
        print 'flight path length= {0:.2f} nautics '.format(
            lengthNauticalMiles)
        flightPath.computeFlight(deltaTimeSeconds=1.0)
        print 'simulation duration= ' + str(time.clock() - t0) + ' seconds'

        print "=========== Flight Plan create output files  =========== " + time.strftime(
            "%c")
        flightPath.createFlightOutputFiles()
        print "=========== Flight Plan end  =========== " + time.strftime("%c")
Exemplo n.º 23
0
    def test_route(self):

        print("=========== Flight Plan start  =========== ")

        #strRoute = 'ADEP/LFPG/26R-LAIGLE-ROLEN-PEPON-KURIS-TERPO-ERIGA-INBAB-ATLEN-DEVAR-ASTURIAS-KUVAN-BISMU-BARKO-FATIMA-ADES/LPPT/03'

        strRoute = "ADEP/LFPG/08R"
        strRoute += "-NURMO-PERON-SULEX-CMB-VEKIN-ADUTO-FERDI-HELEN-VICOT-STD-EKROS-PAM"
        strRoute += "-NYKER-ELPAT-ARNEM-SONEB-OLDOD-SUVOX-OSN-MOBSA-ROBEG-DLE-HLZ-BATEL"
        strRoute += "-ADES/EDDT/26R"

        flightPath = FlightPath(route=strRoute,
                                aircraftICAOcode='A320',
                                RequestedFlightLevel=330,
                                cruiseMach=0.82,
                                takeOffMassKilograms=68000.0)
        '''
        RFL:    FL 310 => 31000 feet
        Cruise Speed    Mach 0.78                                    
        Take Off Weight    62000 kgs    
        '''
        print("=========== Flight Plan compute  =========== " +
              time.strftime("%c"))

        t0 = time.clock()
        print('time zero= ' + str(t0))
        lengthNauticalMiles = flightPath.computeLengthNauticalMiles()
        print(
            'flight path length= {0:.2f} nautics '.format(lengthNauticalMiles))
        flightPath.computeFlight(deltaTimeSeconds=1.0)
        print('simulation duration= ' + str(time.clock() - t0) + ' seconds')

        print("=========== Flight Plan create output files  =========== " +
              time.strftime("%c"))
        flightPath.createFlightOutputFiles()
        print("=========== Flight Plan end  =========== " +
              time.strftime("%c"))
    acDict = {}
    acList = ['B722', 'B737', 'B744', 'B752', 'B762', 'B772', 'DC10', 'A319']
    targetCruiseLevel = [330, 290, 270, 340, 350, 340, 320, 350]
    minWeightLbs = [
        123240, 108100, 544800, 146780, 250250, 385100, 316860, 111600
    ]
    maxWeightLbs = []

    index = 0
    for aircraftIcaoCode in acList:
        print(aircraftIcaoCode)
        print('aircraft= {0} exists= {1}'.format(
            aircraftIcaoCode, acBd.aircraftExists(aircraftIcaoCode)))
        if acBd.aircraftExists(aircraftIcaoCode):
            print('aircraft= {0} performance file exists= {1}'.format(
                aircraftIcaoCode,
                acBd.aircraftPerformanceFileExists(
                    acBd.getAircraftPerformanceFile(aircraftIcaoCode))))
        print('aircraft= {0} - target cruise level= {1}'.format(
            aircraftIcaoCode, targetCruiseLevel[index]))

        flightPath = FlightPath(route=strRoute,
                                aircraftIcaoCode=aircraftIcaoCode,
                                RequestedFlightLevel=targetCruiseLevel[index],
                                cruiseMach='use-default',
                                takeOffMassKilograms=minWeightLbs[index] *
                                Pound2Kilogram)

        flightPath.computeFlight()
        index += 1
       

#============================================
if __name__ == '__main__':
    
    print "=========== Flight Plan start  =========== " 
    
    strRoute = 'ADEP/EGLL/27L-COMPTON-KENET-GAVGO-DIKAS-STRUMBLE-SLANY-'
    strRoute += 'ABAGU-TIPUR-SHANNON-MALOT-RIKAL-EBONY-SEAER-SCARS-KENNEBUNK-ADES/KJFK/04L'
    
    strRoute = 'ADEP/EGLL/27L-MID-DRAKE-SITET-ETRAT-DVL-LGL-SORAP-BENAR-VANAD-AMB-BALAN-LMG-VELIN-SAU-ENSAC-ADES/LFBM/27'
    
    flightPath = FlightPath(route = strRoute, 
                            aircraftICAOcode = 'A320',
                            RequestedFlightLevel = 310, 
                            cruiseMach = 0.78, 
                            takeOffMassKilograms = 76000.0)
    '''
    RFL:    FL 310 => 31000 feet
    Cruise Speed    => Mach 0.78                                    
    Take Off Weight    72000 kgs    
    '''
    print "=========== Flight Plan compute  =========== " 
    
    t0 = time.clock()
    print 'time zero= ' + str(t0)
    lengthNauticalMiles = flightPath.computeLengthNauticalMiles()
    print 'flight path length= {0} nautics '.format(lengthNauticalMiles)
    flightPath.computeFlight(deltaTimeSeconds = 1.0)
    print 'simulation duration= ' + str(time.clock()-t0) + ' seconds'
    def test_route(self):
    
#     import sys
#     temp = sys.stdout #store original stdout object for later
#     sys.stdout = open('log.txt','w') #redirect all prints to this log file

        wayPointsDb = WayPointsDatabase()
        assert wayPointsDb.read()
            
        t0 = time.clock()
        print ' ========== Airports Direct Route testing ======= '
        
        airportsDb = AirportsDatabase()
        assert  airportsDb.read()
        t1 = time.clock()
        print ' time to read airports database= {0:.2f} seconds'.format(t1-t0)
        
        t2 = time.clock()
        runwaysDb = RunWayDataBase()
        assert runwaysDb.read()
        print ' time to read run-way database= {0:.2f} seconds'.format(t2-t1)
        
        print ' ========== Airports Direct Route testing ======= '
        departureCountry = 'Japan'
        departureCountry = 'United Kingdom'
        departureCountry = 'France'
        departureCountry = 'United States'
        arrivalCountry = 'Canada'
        arrivalCountry = 'France' 
        arrivalCountry = 'United States' 
        for departureAirport in  airportsDb.getAirportsFromCountry(Country = departureCountry):
            departureAirportICAOcode = departureAirport.getICAOcode()
            
            departureRunwayName = ''
            departureRunwayFound = False
            
            for runwayName in runwaysDb.findAirportRunWays(airportICAOcode = departureAirportICAOcode, 
                                                           runwayLengthFeet = 11000.0):
                if not(runwaysDb.getFilteredRunWays(
                                                    airportICAOcode = departureAirportICAOcode, 
                                                    runwayName = runwayName) is None):
                    departureRunwayName  = runwayName
                    departureRunwayFound = True
                    break
                
            if departureRunwayFound:
                
                for arrivalAirport in airportsDb.getAirportsFromCountry(Country = arrivalCountry):
                    
                    arrivalRunwayName = ''
                    arrivalRunwayFound = False
                    arrivalAirportICAOcode =  arrivalAirport.getICAOcode()
                    for runwayName in runwaysDb.findAirportRunWays(airportICAOcode = arrivalAirportICAOcode, 
                                                               runwayLengthFeet = 11000.0):
                        if not(runwaysDb.getFilteredRunWays(
                                                        airportICAOcode = arrivalAirportICAOcode, 
                                                        runwayName = runwayName) is None):
                            arrivalRunwayName = runwayName
                            arrivalRunwayFound = True
                            break
                    ''' we have a pair of airports '''
                    
                    if departureRunwayFound and arrivalRunwayFound:
                        distanceMeters = departureAirport.getDistanceMetersTo(arrivalAirport)
                        if  distanceMeters > 300000.0:
                            print ' ========== Airports Direct Route testing ======= '
                            print '{0} - {1} - distance  = {2} meters'.format(departureAirport.getName(), arrivalAirport.getName(), distanceMeters)
                
                            print departureAirport
                            print arrivalAirport
                            routeFinder = RouteFinder()
                            if routeFinder.isConnected():    
                                RFL = 'FL390'
                        
                                if routeFinder.findRoute(departureAirport.getICAOcode(), arrivalAirport.getICAOcode(), RFL):
                                    routeList = routeFinder.getRouteAsList()
                                    print routeList
                                    routeFinder.insertWayPointsInDatabase(wayPointsDb)
                
                                    strRoute = 'ADEP/' + departureAirport.getICAOcode() + '/' + departureRunwayName + '-'
                                    for fix in routeList:    
                                        strRoute += fix['Name'] + '-'
                                    strRoute += 'ADES/' + arrivalAirport.getICAOcode() + '/' + arrivalRunwayName
                                    
                                    print strRoute
                                    
                                    flightPath = FlightPath(route = strRoute, 
                                                                aircraftICAOcode = 'B744',
                                                                RequestedFlightLevel = 390, 
                                                                cruiseMach = 0.92, 
                                                                takeOffMassKilograms = 280000.0)
        
                                
                                    print "=========== Flight Plan compute  =========== " 
                      
                                    t0 = time.clock()
                                    print 'time zero= ' + str(t0)
                                    lengthNauticalMiles = flightPath.computeLengthNauticalMiles()
                                    print 'flight path length= {0:.2f} nautics '.format(lengthNauticalMiles)
                                    flightPath.computeFlight(deltaTimeSeconds = 1.0)
                                    print 'simulation duration= ' + str(time.clock()-t0) + ' seconds'
                                    print "=========== Flight Plan create output files  =========== "
                                    flightPath.createFlightOutputFiles()
Exemplo n.º 27
0
from Home.Guidance.FlightPathFile import FlightPath

Meter2Feet = 3.2808  # one meter equals 3.28 feet
Meter2NauticalMiles = 0.000539956803  # One Meter = 0.0005 nautical miles
NauticalMiles2Meter = 1852

#============================================
if __name__ == '__main__':

    print("=========== Flight Plan start  =========== ")

    strRoute = 'ADEP/LFPO-AMB-LMG-FISTO-ALIVA-TOU-ADES/LFBO'
    flightPath = FlightPath(route=strRoute,
                            aircraftIcaoCode='A320',
                            RequestedFlightLevel=310,
                            cruiseMach=0.78,
                            takeOffMassKilograms=62000.0)
    '''
    RFL:    FL 310 => 31000 feet
    Cruise Speed    Mach 0.78                                    
    Take Off Weight    62000 kgs    
    '''
    print("=========== Flight Plan compute  =========== ")

    t0 = time.clock()
    print('time zero= ' + str(t0))

    lengthNauticalMiles = flightPath.computeLengthNauticalMiles()
    print('flight path length= {0} nautics '.format(lengthNauticalMiles))
from Home.Guidance.FlightPathFile import FlightPath

Meter2Feet = 3.2808  # one meter equals 3.28 feet
Meter2NauticalMiles = 0.000539956803  # One Meter = 0.0005 nautical miles
NauticalMiles2Meter = 1852

#============================================
if __name__ == '__main__':

    print("=========== Flight Plan start  =========== ")

    strRoute = 'ADEP/KVQQ/36R-MONIA-AYS-WUXTE-AMG-AHN-VXV-GHATS-RYANS-IIU-HEALS-STREP-HOUSE-MOUTH-ICUCO-ROSES-VHP-ZIPPY-EDMEW-HUBOP-PASEW-OKK-ADES/KGUS/05'

    flightPath = FlightPath(route=strRoute,
                            aircraftICAOcode='B744',
                            RequestedFlightLevel=390,
                            cruiseMach=0.92,
                            takeOffMassKilograms=280000.0)
    '''
    RFL:    FL 450 => 45000 feet
    Cruise Speed    => Mach 0.92                                    
    Take Off Weight    396800 kgs    
    '''
    print("=========== Flight Plan compute  =========== ")

    t0 = time.clock()
    print('time zero= ' + str(t0))

    lengthNauticalMiles = flightPath.computeLengthNauticalMiles()
    print('flight path length= {0} nautics '.format(lengthNauticalMiles))
    def test_route_a320_charles_de_gaulle_lisbonne(self):

        print("=========== Flight Plan start  =========== ")

        strRoute = 'ADEP/LFPG/26R-LAIGLE-ROLEN-PEPON-KURIS-TERPO-ERIGA-INBAB-ATLEN-DEVAR-ASTURIAS-KUVAN-BISMU-BARKO-FATIMA-ADES/LPPT/03'

        flightPath = FlightPath(route=strRoute,
                                aircraftICAOcode='A320',
                                RequestedFlightLevel=330,
                                cruiseMach=0.82,
                                takeOffMassKilograms=68000.0,
                                windSpeedMetersPerSecond=25 *
                                Knots2MetersPerSecond,
                                windDirectionDegrees=25)

        # If we want to generate the whole flight using the old code, use the .computeFlight function
        flightPath.computeFlight(deltaTimeSeconds=1.0)
        flightPath.createFlightOutputFiles()

        # If we want to fly through the flight and generate the configuration for later fly, use .fly()
        flyAndGenerateConfig = FlightPath(route=strRoute,
                                          aircraftICAOcode='A320',
                                          RequestedFlightLevel=330,
                                          cruiseMach=0.82,
                                          takeOffMassKilograms=68000.0,
                                          windSpeedMetersPerSecond=25 *
                                          Knots2MetersPerSecond,
                                          windDirectionDegrees=25)
        flyAndGenerateConfig.fly()

        # If we want to simulate the fly based on previous configuration, use .simulateFly
        strRoute = 'ADEP/LFPG/26R-LAIGLE-ROLEN-PEPON-KURIS-TERPO-ERIGA-INBAB-ATLEN-DEVAR-ASTURIAS-KUVAN-BISMU-BARKO-ADES/LPPT/03'
        updateFlightPath = FlightPath(route=strRoute,
                                      aircraftICAOcode='A320',
                                      RequestedFlightLevel=330,
                                      cruiseMach=0.82,
                                      takeOffMassKilograms=68000.0,
                                      windSpeedMetersPerSecond=25 *
                                      Knots2MetersPerSecond,
                                      windDirectionDegrees=25)

        # fly from index 4 for the new route
        updateFlightPath.simulateFly(4, strRoute)
        # fly from index 4 for the new route, with speed 260 and altitude 10000
        updateFlightPath.simulateFly(4, strRoute, 260, 10000.0)