Example #1
0
    def test_n_dimensional_luminance_ASTMD153508(self):
        """
        Tests :func:`colour.colorimetry.lightness.luminance_ASTMD153508`
        definition n-dimensional arrays support.
        """

        V = 3.74629715
        Y = 10.148809678226682
        np.testing.assert_almost_equal(
            luminance_ASTMD153508(V),
            Y,
            decimal=7)

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

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

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

        V = 3.74629715382
        Y = 10.148809678226682
        np.testing.assert_almost_equal(
            luminance_ASTMD153508(V),
            Y,
            decimal=7)

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

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

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

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

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

        self.assertAlmostEqual(
            luminance_ASTMD153508(3.74629715), 10.14880968, places=7)

        self.assertAlmostEqual(
            luminance_ASTMD153508(8.64728711), 69.53240916, places=7)

        self.assertAlmostEqual(
            luminance_ASTMD153508(1.52569022), 2.01830631, places=7)
Example #6
0
    def test_luminance_ASTMD153508(self):
        """
        Tests :func:`colour.colorimetry.luminance.luminance_ASTMD153508`
        definition.
        """

        self.assertAlmostEqual(
            luminance_ASTMD153508(3.74629715382),
            10.1488096782,
            places=7)

        self.assertAlmostEqual(
            luminance_ASTMD153508(8.64728711385),
            69.5324092373,
            places=7)

        self.assertAlmostEqual(
            luminance_ASTMD153508(1.52569021578),
            2.01830631474,
            places=7)