colour.temperature.XYZ_to_CCT_Ohno2013#

colour.temperature.XYZ_to_CCT_Ohno2013(XYZ: Annotated[_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str], 1], cmfs: MultiSpectralDistributions | None = None, start: float | None = None, end: float | None = None, spacing: float | None = None) NDArrayFloat[source]#

Compute the correlated colour temperature \(T_{cp}\) and \(\Delta_{uv}\) from the specified CIE XYZ tristimulus values using the Ohno (2013) method.

The method computes the correlated colour temperature by finding the closest point on the Planckian locus to the specified chromaticity coordinates using an optimised search algorithm with configurable precision through the spacing parameter.

Parameters:
  • XYZ (Annotated[_Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str], 1]) – CIE XYZ tristimulus values.

  • cmfs (MultiSpectralDistributions | None) – Standard observer colour matching functions, default to the CIE 1931 2 Degree Standard Observer.

  • start (float | None) – Temperature range start in kelvins, default to 1000.

  • end (float | None) – Temperature range end in kelvins, default to 100000.

  • spacing (float | None) – Spacing between values of the underlying Planckian table expressed as a multiplier. Default to 1.001. The closer to 1.0, the higher the precision of the returned colour temperature \(T_{cp}\) and \(\Delta_{uv}\). A value of 1.01 provides a good balance between performance and accuracy. The spacing value must be greater than 1.

Returns:

Correlated colour temperature \(T_{cp}\), \(\Delta_{uv}\).

Return type:

numpy.ndarray

Notes

Domain

Scale - Reference

Scale - 1

XYZ

1

1

References

[Ohn14]

Examples

>>> from colour import MSDS_CMFS, SPECTRAL_SHAPE_DEFAULT
>>> cmfs = (
...     MSDS_CMFS["CIE 1931 2 Degree Standard Observer"]
...     .copy()
...     .align(SPECTRAL_SHAPE_DEFAULT)
... )
>>> XYZ = np.array([0.95035049, 1.0, 1.08935705])
>>> XYZ_to_CCT_Ohno2013(XYZ, cmfs)
array([6.5074399...e+03, 3.2236914...e-03])