示例#1
0
    def test_n_dimensional_air_refraction_index_Peck1972(self):
        """
        Test :func:`colour.phenomena.rayleigh.air_refraction_index_Peck1972`
        definition n-dimensional arrays support.
        """

        wl = 0.360
        n = air_refraction_index_Peck1972(wl)

        wl = np.tile(wl, 6)
        n = np.tile(n, 6)
        np.testing.assert_almost_equal(air_refraction_index_Peck1972(wl),
                                       n,
                                       decimal=7)

        wl = np.reshape(wl, (2, 3))
        n = np.reshape(n, (2, 3))
        np.testing.assert_almost_equal(air_refraction_index_Peck1972(wl),
                                       n,
                                       decimal=7)

        wl = np.reshape(wl, (2, 3, 1))
        n = np.reshape(n, (2, 3, 1))
        np.testing.assert_almost_equal(air_refraction_index_Peck1972(wl),
                                       n,
                                       decimal=7)
示例#2
0
    def test_nan_air_refraction_index_Peck1972(self):
        """
        Test :func:`colour.phenomena.rayleigh.air_refraction_index_Peck1972`
        definition nan support.
        """

        air_refraction_index_Peck1972(
            np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
示例#3
0
    def test_nan_air_refraction_index_Peck1972(self):
        """
        Tests :func:`colour.phenomena.rayleigh.air_refraction_index_Peck1972`
        definition nan support.
        """

        air_refraction_index_Peck1972(
            np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
示例#4
0
    def test_air_refraction_index_Peck1972(self):
        """
        Tests :func:`colour.phenomena.rayleigh.air_refraction_index_Peck1972`
        definition.
        """

        self.assertAlmostEqual(
            air_refraction_index_Peck1972(0.360), 1.000285310285056, places=10)

        self.assertAlmostEqual(
            air_refraction_index_Peck1972(0.555), 1.000277726541484, places=10)

        self.assertAlmostEqual(
            air_refraction_index_Peck1972(0.830), 1.000274859144804, places=10)
示例#5
0
    def test_air_refraction_index_Peck1972(self):
        """
        Test :func:`colour.phenomena.rayleigh.air_refraction_index_Peck1972`
        definition.
        """

        self.assertAlmostEqual(air_refraction_index_Peck1972(0.360),
                               1.000285310285056,
                               places=10)

        self.assertAlmostEqual(air_refraction_index_Peck1972(0.555),
                               1.000277726541484,
                               places=10)

        self.assertAlmostEqual(air_refraction_index_Peck1972(0.830),
                               1.000274859144804,
                               places=10)
示例#6
0
    def test_n_dimensional_air_refraction_index_Peck1972(self):
        """
        Tests :func:`colour.phenomena.rayleigh.air_refraction_index_Peck1972`
        definition n-dimensional arrays support.
        """

        wl = 0.360
        n = air_refraction_index_Peck1972(wl)

        wl = np.tile(wl, 6)
        n = np.tile(n, 6)
        np.testing.assert_almost_equal(
            air_refraction_index_Peck1972(wl), n, decimal=7)

        wl = np.reshape(wl, (2, 3))
        n = np.reshape(n, (2, 3))
        np.testing.assert_almost_equal(
            air_refraction_index_Peck1972(wl), n, decimal=7)

        wl = np.reshape(wl, (2, 3, 1))
        n = np.reshape(n, (2, 3, 1))
        np.testing.assert_almost_equal(
            air_refraction_index_Peck1972(wl), n, decimal=7)