Example #1
0
    def test_n_dimensional_air_refraction_index_Peck1972(self):
        """
        Tests :func:`colour.phenomenons.rayleigh.air_refraction_index_Peck1972`
        definition n-dimensional arrays support.
        """

        wl = 0.360
        n = 1.000285310285056
        np.testing.assert_almost_equal(
            air_refraction_index_Peck1972(wl), n, decimal=7)

        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)
Example #2
0
    def test_n_dimensional_air_refraction_index_Peck1972(self):
        """
        Tests :func:`colour.phenomenons.rayleigh.air_refraction_index_Peck1972`
        definition n-dimensional arrays support.
        """

        wl = 0.360
        n = 1.0002853102850557
        np.testing.assert_almost_equal(
            air_refraction_index_Peck1972(wl),
            n,
            decimal=7)

        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)
Example #3
0
    def test_nan_air_refraction_index_Peck1972(self):
        """
        Tests :func:`colour.phenomenons.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]))
Example #4
0
    def test_nan_air_refraction_index_Peck1972(self):
        """
        Tests :func:`colour.phenomenons.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]))
Example #5
0
    def test_air_refraction_index_Peck1972(self):
        """
        Tests :func:`colour.phenomenons.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)
Example #6
0
    def test_air_refraction_index_Peck1972(self):
        """
        Tests :func:`colour.phenomenons.rayleigh.air_refraction_index_Peck1972`
        definition.
        """

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

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

        self.assertAlmostEqual(
            air_refraction_index_Peck1972(0.830),
            1.0002748591448039,
            places=10)