예제 #1
0
    def test_n_dimensional_F_air_Bates1984(self):
        """
        Tests :func:`colour.phenomenons.rayleigh.F_air_Bates1984` definition
        n-dimensional arrays support.
        """

        wl = 0.360
        n = 1.051997277711708
        np.testing.assert_almost_equal(
            F_air_Bates1984(wl),
            n,
            decimal=7)

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

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

        wl = np.reshape(wl, (2, 3, 1))
        n = np.reshape(n, (2, 3, 1))
        np.testing.assert_almost_equal(
            F_air_Bates1984(wl),
            n,
            decimal=7)
예제 #2
0
    def test_F_air_Bates1984(self):
        """
        Tests :func:`colour.phenomenons.rayleigh.F_air_Bates1984` definition.
        """

        self.assertAlmostEqual(
            F_air_Bates1984(0.360), 1.051997277711708, places=7)

        self.assertAlmostEqual(
            F_air_Bates1984(0.555), 1.048153579718658, places=7)

        self.assertAlmostEqual(
            F_air_Bates1984(0.830), 1.046947068600589, places=7)
예제 #3
0
    def test_nan_F_air_Bates1984(self):
        """
        Tests :func:`colour.phenomenons.rayleigh.F_air_Bates1984` definition
        nan support.
        """

        F_air_Bates1984(np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))