Skip to content

Instantly share code, notes, and snippets.

@KelSolaar
Created August 25, 2016 22:04
Show Gist options
  • Save KelSolaar/9d6e6a4c8541aee3d3157eaa6818d153 to your computer and use it in GitHub Desktop.
Save KelSolaar/9d6e6a4c8541aee3d3157eaa6818d153 to your computer and use it in GitHub Desktop.
CCT & D_uv Computation from Spectral Power Distribution
import colour
colour.filter_warnings()
XYZ = colour.spectral_to_XYZ(colour.ILLUMINANTS_RELATIVE_SPDS['D65']) / 100.0
UCS = colour.XYZ_to_UCS(XYZ)
uv = colour.UCS_to_uv(UCS)
CCT, D_uv = colour.uv_to_CCT_Ohno2013(uv)
print(CCT, D_uv)
# (6503.5711804856146, 0.0032056466333648319)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment