def test_02(self):

        # 400 kt at 30000, temp -70 deg F
        # truth value from NASA RP 1046 + correction for non-standard temp

        Value = A.cas2tas(400, 30000, -70, temp_units='F')
        Truth = 586.266
        self.assertLessEqual(RE(Value, Truth), 3e-5)
    def test_01(self):

        # 400 kt at 30000, std temp
        # truth value from NASA RP 1046

        Value = A.cas2tas(400, 30000)
        Truth = 602.6
        self.assertLessEqual(RE(Value, Truth), 3e-5)
Esempio n. 3
0
 def setAS_Data(self, AS_Data, PA_Data, OAT):
     if self._Mode_Indicator == 1:
         self._AS_Data_Box = int(airspeed.cas2tas(AS_Data, PA_Data, OAT))
     elif AS_Data != self._AS_Data_Box and self._Mode_Indicator != 1:
         if self._Mode_Indicator == 0:
             self._AS_Data_Box = int(AS_Data)
         elif self._Mode_Indicator == 2:
             self._AS_Data_Box = int(AS_Data)
     self.redraw()
Esempio n. 4
0
 def setAS_Data(self, AS_Data, PA_Data, OAT):
     if self._Mode_Indicator == 1:
         self._AS_Data_Box = int(airspeed.cas2tas(AS_Data, PA_Data, OAT))
     elif AS_Data != self._AS_Data_Box and self._Mode_Indicator != 1:
         if self._Mode_Indicator == 0:
             self._AS_Data_Box = int(AS_Data)
         elif self._Mode_Indicator == 2:
             self._AS_Data_Box = int(AS_Data)
     self.redraw()
    def test_Vstall(self):

        t0 = time.clock()
        print "time start= ", t0

        atmosphere = Atmosphere()
        earth = Earth()
        print '==================== Stall Speed according to airport field elevation ==================== ' + time.strftime(
            "%c")
        acBd = BadaAircraftDatabase()
        aircraftICAOcode = 'B743'
        if acBd.read():
            if (acBd.aircraftExists(aircraftICAOcode)
                    and acBd.aircraftPerformanceFileExists(
                        acBd.getAircraftPerformanceFile(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()

        print '==================== Airport database ==================== ' + time.strftime(
            "%c")
        airportsDB = AirportsDatabase()
        assert airportsDB.read()
        for airport in airportsDB.getAirports():
            print '============' + airport.getName() + ' ============'
            #print airport
            aircraft = BadaAircraft(
                ICAOcode=aircraftICAOcode,
                aircraftFullName=acBd.getAircraftFullName(aircraftICAOcode),
                badaPerformanceFilePath=acBd.getAircraftPerformanceFile(
                    aircraftICAOcode),
                atmosphere=atmosphere,
                earth=earth)
            print 'airport field elevation= {0:.2f} meters'.format(
                airport.getFieldElevationAboveSeaLevelMeters())
            CAS = aircraft.computeStallSpeedCasKnots()
            print 'V stall Calibrated AirSpeed= {0:.2f} knots'.format(CAS)
            TAS = cas2tas(
                cas=CAS,
                altitude=airport.getFieldElevationAboveSeaLevelMeters(),
                temp='std',
                speed_units='kt',
                alt_units='m',
                temp_units=default_temp_units,
            )
            print 'V stall True AirSpeed= {0:.2f} knots'.format(TAS)