Exemple #1
0
    def test_temperature(self):
        self.assertEqual(atm_temperature(alt=10 *1000.), 482.40003999999999)
        self.assertEqual(atm_temperature(alt=60 *1000.), 389.988)
        self.assertEqual(atm_temperature(alt=120*1000.), 451.2655824328092)
        self.assertEqual(atm_temperature(alt=165*1000.), 508.78800000000001)
        self.assertEqual(atm_temperature(alt=230*1000.), 394.18835930326833)
        self.assertEqual(atm_temperature(alt=270*1000.), 354.34800000000001)
        self.assertEqual(atm_temperature(alt=350*1000.), 354.34800000000001)

        self.assertEqual(atm_temperature2(alt=10 *1000.), 482.40003999999999)
        self.assertEqual(atm_temperature2(alt=60 *1000.), 389.988)
        self.assertEqual(atm_temperature2(alt=120*1000.), 451.2655824328092)
        self.assertEqual(atm_temperature2(alt=165*1000.), 508.78800000000001)
        self.assertEqual(atm_temperature2(alt=230*1000.), 394.18835930326833)
        self.assertEqual(atm_temperature2(alt=270*1000.), 354.34800000000001)
        self.assertEqual(atm_temperature2(alt=350*1000.), 354.34800000000001)
    def test_temperature(self):
        self.assertEqual(atm_temperature(alt=10 * 1000.), 482.40003999999999)
        self.assertEqual(atm_temperature(alt=60 * 1000.), 389.988)
        self.assertEqual(atm_temperature(alt=120 * 1000.), 451.2655824328092)
        self.assertEqual(atm_temperature(alt=165 * 1000.), 508.78800000000001)
        self.assertEqual(atm_temperature(alt=230 * 1000.), 394.18835930326833)
        self.assertEqual(atm_temperature(alt=270 * 1000.), 354.34800000000001)
        self.assertEqual(atm_temperature(alt=350 * 1000.), 354.34800000000001)

        self.assertEqual(atm_temperature2(alt=10 * 1000.), 482.40003999999999)
        self.assertEqual(atm_temperature2(alt=60 * 1000.), 389.988)
        self.assertEqual(atm_temperature2(alt=120 * 1000.), 451.2655824328092)
        self.assertEqual(atm_temperature2(alt=165 * 1000.), 508.78800000000001)
        self.assertEqual(atm_temperature2(alt=230 * 1000.), 394.18835930326833)
        self.assertEqual(atm_temperature2(alt=270 * 1000.), 354.34800000000001)
        self.assertEqual(atm_temperature2(alt=350 * 1000.), 354.34800000000001)
Exemple #3
0
    def test_temperature(self):
        """tests temperature at various altitudes"""
        with self.assertRaises(RuntimeError):
            atm_temperature(alt=0., alt_units='km', temperature_units='R')
        with self.assertRaises(RuntimeError):
            atm_temperature(alt=0., alt_units='ft', temperature_units='F')

        self.assertEqual(atm_temperature(alt=10 * 1000.), 482.40003999999999)
        self.assertEqual(atm_temperature(alt=60 * 1000.), 389.988)
        self.assertEqual(atm_temperature(alt=120 * 1000.), 451.2655824328092)
        self.assertEqual(atm_temperature(alt=165 * 1000.), 508.78800000000001)
        self.assertEqual(atm_temperature(alt=230 * 1000.), 394.18835930326833)
        self.assertEqual(atm_temperature(alt=270 * 1000.), 354.34800000000001)
        self.assertEqual(atm_temperature(alt=350 * 1000.), 354.34800000000001)

        self.assertEqual(
            atm_temperature(alt=0, alt_units='ft', temperature_units='K'),
            287.77777777777777)