Coverage for colour/models/datasets/macadam_ellipses.py: 100%

12 statements  

« prev     ^ index     » next       coverage.py v7.11.0, created at 2025-11-15 19:01 +1300

1""" 

2MacAdam (1942) Ellipses (Observer PGN) 

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

4 

5Define the *MacAdam (1942) Ellipses (Observer PGN)* ellipses data for colour 

6discrimination threshold analysis. 

7 

8References 

9---------- 

10- :cite:`Macadam1942` : Macadam, D. L. (1942). Visual Sensitivities to Color 

11 Differences in Daylight. Journal of the Optical Society of America, 32(5), 

12 28. doi:10.1364/JOSA.32.000247 

13- :cite:`Wyszecki2000` : Wyszecki, Günther, & Stiles, W. S. (2000). Table 

14 2(5.4.1) MacAdam Ellipses (Observer PGN) Observed and Calculated on the 

15 Basis of a Normal Distribution of Color Matches about a Color Center 

16 (Silberstein and MacAdam, 1945). In Color Science: Concepts and Methods, 

17 Quantitative Data and Formulae (p. 309). Wiley. ISBN:978-0-471-39918-6 

18""" 

19 

20from __future__ import annotations 

21 

22import typing 

23 

24import numpy as np 

25 

26if typing.TYPE_CHECKING: 

27 from colour.hints import NDArrayFloat 

28 

29__author__ = "Colour Developers" 

30__copyright__ = "Copyright 2013 Colour Developers" 

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

32__maintainer__ = "Colour Developers" 

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

34__status__ = "Production" 

35 

36__all__ = [ 

37 "DATA_MACADAM_1942_ELLIPSES", 

38] 

39 

40DATA_MACADAM_1942_ELLIPSES: NDArrayFloat = np.array( 

41 [ 

42 [0.160, 0.057, 0.85, 0.35, 62.5, 0.94, 0.30, 62.3], 

43 [0.187, 0.118, 2.20, 0.55, 77.0, 2.31, 0.44, 74.8], 

44 [0.253, 0.125, 2.50, 0.50, 55.5, 2.49, 0.49, 54.8], 

45 [0.150, 0.680, 9.60, 2.30, 105.0, 9.09, 2.21, 102.9], 

46 [0.131, 0.521, 4.70, 2.00, 112.5, 4.67, 2.10, 110.5], 

47 [0.212, 0.550, 5.80, 2.30, 100.0, 5.63, 2.30, 100.0], 

48 [0.258, 0.450, 5.00, 2.00, 92.0, 4.54, 2.08, 88.5], 

49 [0.152, 0.365, 3.80, 1.90, 110.0, 3.81, 1.86, 111.0], 

50 [0.280, 0.385, 4.00, 1.50, 75.5, 4.26, 1.46, 74.6], 

51 [0.380, 0.498, 4.40, 1.20, 70.0, 4.23, 1.32, 69.4], 

52 [0.160, 0.200, 2.10, 0.95, 104.0, 2.08, 0.94, 95.4], 

53 [0.228, 0.250, 3.10, 0.90, 72.0, 3.09, 0.82, 70.9], 

54 [0.305, 0.323, 2.30, 0.90, 58.0, 2.55, 0.68, 57.2], 

55 [0.385, 0.393, 3.80, 1.60, 65.5, 3.70, 1.48, 65.5], 

56 [0.472, 0.399, 3.20, 1.40, 51.0, 3.21, 1.30, 54.0], 

57 [0.527, 0.350, 2.60, 1.30, 20.0, 2.56, 1.27, 22.8], 

58 [0.475, 0.300, 2.90, 1.10, 28.5, 2.89, 0.99, 29.1], 

59 [0.510, 0.236, 2.40, 1.20, 29.5, 2.40, 1.15, 30.7], 

60 [0.596, 0.283, 2.60, 1.30, 13.0, 2.49, 1.15, 11.1], 

61 [0.344, 0.284, 2.30, 0.90, 60.0, 2.24, 0.97, 65.7], 

62 [0.390, 0.237, 2.50, 1.00, 47.0, 2.43, 0.98, 44.2], 

63 [0.441, 0.198, 2.80, 0.95, 34.5, 2.73, 0.90, 33.7], 

64 [0.278, 0.223, 2.40, 0.55, 57.5, 2.34, 0.61, 60.3], 

65 [0.300, 0.163, 2.90, 0.60, 54.0, 3.01, 0.60, 53.4], 

66 [0.365, 0.153, 3.60, 0.95, 40.0, 4.12, 0.90, 38.6], 

67 ] 

68) 

69""" 

70*MacAdam (1942) Ellipses (Observer PGN)* ellipses data. 

71 

72Table 2(5.4.1) data in *Wyszecki and Stiles (2000)* is as follows: 

73 

74+--------------+---------------------------+---------------------------+ 

75| Color Center | Observed | Calculated | 

76+--------------+---------------------------+---------------------------+ 

77| x_0 | y_0 | 10**3 a | 10**3 b | theta | 10**3 a | 10**3 b | theta | 

78+-------+------+---------+---------+-------+---------+---------+-------+ 

79 

80where :math:`x_0` and :math:`y_0` are the coordinates of the ellipse center, 

81:math:`a` is the semi-major axis length, :math:`b` is the semi-minor axis 

82length and :math:`\\theta` is the angle from the semi-major axis :math:`a`. 

83 

84The *Calculated* column should be preferred to the *Observed* one as the later 

85is the result from measurements observed on *MacAdam (1942)* diagrams while the 

86former is fitted on his observational data. 

87 

88References 

89---------- 

90:cite:`Wyszecki2000`, :cite:`Macadam1942` 

91"""