diff --git a/cmweather/__init__.py b/cmweather/__init__.py index 02d6b09..4e9f831 100644 --- a/cmweather/__init__.py +++ b/cmweather/__init__.py @@ -57,6 +57,7 @@ * CM_depol * CM_rhohv * plasmidis + * turbone """ from importlib.metadata import version, PackageNotFoundError diff --git a/cmweather/_cm_colorblind.py b/cmweather/_cm_colorblind.py index 326beb4..de25c6d 100644 --- a/cmweather/_cm_colorblind.py +++ b/cmweather/_cm_colorblind.py @@ -54,6 +54,9 @@ def yuv_rainbow_24(nc): plasmidis_rgb_vals = np.genfromtxt(os.path.join(data_dir, 'plasmidis-rgb.txt')) +# Turbone colormap for radar differential reflectivity +turbone_rgb_vals = np.genfromtxt(os.path.join(data_dir, 'turbone-rgb.txt')) + # HomeyerRainbow developed by Cameron Homeyer with assistance from Bobby Jackson # Crameri and Michelson colormaps were modified Oleron and Roma colormaps from @@ -70,6 +73,7 @@ def yuv_rainbow_24(nc): 'ChaseSpectral': chase_spectral_rgb_vals, 'SpectralExtended': spectral_ext_rgb_vals, 'plasmidis': plasmidis_rgb_vals, + 'turbone': turbone_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 f8b96df..892ed64 100644 --- a/cmweather/cm_colorblind.py +++ b/cmweather/cm_colorblind.py @@ -11,6 +11,7 @@ * CM_depol * CM_rhohv * plasmidis + * turbone CM_dopol and CM_rhohv are based on the work by: diff --git a/cmweather/turbone-rgb.txt b/cmweather/turbone-rgb.txt new file mode 100644 index 0000000..8eedc68 --- /dev/null +++ b/cmweather/turbone-rgb.txt @@ -0,0 +1,100 @@ +0.000000000000000000e+00 0.000000000000000000e+00 0.000000000000000000e+00 +1.076509034986543496e-02 1.076508613743456383e-02 1.497751700850843103e-02 +2.691272587466359001e-02 2.691271534358640957e-02 3.744379252127108537e-02 +4.023452518262207039e-02 4.023450943866169194e-02 5.597846981930026944e-02 +5.725682429834678955e-02 5.725680189348009153e-02 7.966166858900422532e-02 +7.044405997693194144e-02 7.044403241183744280e-02 9.800912692442706464e-02 +8.760092272202998909e-02 8.760088844337378389e-02 1.218795446567373653e-01 +1.071799307958477415e-01 1.071798888558328777e-01 1.491199037159620933e-01 +1.179450211457131747e-01 1.179449749932674346e-01 1.640974207244704774e-01 +1.375240292195309688e-01 1.375239754057265562e-01 1.913377797836952332e-01 +1.482891195693963882e-01 1.482890615431611547e-01 2.063152967922036729e-01 +1.678008458285274451e-01 1.678007801672612431e-01 2.334620463701251314e-01 +1.845540176855055559e-01 1.845539454686438152e-01 2.567708072146164255e-01 +1.980103806228373231e-01 1.980103031404369940e-01 2.754927034752519543e-01 +2.147635524798154338e-01 2.147634684418195661e-01 2.988014643197432485e-01 +2.282199154171472288e-01 2.282198261136127726e-01 3.175233605803787773e-01 +2.449730872741252563e-01 2.449729914149952614e-01 3.408321214248699049e-01 +2.584294502114571346e-01 2.584293490867884957e-01 3.595540176855055448e-01 +2.751826220684352453e-01 2.751825143881710956e-01 3.828627785299968389e-01 +2.946270665128796207e-01 2.946269512239121924e-01 4.099159186266150834e-01 +3.053921568627450678e-01 3.053920373613468464e-01 4.248934356351236064e-01 +2.613111764705882134e-01 3.035394117647060019e-01 7.213994117647060111e-01 +2.736719607843137170e-01 3.862923529411764201e-01 8.476190196078430272e-01 +2.711531372549020324e-01 5.160037254901959081e-01 9.701990196078431605e-01 +2.238652941176469680e-01 6.400994117647059722e-01 9.814845098039215454e-01 +1.726064705882352779e-01 7.169641176470588073e-01 9.375747058823529212e-01 +1.075386274509803897e-01 8.273350980392156773e-01 8.144801960784313621e-01 +1.005358823529409612e-01 8.875723529411763124e-01 7.271723529411768805e-01 +1.965876470588234226e-01 9.457088235294117684e-01 5.980758823529412904e-01 +3.084362745098037095e-01 9.773735294117646966e-01 4.871201960784315443e-01 +4.737500000000000044e-01 9.975500000000000478e-01 3.496299999999999963e-01 +4.848780392156862296e-01 9.980119607843137564e-01 3.412029411764705977e-01 +5.081580392156860304e-01 9.988527450980392297e-01 3.236845098039217716e-01 +5.417866666666666386e-01 9.990366666666666839e-01 2.992833333333334012e-01 +5.633423529411764052e-01 9.985723529411765220e-01 2.841429411764705981e-01 +5.936423529411761768e-01 9.967282352941176926e-01 2.638752941176472078e-01 +6.213976470588234990e-01 9.936388235294117965e-01 2.464799999999999769e-01 +6.385090196078431202e-01 9.908794117647058419e-01 2.365609803921568388e-01 +6.628607843137253042e-01 9.854680392156863755e-01 2.245754901960784755e-01 +6.790696078431371907e-01 9.810882352941175943e-01 2.181635294117647006e-01 +7.032970588235294418e-01 9.732176470588235206e-01 2.110615686274509850e-01 +7.273301960784311904e-01 9.640190196078431972e-01 2.063815686274509953e-01 +7.431835294117647983e-01 9.571758823529411542e-01 2.044717647058823529e-01 +7.666205882352941092e-01 9.458735294117647241e-01 2.032552941176470618e-01 +7.819743137254901999e-01 9.377166666666666428e-01 2.033384313725490333e-01 +8.044850980392156403e-01 9.245441176470589051e-01 2.046737254901960790e-01 +8.191262745098039089e-01 9.152225490196079782e-01 2.061678431372548914e-01 +8.403878431372548974e-01 9.004117647058823559e-01 2.091698039215686422e-01 +8.607603921568627303e-01 8.847466666666666812e-01 2.127290196078431284e-01 +8.737688235294117645e-01 8.738535294117647512e-01 2.152605882352941202e-01 +8.966864705882352515e-01 8.524947058823529877e-01 2.199488235294117522e-01 +9.112619607843136516e-01 8.376662745098039098e-01 2.228784313725490074e-01 +9.271607843137255056e-01 8.194403921568627069e-01 2.257184313725490166e-01 +9.416288235294116848e-01 8.007376470588236650e-01 2.276349019607843138e-01 +9.503499999999999170e-01 7.880352941176471671e-01 2.281835294117647017e-01 +9.620990196078430534e-01 7.687058823529412388e-01 2.277972549019607884e-01 +9.689099999999999380e-01 7.556611764705883916e-01 2.265141176470588380e-01 +9.776105882352941201e-01 7.359364705882353030e-01 2.229335294117646971e-01 +9.823682352941176532e-01 7.224509803921567164e-01 2.194056862745097647e-01 +9.881462745098038569e-01 7.011454901960784136e-01 2.128103921568627321e-01 +9.924325490196078681e-01 6.783376470588233786e-01 2.049790196078430937e-01 +9.943966666666667065e-01 6.623264705882352388e-01 1.990958823529411503e-01 +9.962366666666666593e-01 6.374052941176471254e-01 1.895186274509803870e-01 +9.966352941176470637e-01 6.201982352941177723e-01 1.826364705882353168e-01 +9.961623529411764988e-01 5.937182352941177133e-01 1.717635294117647315e-01 +9.943947058823530138e-01 5.665858823529412724e-01 1.603341176470588492e-01 +9.924166666666667247e-01 5.481933333333335323e-01 1.524600000000000677e-01 +9.885452941176471331e-01 5.203860784313726340e-01 1.404409803921569111e-01 +9.852354901960784783e-01 5.017617647058825181e-01 1.323421568627451417e-01 +9.793954901960784110e-01 4.738490196078433692e-01 1.201935294117648101e-01 +9.724582352941175678e-01 4.461117647058822078e-01 1.081699999999999329e-01 +9.671476470588235008e-01 4.278782352941175593e-01 1.003305882352940881e-01 +9.584535294117647597e-01 4.009229411764706485e-01 8.887882352941178787e-02 +9.520319607843137355e-01 3.834088235294116909e-01 8.159196078431370236e-02 +9.417154901960784752e-01 3.577805882352940725e-01 7.116686274509803622e-02 +9.308135294117647618e-01 3.344335294117647961e-01 6.211588235294121518e-02 +9.171625490196079200e-01 3.079668627450982687e-01 5.230490196078438347e-02 +9.041731372549020040e-01 2.862874509803922107e-01 4.495490196078432560e-02 +8.950358823529412922e-01 2.728364705882354024e-01 4.085294117647061962e-02 +8.806599999999999984e-01 2.533400000000000096e-01 3.520999999999999824e-02 +8.704168627450981077e-01 2.407596078431373243e-01 3.176686274509805258e-02 +8.543411764705883815e-01 2.223117647058824864e-01 2.692882352941180016e-02 +8.371641176470590029e-01 2.045196078431374409e-01 2.258470588235298587e-02 +8.251876470588235257e-01 1.929745098039215012e-01 1.992588235294116480e-02 +8.063488235294117290e-01 1.761721568627450940e-01 1.633235294117646799e-02 +7.932194117647057841e-01 1.653094117647057881e-01 1.419117647058821922e-02 +7.726988235294116603e-01 1.495170588235293918e-01 1.135882352941176149e-02 +7.584164705882353585e-01 1.393445098039215735e-01 9.743137254901963057e-03 +7.362239215686275928e-01 1.245329411764706795e-01 7.662549019607852070e-03 +7.129160784313726129e-01 1.103937254901960902e-01 6.080196078431372893e-03 +6.969003921568628357e-01 1.012486274509804413e-01 5.240980392156866993e-03 +6.719147058823531360e-01 8.810901960784323084e-02 4.425686274509807103e-03 +6.547382352941176764e-01 7.965411764705886133e-02 4.104117647058824932e-03 +6.280717647058825515e-01 6.751529411764713162e-02 4.040588235294115260e-03 +6.003717647058824936e-01 5.599470588235299501e-02 4.443529411764702945e-03 +5.814117647058821836e-01 4.860176470588229575e-02 4.932941176470593929e-03 +5.520021568627451192e-01 3.809039215686273877e-02 6.111176470588236195e-03 +5.319182352941177472e-01 3.137039215686276278e-02 7.111960784313722111e-03 +5.008078431372547934e-01 2.187705882352938488e-02 9.044117647058830950e-03 +4.796000000000000263e-01 1.583000000000000032e-02 1.055000000000000035e-02 diff --git a/tests/test_cm_colorblind.py b/tests/test_cm_colorblind.py index ae36252..17d2d76 100644 --- a/tests/test_cm_colorblind.py +++ b/tests/test_cm_colorblind.py @@ -21,6 +21,8 @@ def test_colormaps_exist(): assert isinstance(cm_colorblind.CM_rhohv_r, matplotlib.colors.Colormap) assert isinstance(cm_colorblind.plasmidis, matplotlib.colors.Colormap) assert isinstance(cm_colorblind.plasmidis_r, matplotlib.colors.Colormap) + assert isinstance(cm_colorblind.turbone, matplotlib.colors.Colormap) + assert isinstance(cm_colorblind.turbone_r, matplotlib.colors.Colormap) def test_colormaps_registered(): @@ -65,3 +67,9 @@ def test_colormaps_registered(): cmap = matplotlib.colormaps.get_cmap('plasmidis_r') assert isinstance(cmap, matplotlib.colors.Colormap) + + cmap = matplotlib.colormaps.get_cmap('turbone') + assert isinstance(cmap, matplotlib.colors.Colormap) + + cmap = matplotlib.colormaps.get_cmap('turbone_r') + assert isinstance(cmap, matplotlib.colors.Colormap)