Beispiel #1
0
    def test_n_dimensional_luminance_Newhall1943(self):
        """
        Tests :func:`colour.colorimetry.lightness.luminance_Newhall1943`
        definition n-dimensional arrays support.
        """

        V = 3.74629715
        Y = 10.408987457743208
        np.testing.assert_almost_equal(
            luminance_Newhall1943(V),
            Y,
            decimal=7)

        V = np.tile(V, 6)
        Y = np.tile(Y, 6)
        np.testing.assert_almost_equal(
            luminance_Newhall1943(V),
            Y,
            decimal=7)

        V = np.reshape(V, (2, 3))
        Y = np.reshape(Y, (2, 3))
        np.testing.assert_almost_equal(
            luminance_Newhall1943(V),
            Y,
            decimal=7)

        V = np.reshape(V, (2, 3, 1))
        Y = np.reshape(Y, (2, 3, 1))
        np.testing.assert_almost_equal(
            luminance_Newhall1943(V),
            Y,
            decimal=7)
Beispiel #2
0
    def test_n_dimensional_luminance_Newhall1943(self):
        """
        Tests :func:`colour.colorimetry.lightness.luminance_Newhall1943`
        definition n-dimensional arrays support.
        """

        V = 3.74629715382
        Y = 10.408987457743208
        np.testing.assert_almost_equal(
            luminance_Newhall1943(V),
            Y,
            decimal=7)

        V = np.tile(V, 6)
        Y = np.tile(Y, 6)
        np.testing.assert_almost_equal(
            luminance_Newhall1943(V),
            Y,
            decimal=7)

        V = np.reshape(V, (2, 3))
        Y = np.reshape(Y, (2, 3))
        np.testing.assert_almost_equal(
            luminance_Newhall1943(V),
            Y,
            decimal=7)

        V = np.reshape(V, (2, 3, 1))
        Y = np.reshape(Y, (2, 3, 1))
        np.testing.assert_almost_equal(
            luminance_Newhall1943(V),
            Y,
            decimal=7)
Beispiel #3
0
    def test_nan_luminance_Newhall1943(self):
        """
        Tests :func:`colour.colorimetry.luminance.luminance_Newhall1943`
        definition nan support.
        """

        luminance_Newhall1943(
            np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
Beispiel #4
0
    def test_nan_luminance_Newhall1943(self):
        """
        Tests :func:`colour.colorimetry.luminance.luminance_Newhall1943`
        definition nan support.
        """

        luminance_Newhall1943(
            np.array([-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]))
Beispiel #5
0
    def test_luminance_Newhall1943(self):
        """
        Tests :func:`colour.colorimetry.luminance.luminance_Newhall1943`
        definition.
        """

        self.assertAlmostEqual(
            luminance_Newhall1943(3.74629715), 10.40898746, places=7)

        self.assertAlmostEqual(
            luminance_Newhall1943(8.64728711), 71.31748010, places=7)

        self.assertAlmostEqual(
            luminance_Newhall1943(1.52569022), 2.06998750, places=7)
Beispiel #6
0
    def test_luminance_Newhall1943(self):
        """
        Tests :func:`colour.colorimetry.luminance.luminance_Newhall1943`
        definition.
        """

        self.assertAlmostEqual(
            luminance_Newhall1943(3.74629715382),
            10.4089874577,
            places=7)

        self.assertAlmostEqual(
            luminance_Newhall1943(8.64728711385),
            71.3174801757,
            places=7)

        self.assertAlmostEqual(
            luminance_Newhall1943(1.52569021578),
            2.06998750444,
            places=7)