From 508083082d35c4dc11bd5421f50e52066f88aa90 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 21 Dec 2021 23:50:43 +0100 Subject: [PATCH 1/2] simplified --- python/damask/_colormap.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/python/damask/_colormap.py b/python/damask/_colormap.py index ba7617fbb..c2721e0fa 100644 --- a/python/damask/_colormap.py +++ b/python/damask/_colormap.py @@ -236,7 +236,7 @@ class Colormap(mpl.colors.ListedColormap): Parameters ---------- - field : numpy.array, shape (:,:) + field : numpy.ndarray, shape (:,:) Data to be shaded. bounds : sequence of float, len (2), optional Value range (left,right) spanned by colormap. @@ -616,7 +616,7 @@ class Colormap(mpl.colors.ListedColormap): @staticmethod - def _lab2xyz(lab: np.ndarray, ref_white: np.ndarray = None) -> np.ndarray: + def _lab2xyz(lab: np.ndarray, ref_white: np.ndarray = _REF_WHITE) -> np.ndarray: """ CIE Lab to CIE Xyz. @@ -624,6 +624,8 @@ class Colormap(mpl.colors.ListedColormap): ---------- lab : numpy.ndarray, shape (3) CIE lab values. + ref_white : numpy.ndarray, shape (3) + Reference white, default value is the standard 2° observer for D65. Returns ------- @@ -642,10 +644,10 @@ class Colormap(mpl.colors.ListedColormap): f_x**3. if f_x**3. > _EPS else (116.*f_x-16.)/_KAPPA, ((lab[0]+16.)/116.)**3 if lab[0]>_KAPPA*_EPS else lab[0]/_KAPPA, f_z**3. if f_z**3. > _EPS else (116.*f_z-16.)/_KAPPA - ])*(ref_white if ref_white is not None else _REF_WHITE) + ])*ref_white @staticmethod - def _xyz2lab(xyz: np.ndarray, ref_white: np.ndarray = None) -> np.ndarray: + def _xyz2lab(xyz: np.ndarray, ref_white: np.ndarray = _REF_WHITE) -> np.ndarray: """ CIE Xyz to CIE Lab. @@ -653,6 +655,8 @@ class Colormap(mpl.colors.ListedColormap): ---------- xyz : numpy.ndarray, shape (3) CIE Xyz values. + ref_white : numpy.ndarray, shape (3) + Reference white, default value is the standard 2° observer for D65. Returns ------- @@ -664,7 +668,6 @@ class Colormap(mpl.colors.ListedColormap): http://www.brucelindbloom.com/index.html?Eqn_Lab_to_XYZ.html """ - ref_white = ref_white if ref_white is not None else _REF_WHITE f = np.where(xyz/ref_white > _EPS,(xyz/ref_white)**(1./3.),(_KAPPA*xyz/ref_white+16.)/116.) return np.array([ From 09d68b1fff9fcf20e2255e786d9d3e15de297abd Mon Sep 17 00:00:00 2001 From: Test User Date: Mon, 3 Jan 2022 21:46:38 +0100 Subject: [PATCH 2/2] [skip ci] updated version information after successful test of v3.0.0-alpha5-342-ga177e32ff --- python/damask/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/damask/VERSION b/python/damask/VERSION index 0a2f00913..701bcd98b 100644 --- a/python/damask/VERSION +++ b/python/damask/VERSION @@ -1 +1 @@ -v3.0.0-alpha5-338-g4a0a1f7ac +v3.0.0-alpha5-342-ga177e32ff