Coverage for recovery/datasets/smits1999.py: 0%

16 statements  

« prev     ^ index     » next       coverage.py v7.11.0, created at 2025-11-16 22:49 +1300

1""" 

2Smits (1999) - Reflectance Recovery Dataset 

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

4 

5Define the datasets for reflectance recovery using *Smits (1999)* method. 

6 

7References 

8---------- 

9- :cite:`Smits1999a` : Smits, B. (1999). An RGB-to-Spectrum Conversion for 

10 Reflectances. Journal of Graphics Tools, 4(4), 11-22. 

11 doi:10.1080/10867651.1999.10487511 

12""" 

13 

14from __future__ import annotations 

15 

16from colour.algebra import LinearInterpolator 

17from colour.colorimetry.spectrum import SpectralDistribution 

18from colour.utilities import CanonicalMapping 

19 

20__author__ = "Colour Developers" 

21__copyright__ = "Copyright 2013 Colour Developers" 

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

23__maintainer__ = "Colour Developers" 

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

25__status__ = "Production" 

26 

27__all__ = [ 

28 "DATA_SMITS1999", 

29 "SDS_SMITS1999", 

30] 

31 

32DATA_SMITS1999: dict = { 

33 "white": { 

34 380.0000: 1.0000, 

35 417.7778: 1.0000, 

36 455.5556: 0.9999, 

37 493.3333: 0.9993, 

38 531.1111: 0.9992, 

39 568.8889: 0.9998, 

40 606.6667: 1.0000, 

41 644.4444: 1.0000, 

42 682.2222: 1.0000, 

43 720.0000: 1.0000, 

44 }, 

45 "cyan": { 

46 380.0000: 0.9710, 

47 417.7778: 0.9426, 

48 455.5556: 1.0007, 

49 493.3333: 1.0007, 

50 531.1111: 1.0007, 

51 568.8889: 1.0007, 

52 606.6667: 0.1564, 

53 644.4444: 0.0000, 

54 682.2222: 0.0000, 

55 720.0000: 0.0000, 

56 }, 

57 "magenta": { 

58 380.0000: 1.0000, 

59 417.7778: 1.0000, 

60 455.5556: 0.9685, 

61 493.3333: 0.2229, 

62 531.1111: 0.0000, 

63 568.8889: 0.0458, 

64 606.6667: 0.8369, 

65 644.4444: 1.0000, 

66 682.2222: 1.0000, 

67 720.0000: 0.9959, 

68 }, 

69 "yellow": { 

70 380.0000: 0.0001, 

71 417.7778: 0.0000, 

72 455.5556: 0.1088, 

73 493.3333: 0.6651, 

74 531.1111: 1.0000, 

75 568.8889: 1.0000, 

76 606.6667: 0.9996, 

77 644.4444: 0.9586, 

78 682.2222: 0.9685, 

79 720.0000: 0.9840, 

80 }, 

81 "red": { 

82 380.0000: 0.1012, 

83 417.7778: 0.0515, 

84 455.5556: 0.0000, 

85 493.3333: 0.0000, 

86 531.1111: 0.0000, 

87 568.8889: 0.0000, 

88 606.6667: 0.8325, 

89 644.4444: 1.0149, 

90 682.2222: 1.0149, 

91 720.0000: 1.0149, 

92 }, 

93 "green": { 

94 380.0000: 0.0000, 

95 417.7778: 0.0000, 

96 455.5556: 0.0273, 

97 493.3333: 0.7937, 

98 531.1111: 1.0000, 

99 568.8889: 0.9418, 

100 606.6667: 0.1719, 

101 644.4444: 0.0000, 

102 682.2222: 0.0000, 

103 720.0000: 0.0025, 

104 }, 

105 "blue": { 

106 380.0000: 1.0000, 

107 417.7778: 1.0000, 

108 455.5556: 0.8916, 

109 493.3333: 0.3323, 

110 531.1111: 0.0000, 

111 568.8889: 0.0000, 

112 606.6667: 0.0003, 

113 644.4444: 0.0369, 

114 682.2222: 0.0483, 

115 720.0000: 0.0496, 

116 }, 

117} 

118 

119SDS_SMITS1999: CanonicalMapping = CanonicalMapping( 

120 { 

121 "white": SpectralDistribution(DATA_SMITS1999["white"], name="white"), 

122 "cyan": SpectralDistribution(DATA_SMITS1999["cyan"], name="cyan"), 

123 "magenta": SpectralDistribution(DATA_SMITS1999["magenta"], name="magenta"), 

124 "yellow": SpectralDistribution(DATA_SMITS1999["yellow"], name="yellow"), 

125 "red": SpectralDistribution(DATA_SMITS1999["red"], name="red"), 

126 "green": SpectralDistribution(DATA_SMITS1999["green"], name="green"), 

127 "blue": SpectralDistribution(DATA_SMITS1999["blue"], name="blue"), 

128 } 

129) 

130SDS_SMITS1999.__doc__ = """ 

131*Smits (1999)* spectral distributions. 

132 

133References 

134---------- 

135:cite:`Smits1999a` 

136""" 

137 

138# Using linear interpolation to preserve the shape of the basis spectral 

139# distributions once combined and interpolated. 

140for _sd in SDS_SMITS1999.values(): 

141 _sd.interpolator = LinearInterpolator