Beispiel #1
0
    def test_nan_CCT_to_uv_Ohno2013(self):
        """
        Test :func:`colour.temperature.ohno2013.CCT_to_uv_Ohno2013` definition
        nan support.
        """

        cases = [-1.0, 0.0, 1.0, -np.inf, np.inf, np.nan]
        cases = set(permutations(cases * 3, r=2))
        for case in cases:
            CCT_D_uv = np.array(case)
            CCT_to_uv_Ohno2013(CCT_D_uv)
Beispiel #2
0
    def test_CCT_to_uv_Ohno2013(self):
        """
        Tests :func:`colour.temperature.cct.CCT_to_uv_Ohno2013` definition.
        """

        cmfs = STANDARD_OBSERVERS_CMFS['CIE 1931 2 Degree Standard Observer']
        np.testing.assert_almost_equal(CCT_to_uv_Ohno2013(
            6507.47380460, 0.00322335, cmfs),
                                       np.array([0.19779997, 0.31219997]),
                                       decimal=7)

        np.testing.assert_almost_equal(CCT_to_uv_Ohno2013(
            1041.68315360, -0.06737802, cmfs),
                                       np.array([0.43279885, 0.28830013]),
                                       decimal=7)

        np.testing.assert_almost_equal(CCT_to_uv_Ohno2013(
            2452.15316417, -0.08437064, cmfs),
                                       np.array([0.29247364, 0.27215157]),
                                       decimal=7)
Beispiel #3
0
    def test_n_dimensional_CCT_to_uv_Ohno2013(self):
        """
        Test :func:`colour.temperature.ohno2013.CCT_to_uv_Ohno2013` definition
        n-dimensional arrays support.
        """

        CCT_D_uv = np.array([6507.47380460, 0.00322335])
        uv = CCT_to_uv_Ohno2013(CCT_D_uv)

        CCT_D_uv = np.tile(CCT_D_uv, (6, 1))
        uv = np.tile(uv, (6, 1))
        np.testing.assert_almost_equal(CCT_to_uv_Ohno2013(CCT_D_uv),
                                       uv,
                                       decimal=7)

        CCT_D_uv = np.reshape(CCT_D_uv, (2, 3, 2))
        uv = np.reshape(uv, (2, 3, 2))
        np.testing.assert_almost_equal(CCT_to_uv_Ohno2013(CCT_D_uv),
                                       uv,
                                       decimal=7)
Beispiel #4
0
    def test_CCT_to_uv_Ohno2013(self):
        """
        Tests :func:`colour.temperature.cct.CCT_to_uv_Ohno2013` definition.
        """

        cmfs = STANDARD_OBSERVERS_CMFS['CIE 1931 2 Degree Standard Observer']
        np.testing.assert_almost_equal(CCT_to_uv_Ohno2013(
            6507.43422010, 0.003223690901513, cmfs),
                                       np.array([0.19779990, 0.31220046]),
                                       decimal=7)

        np.testing.assert_almost_equal(CCT_to_uv_Ohno2013(
            1041.84952461, -0.067377582728535, cmfs),
                                       np.array([0.43276248, 0.28830361]),
                                       decimal=7)

        np.testing.assert_almost_equal(CCT_to_uv_Ohno2013(
            2448.94890533, -0.084324704634693, cmfs),
                                       np.array([0.29256477, 0.2722181]),
                                       decimal=7)
Beispiel #5
0
    def test_n_dimensional_CCT_to_uv_Ohno2013(self):
        """
        Tests :func:`colour.temperature.ohno2013.CCT_to_uv_Ohno2013` definition
        n-dimensional arrays support.
        """

        cmfs = STANDARD_OBSERVERS_CMFS['CIE 1931 2 Degree Standard Observer']
        CCT_D_uv = np.array([6507.47380460, 0.00322335])
        uv = CCT_to_uv_Ohno2013(CCT_D_uv, cmfs)

        CCT_D_uv = np.tile(CCT_D_uv, (6, 1))
        uv = np.tile(uv, (6, 1))
        np.testing.assert_almost_equal(CCT_to_uv_Ohno2013(CCT_D_uv, cmfs),
                                       uv,
                                       decimal=7)

        CCT_D_uv = np.reshape(CCT_D_uv, (2, 3, 2))
        uv = np.reshape(uv, (2, 3, 2))
        np.testing.assert_almost_equal(CCT_to_uv_Ohno2013(CCT_D_uv, cmfs),
                                       uv,
                                       decimal=7)
Beispiel #6
0
    def test_CCT_to_uv_Ohno2013(self):
        """
        Tests :func:`colour.temperature.cct.CCT_to_uv_Ohno2013` definition.
        """

        cmfs = STANDARD_OBSERVERS_CMFS.get(
            'CIE 1931 2 Degree Standard Observer')
        np.testing.assert_almost_equal(
            CCT_to_uv_Ohno2013(6507.4342201047066, 0.003223690901512735, cmfs),
            np.array([0.19780034881616862, 0.31220050291046603]),
            decimal=7)

        np.testing.assert_almost_equal(
            CCT_to_uv_Ohno2013(1041.849524611546, -0.067377582728534946, cmfs),
            np.array([0.43280250331413772, 0.28829975758516474]),
            decimal=7)

        np.testing.assert_almost_equal(
            CCT_to_uv_Ohno2013(2448.9489053326438, -0.084324704634692743,
                               cmfs),
            np.array([0.29256616302348853, 0.27221773141874955]),
            decimal=7)
Beispiel #7
0
    def test_CCT_to_uv_Ohno2013(self):
        """
        Test :func:`colour.temperature.ohno2013.CCT_to_uv_Ohno2013`
        definition.
        """

        np.testing.assert_almost_equal(
            CCT_to_uv_Ohno2013(np.array([6507.47380460, 0.00322335])),
            np.array([0.19779997, 0.31219997]),
            decimal=7,
        )

        np.testing.assert_almost_equal(
            CCT_to_uv_Ohno2013(np.array([1041.68315360, -0.06737802])),
            np.array([0.43279885, 0.28830013]),
            decimal=7,
        )

        np.testing.assert_almost_equal(
            CCT_to_uv_Ohno2013(np.array([2452.15316417, -0.08437064])),
            np.array([0.29247364, 0.27215157]),
            decimal=7,
        )