Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_spectrum_to_xyz():
colorio.illuminants.spectrum_to_xyz(colorio.illuminants.d65())
return
def test_visible_gamut(colorspace, cut_000):
illuminant = colorio.illuminants.d65()
observer = colorio.observers.cie_1931_2()
colorspace.save_visible_gamut(observer, illuminant, "visible.vtu", cut_000=cut_000)
def test_spectrum_to_xyz100():
spectrum = colorio.illuminants.d65()
observer = colorio.observers.cie_1931_2()
colorio.illuminants.spectrum_to_xyz100(spectrum, observer)
return
def test_show():
lmbda, data = colorio.illuminants.d65()
plt.plot(lmbda, data)
# for T in [1000, 2000, 3000, 4000, 5000, 1000]:
# lmbda, data = colorio.illuminants.planckian_radiator(T)
# plt.plot(lmbda, data)
plt.ylim(ymin=0)
plt.show()
return
(colorio.illuminants.d65(), 4, [0.03410, 3.2945, 20.2360]),
# 5.132 is different from the standard; 5.133 is listed there. This is a
# false rounding.
(colorio.illuminants.d75(), 3, [0.043, 5.132, 29.808]),
],
)
def test_values(illuminant, decimals, values):
_, data = illuminant
rdata = numpy.around(data, decimals=decimals)
assert rdata[0] == values[0]
assert rdata[1] == values[1]
assert rdata[2] == values[2]
return
def __init__(self, c, Y_b, L_A, whitepoint=white_point(d65())):
self.ciecam02 = CIECAM02(c, Y_b, L_A, whitepoint)
self.K_L = 1.0
self.c1 = 0.007
self.c2 = 0.0228
return