Beispiel #1
0
    def test_nan_yellowness_ASTME313(self):
        """
        Tests :func:`colour.colorimetry.yellowness.yellowness_ASTME313`
        definition nan support.
        """

        cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
        cases = set(permutations(cases * 3, r=3))
        for case in cases:
            XYZ = np.array(case)
            yellowness_ASTME313(XYZ)
Beispiel #2
0
    def test_n_dimensional_yellowness_ASTME313(self):
        """
        Tests :func:`colour.colorimetry.yellowness.yellowness_ASTME313`
        definition n_dimensional arrays support.
        """

        XYZ = np.array([95.00000000, 100.00000000, 105.00000000])
        YI = yellowness_ASTME313(XYZ)

        XYZ = np.tile(XYZ, (6, 1))
        YI = np.tile(YI, 6)
        np.testing.assert_almost_equal(yellowness_ASTME313(XYZ), YI, decimal=7)

        XYZ = np.reshape(XYZ, (2, 3, 3))
        YI = np.reshape(YI, (2, 3))
        np.testing.assert_almost_equal(yellowness_ASTME313(XYZ), YI, decimal=7)
Beispiel #3
0
    def test_yellowness_ASTME313(self):
        """
        Tests :func:`colour.colorimetry.yellowness.yellowness_ASTME313`
        definition.
        """

        self.assertAlmostEqual(yellowness_ASTME313(
            np.array([95.00000000, 100.00000000, 105.00000000])),
                               11.065000000000003,
                               places=7)

        self.assertAlmostEqual(yellowness_ASTME313(
            np.array([105.00000000, 100.00000000, 95.00000000])),
                               19.534999999999989,
                               places=7)

        self.assertAlmostEqual(yellowness_ASTME313(
            np.array([100.00000000, 100.00000000, 100.00000000])),
                               15.300000000000002,
                               places=7)
Beispiel #4
0
    def test_domain_range_scale_yellowness_ASTME313(self):
        """
        Tests :func:`colour.colorimetry.yellowness.yellowness_ASTME313`
        definition domain and range scale support.
        """

        XYZ = np.array([95.00000000, 100.00000000, 105.00000000])
        YI = 11.065000000000003

        d_r = (('reference', 1), (1, 0.01), (100, 1))
        for scale, factor in d_r:
            with domain_range_scale(scale):
                np.testing.assert_almost_equal(
                    yellowness_ASTME313(XYZ * factor), YI * factor, decimal=7)
    def test_yellowness_ASTME313(self):
        """
        Tests :func:`colour.colorimetry.yellowness.yellowness_ASTME313`
        definition.
        """

        self.assertAlmostEqual(
            yellowness_ASTME313(
                np.array([95.00000000, 100.00000000, 105.00000000])),
            11.065000000000003,
            places=7)

        self.assertAlmostEqual(
            yellowness_ASTME313(
                np.array([105.00000000, 100.00000000, 95.00000000])),
            19.534999999999989,
            places=7)

        self.assertAlmostEqual(
            yellowness_ASTME313(
                np.array([100.00000000, 100.00000000, 100.00000000])),
            15.300000000000002,
            places=7)
    def test_yellowness_ASTME313(self):
        """
        Test :func:`colour.colorimetry.yellowness.yellowness_ASTME313`
        definition.
        """

        self.assertAlmostEqual(
            yellowness_ASTME313(
                np.array([95.00000000, 100.00000000, 105.00000000])),
            4.340000000000003,
            places=7,
        )

        self.assertAlmostEqual(
            yellowness_ASTME313(
                np.array([105.00000000, 100.00000000, 95.00000000])),
            28.660000000000011,
            places=7,
        )

        self.assertAlmostEqual(
            yellowness_ASTME313(
                np.array([100.00000000, 100.00000000, 100.00000000])),
            16.500000000000000,
            places=7,
        )

        self.assertAlmostEqual(
            yellowness_ASTME313(
                np.array([95.00000000, 100.00000000, 105.00000000]),
                YELLOWNESS_COEFFICIENTS_ASTME313[
                    "CIE 1931 2 Degree Standard Observer"]["C"],
            ),
            10.089500000000001,
            places=7,
        )