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

        wl = 0.360
        n = air_refraction_index_Penndorf1957(wl)

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

        wl = np.reshape(wl, (2, 3))
        n = np.reshape(n, (2, 3))
        np.testing.assert_almost_equal(air_refraction_index_Penndorf1957(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_Penndorf1957(wl),
                                       n,
                                       decimal=7)
示例#2
0
    def test_nan_air_refraction_index_Penndorf1957(self):
        """
        Test :func:`colour.phenomena.rayleigh.\
air_refraction_index_Penndorf1957` definition nan support.
        """

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

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

        self.assertAlmostEqual(air_refraction_index_Penndorf1957(0.360),
                               1.000285316795146,
                               places=10)

        self.assertAlmostEqual(air_refraction_index_Penndorf1957(0.555),
                               1.000277729533864,
                               places=10)

        self.assertAlmostEqual(air_refraction_index_Penndorf1957(0.830),
                               1.000274856640486,
                               places=10)
示例#5
0
    def test_air_refraction_index_Penndorf1957(self):
        """
        Tests :func:`colour.phenomena.rayleigh.\
air_refraction_index_Penndorf1957` definition.
        """

        self.assertAlmostEqual(
            air_refraction_index_Penndorf1957(0.360),
            1.000285316795146,
            places=10)

        self.assertAlmostEqual(
            air_refraction_index_Penndorf1957(0.555),
            1.000277729533864,
            places=10)

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

        wl = 0.360
        n = air_refraction_index_Penndorf1957(wl)

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

        wl = np.reshape(wl, (2, 3))
        n = np.reshape(n, (2, 3))
        np.testing.assert_almost_equal(
            air_refraction_index_Penndorf1957(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_Penndorf1957(wl), n, decimal=7)