コード例 #1
0
ファイル: tests_rayleigh.py プロジェクト: yeekzhang/colour
    def test_n_dimensional_air_refraction_index_Edlen1966(self):
        """
        Tests :func:`colour.phenomenons.rayleigh.\
air_refraction_index_Edlen1966` definition n-dimensional arrays support.
        """

        wl = 0.360
        n = 1.000285308809879
        np.testing.assert_almost_equal(
            air_refraction_index_Edlen1966(wl), n, decimal=7)

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

        wl = np.reshape(wl, (2, 3))
        n = np.reshape(n, (2, 3))
        np.testing.assert_almost_equal(
            air_refraction_index_Edlen1966(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_Edlen1966(wl), n, decimal=7)
コード例 #2
0
ファイル: tests_rayleigh.py プロジェクト: brehm/colour
    def test_n_dimensional_air_refraction_index_Edlen1966(self):
        """
        Tests :func:`colour.phenomenons.rayleigh.\
air_refraction_index_Edlen1966` definition n-dimensional arrays support.
        """

        wl = 0.360
        n = 1.000285308809879
        np.testing.assert_almost_equal(
            air_refraction_index_Edlen1966(wl),
            n,
            decimal=7)

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

        wl = np.reshape(wl, (2, 3))
        n = np.reshape(n, (2, 3))
        np.testing.assert_almost_equal(
            air_refraction_index_Edlen1966(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_Edlen1966(wl),
            n,
            decimal=7)
コード例 #3
0
ファイル: tests_rayleigh.py プロジェクト: yeekzhang/colour
    def test_nan_air_refraction_index_Edlen1966(self):
        """
        Tests :func:`colour.phenomenons.rayleigh.\
air_refraction_index_Edlen1966` definition nan support.
        """

        air_refraction_index_Edlen1966(
            np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
コード例 #4
0
ファイル: tests_rayleigh.py プロジェクト: brehm/colour
    def test_nan_air_refraction_index_Edlen1966(self):
        """
        Tests :func:`colour.phenomenons.rayleigh.\
air_refraction_index_Edlen1966` definition nan support.
        """

        air_refraction_index_Edlen1966(
            np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
コード例 #5
0
ファイル: tests_rayleigh.py プロジェクト: scooperly/colour
    def test_air_refraction_index_Edlen1966(self):
        """
        Tests :func:`colour.phenomenons.\
rayleigh.air_refraction_index_Edlen1966` definition.
        """

        self.assertAlmostEqual(air_refraction_index_Edlen1966(0.360),
                               1.000285308809879,
                               places=10)

        self.assertAlmostEqual(air_refraction_index_Edlen1966(0.555),
                               1.000277727690364,
                               places=10)

        self.assertAlmostEqual(air_refraction_index_Edlen1966(0.830),
                               1.0002748622188347,
                               places=10)
コード例 #6
0
ファイル: tests_rayleigh.py プロジェクト: brehm/colour
    def test_air_refraction_index_Edlen1966(self):
        """
        Tests :func:`colour.phenomenons.\
rayleigh.air_refraction_index_Edlen1966` definition.
        """

        self.assertAlmostEqual(
            air_refraction_index_Edlen1966(0.360),
            1.000285308809879,
            places=10)

        self.assertAlmostEqual(
            air_refraction_index_Edlen1966(0.555),
            1.000277727690364,
            places=10)

        self.assertAlmostEqual(
            air_refraction_index_Edlen1966(0.830),
            1.0002748622188347,
            places=10)