Coverage for colorimetry/datasets/illuminants/hunterlab.py: 0%

1"""

2 CIE XYZ Tristimulus Values of the Hunter L,a,b Illuminants

3==========================================================

4

5 Define the *CIE XYZ* tristimulus values of the *Hunter L,a,b* illuminants

6 dataset for the *CIE 1931 2 Degree Standard Observer* and

7*CIE 1964 10 Degree Standard Observer*.

8

9 The currently implemented data has been extracted from :cite:`HunterLab2008b`,

10 however you may want to use different data according to the tables specified

11 in :cite:`HunterLab2008c`.

12

13 References

14----------

15- :cite:`HunterLab2008b` : HunterLab. (2008). Hunter L,a,b Color Scale.

16 http://www.hunterlab.se/wp-content/uploads/2012/11/Hunter-L-a-b.pdf

17- :cite:`HunterLab2008c` : HunterLab. (2008). Illuminant Factors in

18 Universal Software and EasyMatch Coatings.

19 https://support.hunterlab.com/hc/en-us/article_attachments/201437785/\

20 an02_02.pdf

21"""

22

23 from __future__ import annotations

24

25 import typing

26 from dataclasses import dataclass

27

28 import numpy as np

29

30 if typing.TYPE_CHECKING:

31 from colour.hints import NDArrayFloat

32

33 from colour.utilities import CanonicalMapping

34

35 __author__ = "Colour Developers"

36 __copyright__ = "Copyright 2013 Colour Developers"

37 __license__ = "BSD-3-Clause - https://opensource.org/licenses/BSD-3-Clause"

38 __maintainer__ = "Colour Developers"

39 __email__ = "colour-developers@colour-science.org"

40 __status__ = "Production"

41

42 __all__ = [

43 "Illuminant_Specification_HunterLab",

44 "DATA_ILLUMINANTS_HUNTERLAB_STANDARD_OBSERVER_2_DEGREE_CIE1931",

45 "TVS_ILLUMINANTS_HUNTERLAB_STANDARD_OBSERVER_2_DEGREE_CIE1931",

46 "DATA_ILLUMINANTS_HUNTERLAB_STANDARD_OBSERVER_10_DEGREE_CIE1964",

47 "TVS_ILLUMINANTS_HUNTERLAB_STANDARD_OBSERVER_10_DEGREE_CIE1964",

48 "TVS_ILLUMINANTS_HUNTERLAB",

49]

50

51

52@dataclass(frozen=True)

53 class Illuminant_Specification_HunterLab:

54 """

55 Define the specification for an *HunterLab* illuminant.

56

57 Parameters

58 ----------

59 name

60 Illuminant name.

61 XYZ_n

62 Illuminant *CIE XYZ* tristimulus values.

63 K_ab

64 Illuminant :math:`K_{a}` and :math:`K_{b}` chromaticity

65 coefficients.

66 """

67

68 name: str

69 XYZ_n: NDArrayFloat

70 K_ab: NDArrayFloat

71

72

73 DATA_ILLUMINANTS_HUNTERLAB_STANDARD_OBSERVER_2_DEGREE_CIE1931: tuple = (

74 ("A", np.array([109.83, 100.00, 35.55]), np.array([185.20, 38.40])),

75 ("C", np.array([98.04, 100.00, 118.11]), np.array([175.00, 70.00])),

76 ("D50", np.array([96.38, 100.00, 82.45]), np.array([173.51, 58.48])),

77 ("D60", np.array([95.23, 100.00, 100.86]), np.array([172.47, 64.72])),

78 ("D65", np.array([95.02, 100.00, 108.82]), np.array([172.30, 67.20])),

79 ("D75", np.array([94.96, 100.00, 122.53]), np.array([172.22, 71.30])),

80 ("FL2", np.array([98.09, 100.00, 67.53]), np.array([175.00, 52.90])),

81 ("TL 4", np.array([101.40, 100.00, 65.90]), np.array([178.00, 52.30])),

82 ("UL 3000", np.array([107.99, 100.00, 33.91]), np.array([183.70, 37.50])),

83)

84

85 TVS_ILLUMINANTS_HUNTERLAB_STANDARD_OBSERVER_2_DEGREE_CIE1931: CanonicalMapping = (

86 CanonicalMapping(

87 {

88 x[0]: Illuminant_Specification_HunterLab(*x)

89 for x in DATA_ILLUMINANTS_HUNTERLAB_STANDARD_OBSERVER_2_DEGREE_CIE1931

90 }

91 )

92)

93"""

94*CIE XYZ* tristimulus values of the *Hunter L,a,b* illuminants for the

95*CIE 1931 2 Degree Standard Observer*.

96

97 References

98----------

99:cite:`HunterLab2008b`, :cite:`HunterLab2008c`

100"""

101

102 DATA_ILLUMINANTS_HUNTERLAB_STANDARD_OBSERVER_10_DEGREE_CIE1964: tuple = (

103 ("A", np.array([111.16, 100.00, 35.19]), np.array([186.30, 38.20])),

104 ("C", np.array([97.30, 100.00, 116.14]), np.array([174.30, 69.40])),

105 ("D50", np.array([96.72, 100.00, 81.45]), np.array([173.82, 58.13])),

106 ("D60", np.array([95.21, 100.00, 99.60]), np.array([172.45, 64.28])),

107 ("D65", np.array([94.83, 100.00, 107.38]), np.array([172.10, 66.70])),

108 ("D75", np.array([94.45, 100.00, 120.70]), np.array([171.76, 70.76])),

109 ("FL2", np.array([102.13, 100.00, 69.37]), np.array([178.60, 53.60])),

110 ("TL 4", np.array([103.82, 100.00, 66.90]), np.array([180.10, 52.70])),

111 ("UL 3000", np.array([111.12, 100.00, 35.21]), np.array([186.30, 38.20])),

112)

113

114 TVS_ILLUMINANTS_HUNTERLAB_STANDARD_OBSERVER_10_DEGREE_CIE1964: CanonicalMapping = (

115 CanonicalMapping(

116 {

117 x[0]: Illuminant_Specification_HunterLab(*x)

118 for x in DATA_ILLUMINANTS_HUNTERLAB_STANDARD_OBSERVER_10_DEGREE_CIE1964

119 }

120 )

121)

122"""

123*CIE XYZ* tristimulus values of the *Hunter L,a,b* illuminants for the

124*CIE 1964 10 Degree Standard Observer*.

125

126 References

127----------

128:cite:`HunterLab2008b`, :cite:`HunterLab2008c`

129"""

130

131 TVS_ILLUMINANTS_HUNTERLAB: CanonicalMapping = CanonicalMapping(

132 {

133 "CIE 1931 2 Degree Standard Observer": (

134 TVS_ILLUMINANTS_HUNTERLAB_STANDARD_OBSERVER_2_DEGREE_CIE1931

135 ),

136 "CIE 1964 10 Degree Standard Observer": (

137 TVS_ILLUMINANTS_HUNTERLAB_STANDARD_OBSERVER_10_DEGREE_CIE1964

138 ),

139 }

140)

141 TVS_ILLUMINANTS_HUNTERLAB.__doc__ = """

142*CIE XYZ* tristimulus values of the *HunterLab* illuminants.

143

144 References

145----------

146:cite:`HunterLab2008b`, :cite:`HunterLab2008c`

147

148 Aliases:

149

150- 'cie_2_1931': 'CIE 1931 2 Degree Standard Observer'

151- 'cie_10_1964': 'CIE 1964 10 Degree Standard Observer'

152"""

153 TVS_ILLUMINANTS_HUNTERLAB["cie_2_1931"] = TVS_ILLUMINANTS_HUNTERLAB[

154 "CIE 1931 2 Degree Standard Observer"

155]

156 TVS_ILLUMINANTS_HUNTERLAB["cie_10_1964"] = TVS_ILLUMINANTS_HUNTERLAB[

157 "CIE 1964 10 Degree Standard Observer"

158]