예제 #1
0
    def test_CCT_to_uv_Robertson1968(self):
        """
        Tests :func:`colour.temperature.cct.CCT_to_uv_Robertson1968`
        definition.
        """

        for key, value in TEMPERATURE_DUV_TO_UV.items():
            np.testing.assert_almost_equal(CCT_to_uv_Robertson1968(*key),
                                           value,
                                           decimal=7)
예제 #2
0
    def test_nan_CCT_to_uv_Robertson1968(self):
        """
        Test :func:`colour.temperature.robertson1968.CCT_to_uv_Robertson1968`
        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_Robertson1968(CCT_D_uv)
예제 #3
0
    def test_n_dimensional_CCT_to_uv_Robertson1968(self):
        """
        Test :func:`colour.temperature.robertson1968.CCT_to_uv_Robertson1968`
        definition n-dimensional arrays support.
        """

        CCT_D_uv = np.array([4500, 0.0250])
        uv = CCT_to_uv_Robertson1968(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_Robertson1968(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_Robertson1968(CCT_D_uv),
                                       uv,
                                       decimal=7)