<jupyter_start><jupyter_text>Jupyter (iPython) Notebook to reproduce the table values in TB-2018-001Dependencies------------    numpy (http://www.numpy.org/)    colour-science (http://www.colour-science.org/)    iPython (https://ipython.org/)    pandas (https://pandas.pydata.org/)Copyright Academy of Motion Picture Arts and Sciences  Setup Notebook<jupyter_code># Imports for Calculations
import colour
import numpy as np
# Imports for Display of Tables
from IPython.display import HTML, display
import pandas as pd
# Turn off any warnings
import warnings
warnings.simplefilter("ignore")<jupyter_output><empty_output><jupyter_text>Table 1 - CCT of canonical CIE daylight illuminants Specify nominal CCT values for canonical CIE Daylight Illuminants<jupyter_code>cct_pre68 = np.array([5000, 5500, 6500, 7500])<jupyter_output><empty_output><jupyter_text>Define the correction factor<jupyter_code>c_factor = 1.4388 / 1.4380<jupyter_output><empty_output><jupyter_text>Apply the correction factor to determine the actual CCT values for the daylight illuminants<jupyter_code>cct_post68 = cct_pre68 * c_factor
# Print the table
df_T1 = pd.DataFrame( np.c_[cct_pre68, cct_post68, cct_post68], 
                      index = ['D50', 'D55', 'D65', 'D75'], 
                      columns = ['CCT before 1968', 
                                 'CCT Current (round to 3 decimal places)', 
                                 'CCT Current (round to 0 decimal places)'] )

df_T1.iloc[:, 0] = df_T1.iloc[:, 0].map('{:,.0f} K'.format)
df_T1.iloc[:, 1] = df_T1.iloc[:, 1].map('{:,.3f} K'.format)
df_T1.iloc[:, 2] = df_T1.iloc[:, 2].map('{:,.0f} K'.format)

display(df_T1)<jupyter_output><empty_output><jupyter_text>CCT of "D60"<jupyter_code># Calculate the CCT of a 'D60' CIE Daylight Illuminant assuming the name follows the canonical illuminants
cct_d60 = 6000 * c_factor
# Print the result
df_cctd60 = pd.DataFrame( cct_d60, 
                          index = ['D60'], 
                          columns = ['CCT'] )

display(df_cctd60)<jupyter_output><empty_output><jupyter_text>Table 2 - CIE xy chromaticity coordinates rounded to 5 decimal places<jupyter_code># Calculate the ACES white point CIE xy values
xy_aces = colour.models.ACES_2065_1_COLOURSPACE.whitepoint

# Calculate the CIE xy values for CIE Daylight of 6000K
xy_d6000 = colour.CCT_to_xy(6000, method='CIE Illuminant D Series')

# Calculate the CIE xy values for CIE Daylight of 'D60'
xy_d60 = colour.CCT_to_xy(cct_d60 , method='CIE Illuminant D Series')

# Place in an array
xy = np.array([xy_aces,xy_d6000,xy_d60])
# Print the table
df_T2 = pd.DataFrame( xy, 
                      index = ['ACES White Point', 'CIE Daylight 6000K', 'CIE Daylight 6003K'], 
                      columns = ['CIE x', 'CIE y'] )

pd.set_option('precision', 5)

display(df_T2)<jupyter_output><empty_output><jupyter_text>Table 3 - CIE u′v′ chromaticity coordinates and ∆u′v′ from the ACES white point rounded to 5 decimal places<jupyter_code># Calculate the CIE 1976 UCS u'v' values
uvp = colour.xy_to_Luv_uv(xy)

# Calculate the ∆u′v′ from the ACES white point
delta_uvp = colour.delta_E(uvp[0,:], uvp, method='cie1976')
# Print the table
df_T3 = pd.DataFrame( np.c_[uvp, delta_uvp], 
                      index = ['ACES White Point', 'CIE Daylight 6000K', 'CIE Daylight 6003K'], 
                      columns = ['CIE u\'', 'CIE v\'', '∆u\'v\''] )

pd.set_option('precision', 5)

display(df_T3)<jupyter_output><empty_output><jupyter_text>Table 4 - Estimation of the CCT of the ACES white point rounded to 2 decimal places<jupyter_code># Calculate the CIE 1960 UCS uv values
uv = colour.xy_to_UCS_uv(xy)

# Calculate the CCT from the chromaticity coordinates using various methods
cct_robertson = colour.uv_to_CCT(uv[0,:],'Robertson 1968')
cct_hernandez = colour.xy_to_CCT(xy[0,:],'Hernandez 1999')
cct_ohno = colour.uv_to_CCT(uv[0,:], 'Ohno 2013')
cct_mccamy = colour.xy_to_CCT(xy[0,:],'McCamy 1992')
# Print the table
df_T4 = pd.DataFrame( np.c_[cct_robertson[0], cct_hernandez, cct_ohno[0], cct_mccamy].T, 
                      index = ['Robertson', 'Hernandez-Andres', 'Ohno', 'McCamy'], 
                      columns = ['ACES white point CCT'] )

df_T4.index.name = 'CCT Estimation Method'

pd.set_option('precision', 2)

display(df_T4)<jupyter_output><empty_output><jupyter_text>Table 5 - Chromaticity difference from projected LAD patch<jupyter_code># Specify the CIE xy values of a projected LAD patch
xy_lad = np.array([0.32170, 0.33568])

# Daylight range from 5500 K to 6500 K in 100 K increments over which to calculate the differences
cct_dseries = np.arange(5500,6600,100)

# Calculate the CIE xy chromaticity coordinates of CIE Daylight
xy_dseries = colour.CCT_to_xy(cct_dseries, method='CIE Illuminant D Series')

# Calculate the CIE UCS 1976 u'v'
uvp_lad = colour.xy_to_Luv_uv(xy_lad)
uvp_dseries = colour.xy_to_Luv_uv(xy_dseries)

# Calculate the ∆u′v′ between the LAD and the CIE Daylight chromaticity coordinates
delta_uvp_lad = colour.delta_E(uvp_lad, uvp_dseries, method='cie1976')
# Print the table
df_T5 = pd.DataFrame( delta_uvp_lad.T, 
                      index = cct_dseries, 
                      columns =  ['∆u\'v\' from LAD chromaticity'])

df_T5.index.name = 'CCT Estimation Method'

pd.set_option('precision', 6)

display(df_T5)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11596922499530869, 'fraction_numerical': 0.04466128729592794, 'mean_word_length': 3.9953139643861295, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '9', 'dir': 'jupyter-structured-clean-dedup', 'id': '352967', 'license': 'AMPAS', 'n_tokens_mistral': 2139, 'n_tokens_neox': 1905, 'n_words': 496, 'path': 'documents/python/TB-2018-001/TB-2018-001_table_vals.ipynb', 'repo_name': 'zachlewis/aces-dev', 'size': '5329'}