diff --git a/cmweather/__init__.py b/cmweather/__init__.py index a0e26fa..2c30d5a 100644 --- a/cmweather/__init__.py +++ b/cmweather/__init__.py @@ -53,6 +53,8 @@ * balance * ChaseSpectral * SpectralExtended + * CM_depol + * CM_rhohv """ from pkg_resources import DistributionNotFound, get_distribution diff --git a/cmweather/_cm_colorblind.py b/cmweather/_cm_colorblind.py index e55c0d5..d9144dc 100644 --- a/cmweather/_cm_colorblind.py +++ b/cmweather/_cm_colorblind.py @@ -52,9 +52,19 @@ def yuv_rainbow_24(nc): # HomeyerRainbow developed by Cameron Homeyer with assistance from Bobby Jackson +# Crameri and Michelson colormaps were modified Oleron and Roma colormaps from +# the work done in Crameri et al. (2020), but modified by Michelson for +# depolarization ratio and rhohv moments in radar. + +cm_oleron_depol_vals = np.genfromtxt(os.path.join(data_dir, 'crameri-michelson-oleron-depol.txt')) + +cm_roma_rhohv_vals = np.genfromtxt(os.path.join(data_dir, 'crameri-michelson-roma-rhohv.txt')) + datad = { 'HomeyerRainbow': yuv_rainbow_24(15), 'balance': bal_rgb_vals, 'ChaseSpectral': chase_spectral_rgb_vals, 'SpectralExtended': spectral_ext_rgb_vals, + 'CM_depol': cm_oleron_depol_vals, + 'CM_rhohv': cm_roma_rhohv_vals, } diff --git a/cmweather/cm_colorblind.py b/cmweather/cm_colorblind.py index 95158a7..44f3ad5 100644 --- a/cmweather/cm_colorblind.py +++ b/cmweather/cm_colorblind.py @@ -8,6 +8,19 @@ * balance * ChaseSpectral * SpectralExtended + * CM_depol + * CM_rhohv + +CM_dopol and CM_rhohv are based on the work by: + +Crameri, F., G.E. Shephard and P.J. Heron, 2020: The misuse of colour in science +communication. Nat Commun 11, 5444 https://doi.org/10.1038/s41467-020-19160-7 + +Michelson D., B. Hansen, D. Jacques, F. Lemay, and P Rodriguez, 2020: Monitoring +the impact of weather radar data quality control for quantitative application +at the continental scale. Meteorol. Appl. 2020;27:e1929. 12 pp. +https://doi.org/10.1002/met.1929 + """ import warnings diff --git a/cmweather/CrameriMichelson_oleron_depolarization-ratio.txt b/cmweather/crameri-michelson-oleron-depol.txt similarity index 100% rename from cmweather/CrameriMichelson_oleron_depolarization-ratio.txt rename to cmweather/crameri-michelson-oleron-depol.txt diff --git a/cmweather/CrameriMichelson_roma_RHOHV.txt b/cmweather/crameri-michelson-roma-rhohv.txt similarity index 100% rename from cmweather/CrameriMichelson_roma_RHOHV.txt rename to cmweather/crameri-michelson-roma-rhohv.txt diff --git a/tests/test_cm_colorblind.py b/tests/test_cm_colorblind.py index 07a699a..b0b9d6e 100644 --- a/tests/test_cm_colorblind.py +++ b/tests/test_cm_colorblind.py @@ -15,6 +15,10 @@ def test_colormaps_exist(): assert isinstance(cm_colorblind.ChaseSpectral_r, matplotlib.colors.Colormap) assert isinstance(cm_colorblind.SpectralExtended, matplotlib.colors.Colormap) assert isinstance(cm_colorblind.SpectralExtended_r, matplotlib.colors.Colormap) + assert isinstance(cm_colorblind.CM_depol, matplotlib.colors.Colormap) + assert isinstance(cm_colorblind.CM_depol_r, matplotlib.colors.Colormap) + assert isinstance(cm_colorblind.CM_rhohv, matplotlib.colors.Colormap) + assert isinstance(cm_colorblind.CM_rhohv_r, matplotlib.colors.Colormap) def test_colormaps_registered(): @@ -41,3 +45,15 @@ def test_colormaps_registered(): cmap = matplotlib.colormaps.get_cmap('SpectralExtended_r') assert isinstance(cmap, matplotlib.colors.Colormap) + + cmap = matplotlib.colormaps.get_cmap('CM_depol') + assert isinstance(cmap, matplotlib.colors.Colormap) + + cmap = matplotlib.colormaps.get_cmap('CM_depol_r') + assert isinstance(cmap, matplotlib.colors.Colormap) + + cmap = matplotlib.colormaps.get_cmap('CM_rhohv') + assert isinstance(cmap, matplotlib.colors.Colormap) + + cmap = matplotlib.colormaps.get_cmap('CM_rhohv_r') + assert isinstance(cmap, matplotlib.colors.Colormap)