Skip to content

Instantly share code, notes, and snippets.

@KelSolaar
Created August 19, 2023 23:14
Show Gist options
  • Save KelSolaar/7810005d447da8e91ba7355125ca0cc8 to your computer and use it in GitHub Desktop.
Save KelSolaar/7810005d447da8e91ba7355125ca0cc8 to your computer and use it in GitHub Desktop.
PLASA ANSI E1.54 - Whitepoint Derivation
# Standard claims at https://webstore.ansi.org/preview-pages/ESTA/preview_ANSI+E1.54-2015.pdf gives [0.4254, 0.4044]
import colour
# Blackbody: 360, 780, 1nm
# CIE 1931 2 Degree Standard Observer: 360, 780, 1nm
# Method: ASTM E308
print(
colour.XYZ_to_xy(
colour.sd_to_XYZ(
colour.sd_blackbody(3200),
colour.MSDS_CMFS["CIE 1931 2 Degree Standard Observer"],
)
).round(4)
)
# [ 0.4234 0.399 ]
# Blackbody: 360, 780, 1nm
# CIE 1964 10 Degree Standard Observer: 360, 780, 1nm
# Method: ASTM E308
print(
colour.XYZ_to_xy(
colour.sd_to_XYZ(
colour.sd_blackbody(3200),
colour.MSDS_CMFS["CIE 1964 10 Degree Standard Observer"],
)
).round(4)
)
# [ 0.4266 0.3976]
# Blackbody: 400, 700, 10nm
# CIE 1931 2 Degree Standard Observer: 360, 780, 1nm
# Method: ASTM E308
print(
colour.XYZ_to_xy(
colour.sd_to_XYZ(
colour.sd_blackbody(3200, shape=colour.SpectralShape(400, 700, 10)),
colour.MSDS_CMFS["CIE 1931 2 Degree Standard Observer"],
)
).round(4)
)
# [ 0.4233 0.3989]
# Blackbody: 400, 700, 10nm
# CIE 1931 2 Degree Standard Observer: 400, 700, 10nm
# Method: Integration
print(
colour.XYZ_to_xy(
colour.sd_to_XYZ(
colour.sd_blackbody(3200, shape=colour.SpectralShape(400, 700, 10)),
colour.MSDS_CMFS["CIE 1931 2 Degree Standard Observer"]
.copy()
.align(colour.SpectralShape(400, 700, 10)),
method="Integration",
)
).round(4)
)
# [ 0.4231 0.3993]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment