From 657210042258eabe068ba7f3e8a1aa1b827d7b03 Mon Sep 17 00:00:00 2001 From: jthielen Date: Wed, 16 Nov 2022 12:19:33 -0700 Subject: [PATCH] Add Spectral-like colormaps based on pyart#1320 (#1325) * Add Spectral-like colormaps based on pyart#1320 * Add colormaps to example --- examples/plotting/plot_choose_a_colormap.py | 5 +- pyart/graph/__init__.py | 2 + pyart/graph/_cm_colorblind.py | 18 +- pyart/graph/chase-spectral-rgb.txt | 180 ++++++++++++++++++++ pyart/graph/cm_colorblind.py | 3 + pyart/graph/spectral-extended-rgb.txt | 180 ++++++++++++++++++++ tests/graph/test_cm_colorblind.py | 28 ++- 7 files changed, 409 insertions(+), 7 deletions(-) create mode 100644 pyart/graph/chase-spectral-rgb.txt create mode 100644 pyart/graph/spectral-extended-rgb.txt diff --git a/examples/plotting/plot_choose_a_colormap.py b/examples/plotting/plot_choose_a_colormap.py index 63faad28f8..8847df4e9e 100644 --- a/examples/plotting/plot_choose_a_colormap.py +++ b/examples/plotting/plot_choose_a_colormap.py @@ -54,7 +54,10 @@ def plot_color_gradients(cmap_category, cmap_list): # These colormaps are the most inclusive, and should be used where # possible. -plot_color_gradients("Colorblind Friendly", ["LangRainbow12", "HomeyerRainbow", "balance"]) +plot_color_gradients( + "Colorblind Friendly", + ["LangRainbow12", "HomeyerRainbow", "balance", "ChaseSpectral", "SpectralExtended"] +) ###################################### # **Perceptually Uniform Colormaps** diff --git a/pyart/graph/__init__.py b/pyart/graph/__init__.py index 00bc231bfd..fd2d1666c5 100644 --- a/pyart/graph/__init__.py +++ b/pyart/graph/__init__.py @@ -49,6 +49,8 @@ * LangRainbow12 * HomeyerRainbow * balance + * ChaseSpectral + * SpectralExtended """ diff --git a/pyart/graph/_cm_colorblind.py b/pyart/graph/_cm_colorblind.py index c413d17743..469a707f4f 100644 --- a/pyart/graph/_cm_colorblind.py +++ b/pyart/graph/_cm_colorblind.py @@ -38,11 +38,21 @@ def yuv_rainbow_24(nc): # Thyng, K. M., Greene, C. A., Hetland, R. D., Zimmerle, H. M., & DiMarco, S. F. (2016). # True colors of oceanography. Oceanography, 29(3), 10. -# HomeyerRainbow developed by Cameron Homeyer with assistance from Bobby Jackson - - data_dir = os.path.split(__file__)[0] bal_rgb_vals = np.genfromtxt(os.path.join(data_dir, 'balance-rgb.txt')) + +# "Spectral"-like colormaps for radar reflectivity +# ChaseSpectral developed by Randy Chase with assistance from Sam Gardner and Jonathan Thielen +# SpectralExtended developed by Jonathan Thielen based on ChaseSpectral + +chase_spectral_rgb_vals = np.genfromtxt(os.path.join(data_dir, 'chase-spectral-rgb.txt')) +spectral_ext_rgb_vals = np.genfromtxt(os.path.join(data_dir, 'spectral-extended-rgb.txt')) + + +# HomeyerRainbow developed by Cameron Homeyer with assistance from Bobby Jackson + datad = {'HomeyerRainbow': yuv_rainbow_24(15), - 'balance': bal_rgb_vals} + 'balance': bal_rgb_vals, + 'ChaseSpectral': chase_spectral_rgb_vals, + 'SpectralExtended': spectral_ext_rgb_vals} diff --git a/pyart/graph/chase-spectral-rgb.txt b/pyart/graph/chase-spectral-rgb.txt new file mode 100644 index 0000000000..142b10daca --- /dev/null +++ b/pyart/graph/chase-spectral-rgb.txt @@ -0,0 +1,180 @@ +2.491587318630544227e-03 0.000000000000000000e+00 1.238497574313402773e-02 +1.921773759405308313e-02 1.328624481639428985e-02 3.231025819473654775e-02 +3.658093634274969114e-02 2.805423983363999896e-02 5.381675386098778296e-02 +5.294470009390365300e-02 4.244028154055207863e-02 7.213062231236241906e-02 +6.658209706708043130e-02 5.494952540396814272e-02 8.788848915960603692e-02 +7.828532464084167475e-02 6.569663206458462024e-02 1.019133473263799106e-01 +8.774627903391646333e-02 7.532763064627764904e-02 1.160366283830516765e-01 +9.608542813730694410e-02 8.388232266148029637e-02 1.305319484336847080e-01 +1.051990600061633307e-01 9.139766310160754581e-02 1.453366611350159210e-01 +1.143925332853241994e-01 9.895719929230178957e-02 1.603565455412020724e-01 +1.236459743440020964e-01 1.065867695949899718e-01 1.755810433757895583e-01 +1.329594056770956323e-01 1.142846467839237490e-01 1.910026176979827961e-01 +1.423326780515855872e-01 1.220491880997151557e-01 2.066143053850765243e-01 +1.517655114876109712e-01 1.298788305108602437e-01 2.224096588254607099e-01 +1.612575264712807765e-01 1.377720860108199441e-01 2.383826936302203547e-01 +1.708082679545429305e-01 1.457275370563173578e-01 2.545278421651003264e-01 +1.804172239592328475e-01 1.537438322082816111e-01 2.708399124412158576e-01 +1.900838400977104548e-01 1.618196820080670395e-01 2.873140518120346765e-01 +1.998075309712657455e-01 1.699538551029381450e-01 3.039457149186380325e-01 +2.095876891591502700e-01 1.781451746228690791e-01 3.207306353596305337e-01 +2.194236923329696554e-01 1.863925148032264389e-01 3.376648006126894974e-01 +2.293149089017260112e-01 1.946947978433819226e-01 3.547444297895380738e-01 +2.392607024975815788e-01 2.030509909887441289e-01 3.719659538591549297e-01 +2.492604355416123130e-01 2.114601038224409590e-01 3.893259980226194128e-01 +2.593134720756320455e-01 2.199211857524749347e-01 4.068213659661921167e-01 +2.694191800058509667e-01 2.284333236803017253e-01 4.244490257569572544e-01 +2.795769328732853332e-01 2.369956398372606854e-01 4.422060971779609995e-01 +2.897861112420852536e-01 2.456072897759570273e-01 4.600898403277725035e-01 +3.000461037784800111e-01 2.542674605044711322e-01 4.780976453333534715e-01 +3.103563080786291284e-01 2.629753687521054761e-01 4.962270230455848030e-01 +3.207161312923115792e-01 2.717302593562054835e-01 5.144755966042726669e-01 +3.311249905804125038e-01 2.805314037604059729e-01 5.328410937743832676e-01 +3.415823584034797800e-01 2.893781878355812243e-01 5.513208663517170649e-01 +3.520864698846795648e-01 2.982709895139585288e-01 5.699100705078143925e-01 +3.626292452733528293e-01 3.072149700795872573e-01 5.885931009906794076e-01 +3.731725126883799759e-01 3.162349022923335307e-01 6.073166391422907262e-01 +3.835684996112458944e-01 3.254178172965314642e-01 6.259301309289746484e-01 +3.933843749267976198e-01 3.349944088647703877e-01 6.441067607805428530e-01 +4.016713180922427684e-01 3.454222331875328456e-01 6.613179588797127861e-01 +4.069156093882402847e-01 3.573463785025636219e-01 6.769567442797975731e-01 +4.074599054729932113e-01 3.713274293086404332e-01 6.905909806936888495e-01 +4.022968399432315101e-01 3.874670617414102125e-01 7.021598000653095362e-01 +3.916190272313544996e-01 4.052882310067690286e-01 7.119412504953325227e-01 +3.766076548944487512e-01 4.240177096535736601e-01 7.203375941837565355e-01 +3.586879168051679834e-01 4.429805325403826655e-01 7.276780477656282775e-01 +3.389684950526641316e-01 4.617722727676918937e-01 7.341484532598764323e-01 +3.182701330608626034e-01 4.801975992804505267e-01 7.397743004894358210e-01 +2.975380777560406309e-01 4.981643586862719020e-01 7.443189423745032451e-01 +2.782356343097356355e-01 5.156450695105297966e-01 7.470997393591877200e-01 +2.624369809124530439e-01 5.326711207928083169e-01 7.469866546910617355e-01 +2.523316670179955312e-01 5.493025406502458630e-01 7.428566828712679371e-01 +2.491179225414517084e-01 5.655840527839965937e-01 7.343172939531251719e-01 +2.522199829625308976e-01 5.815309105792504374e-01 7.220388721983573843e-01 +2.597984989666126121e-01 5.971520290969289935e-01 7.073314124740867070e-01 +2.699418598131884117e-01 6.124761563034991640e-01 6.913968891923087945e-01 +2.813751612175088845e-01 6.275493875453178605e-01 6.749240519450622200e-01 +2.935126820811935766e-01 6.424053926032058381e-01 6.582127371770206681e-01 +3.063185037098662411e-01 6.570224289209322110e-01 6.415967764035395149e-01 +3.202520046229441197e-01 6.712877289433464290e-01 6.258365919199179173e-01 +3.361767323789121020e-01 6.850088089981186679e-01 6.121319301833816340e-01 +3.549770745820060580e-01 6.979979864067664685e-01 6.015997055370958524e-01 +3.769746644442351635e-01 7.101849199617357167e-01 5.945972934672992816e-01 +4.016592555188410740e-01 7.216625973555056417e-01 5.905427889573091615e-01 +4.279927783460485413e-01 7.326300747025513704e-01 5.883846980218587763e-01 +4.549589537484718949e-01 7.432906607111362529e-01 5.872050838318993993e-01 +4.819169604718663291e-01 7.537845486656257199e-01 5.864561680492161866e-01 +5.086265718380801326e-01 7.641818771945083633e-01 5.858423203908765808e-01 +5.350793431627743901e-01 7.745114539811094323e-01 5.851363495209892518e-01 +5.613104434757932859e-01 7.847933147539455367e-01 5.840978366506985875e-01 +5.872849105771840161e-01 7.950573993163035924e-01 5.825078415106638152e-01 +6.128844828768119646e-01 8.053428878825712456e-01 5.802646269966033055e-01 +6.379939021096188156e-01 8.156801806857338910e-01 5.774330409641608153e-01 +6.626184816022165913e-01 8.260702180199759326e-01 5.741685512701821814e-01 +6.869079831407115533e-01 8.364827703370800727e-01 5.705948745714631842e-01 +7.110428610159712504e-01 8.468792024067447466e-01 5.667905704270348455e-01 +7.350865447037018274e-01 8.572398237629603734e-01 5.629180508629930690e-01 +7.589321151074746030e-01 8.675724108554083713e-01 5.593878412660627797e-01 +7.823504956513493980e-01 8.779001029436256376e-01 5.569777403249801528e-01 +8.050554698778819018e-01 8.882474809582021624e-01 5.568616413755242966e-01 +8.267512092510692634e-01 8.986387786400020783e-01 5.604108141197535753e-01 +8.472095149843594797e-01 9.091006838255575317e-01 5.686604283247991276e-01 +8.663811145860760288e-01 9.196556199980889801e-01 5.817274532333130965e-01 +8.844526825034170203e-01 9.303074257189875018e-01 5.987181648235022635e-01 +9.017752049790235258e-01 9.410357991358145879e-01 6.182485505649488733e-01 +9.187153956842156743e-01 9.518062481845422917e-01 6.390932676023294290e-01 +9.355553305055087643e-01 9.625851523600569282e-01 6.604473764758707066e-01 +9.524981387722576409e-01 9.733495708555574000e-01 6.817314683792630170e-01 +9.697427075190795387e-01 9.840891707348572437e-01 7.022161781556218729e-01 +9.875564727577291757e-01 9.947988126567285372e-01 7.208193646517077058e-01 +9.980407582045668358e-01 9.973360522701887332e-01 7.285604345804711501e-01 +9.901081341662908430e-01 9.805280486371984461e-01 7.139421557523695228e-01 +9.832921183557173928e-01 9.636719697773511450e-01 6.953632580311194245e-01 +9.773247105504668797e-01 9.467720315871103187e-01 6.736725338087442561e-01 +9.718012632191853628e-01 9.298537865135397817e-01 6.500943381243378116e-01 +9.663890021662356888e-01 9.129414783025250335e-01 6.256850968508929078e-01 +9.609540913422064401e-01 8.960319858754917099e-01 6.010808973083388018e-01 +9.555703321549603446e-01 8.790785433496510759e-01 5.765990298015855053e-01 +9.504686901658377929e-01 8.619848588841476644e-01 5.524940776715514534e-01 +9.459565461927416097e-01 8.446168450986671905e-01 5.291397436626922302e-01 +9.422938604457962164e-01 8.268438187355671154e-01 5.070074252916694224e-01 +9.395729615486616559e-01 8.085927166950097611e-01 4.864503172310807311e-01 +9.376981768110149718e-01 7.898713125314273942e-01 4.674718760614883784e-01 +9.364676752058403997e-01 7.707444542112941166e-01 4.497070119696764956e-01 +9.356527829986327482e-01 7.512973497424082492e-01 4.326419511471316093e-01 +9.350195740872602190e-01 7.316173915660021398e-01 4.158722656183817534e-01 +9.343573494980812466e-01 7.117791695881325875e-01 3.992230218226498484e-01 +9.335648756142448379e-01 6.918074664813864683e-01 3.827490810251897857e-01 +9.327101603754452963e-01 6.716444449334502131e-01 3.667140568017910884e-01 +9.319595477552291563e-01 6.511713889089448815e-01 3.515520705284561620e-01 +9.314169854435215834e-01 6.302839565213184114e-01 3.377209433706351849e-01 +9.310296827682809084e-01 6.089545159356072324e-01 3.254539980932857901e-01 +9.306432638093524723e-01 5.872242187691005810e-01 3.145970957378831923e-01 +9.301245783303129233e-01 5.651424372654756390e-01 3.046934957439262348e-01 +9.294267649644918361e-01 5.427160958250945022e-01 2.952352339035276829e-01 +9.285558487843162956e-01 5.199094507764837614e-01 2.858706783655494132e-01 +9.274643902597414780e-01 4.967005378030532881e-01 2.764880193747087933e-01 +9.259240389407737970e-01 4.731756982138288214e-01 2.672639230506010932e-01 +9.234711163596823758e-01 4.496035876395663711e-01 2.587467580210295326e-01 +9.195129965638397795e-01 4.264099494946080315e-01 2.518593801540759958e-01 +9.135736866352892616e-01 4.040267237927211430e-01 2.475981287011050358e-01 +9.055280333993521724e-01 3.826919211952165556e-01 2.464654113583631956e-01 +8.956528296047865378e-01 3.623437102019935185e-01 2.480965004984162503e-01 +8.844577644744280320e-01 3.426902787839808950e-01 2.514863799218179929e-01 +8.724404890113568456e-01 3.233794743789056847e-01 2.555998932478791286e-01 +8.599410549929589198e-01 3.041242778043479200e-01 2.598006529424506383e-01 +8.471298230752026814e-01 2.847363627062785008e-01 2.638605711868699522e-01 +8.340532096652387706e-01 2.651172313043368978e-01 2.677304454377096854e-01 +8.206709470780187976e-01 2.452608083507071268e-01 2.713113994435089049e-01 +8.068823812198757661e-01 2.252642569365564396e-01 2.743528736776507659e-01 +7.925681574071996582e-01 2.052990065432801492e-01 2.765327557716383833e-01 +7.776437086548244615e-01 1.855231800585573354e-01 2.776620930726645953e-01 +7.620881787474551583e-01 1.659938811053616181e-01 2.778098473048807304e-01 +7.459252040529300576e-01 1.466621507519489664e-01 2.772148588299371275e-01 +7.291837579643043465e-01 1.274402995743348366e-01 2.760954516834964734e-01 +7.118643606327572648e-01 1.082736208210070550e-01 2.746220501928834379e-01 +6.939114128763002043e-01 8.917323459852671830e-02 2.731619874805619186e-01 +6.751925157681596401e-01 7.018975339513075506e-02 2.726604632714438869e-01 +6.555544703778218851e-01 5.112188655540585852e-02 2.747104787145964733e-01 +6.350589782820527107e-01 3.082192500319925338e-02 2.807508245877506359e-01 +6.143394151378338552e-01 9.946609770185134772e-03 2.905377427866415174e-01 +6.096174471715584131e-01 1.689067352390654503e-02 3.132536812924263114e-01 +6.304362302694949127e-01 6.415999880604145167e-02 3.523023872285024338e-01 +6.545332720619715383e-01 9.240290591553368404e-02 3.867931688005283863e-01 +6.816771386719749914e-01 1.121795130427629683e-01 4.165734585630757048e-01 +7.106931461283616525e-01 1.285922649813384111e-01 4.432172748824148578e-01 +7.401742431623169471e-01 1.447501537429476681e-01 4.684441576756514514e-01 +7.687478120884442268e-01 1.630208970332134855e-01 4.933201793214440634e-01 +7.950315753590273538e-01 1.853358302944488334e-01 5.182632140904128715e-01 +8.177791370615994371e-01 2.127627953382852377e-01 5.432386337435157753e-01 +8.362698416153079295e-01 2.450086989067829513e-01 5.678838319976026172e-01 +8.505563725418664456e-01 2.806737230285537565e-01 5.916628811036308555e-01 +8.613070089309564636e-01 3.180749603252363000e-01 6.141010127652497541e-01 +8.694116302737093793e-01 3.558810711006659688e-01 6.350145273064313756e-01 +8.757161388545896541e-01 3.932313368152108302e-01 6.546177707919846878e-01 +8.809154887212219398e-01 4.296236382495501882e-01 6.735307717661165317e-01 +8.853268404597925967e-01 4.649163816409356831e-01 6.927624045682388987e-01 +8.884310704284409388e-01 4.994546810769878165e-01 7.137490323869131181e-01 +8.887111971501618912e-01 5.339646188625030154e-01 7.383284867848654009e-01 +8.846323716875585941e-01 5.689236616662907142e-01 7.682007948833130540e-01 +8.767267275991816877e-01 6.037553329925489098e-01 8.037105842040241921e-01 +8.463768910989423189e-01 6.154197987084349952e-01 8.207155904920702127e-01 +7.884451339599858333e-01 5.910998057946171835e-01 8.040760682356380418e-01 +7.414676382011815559e-01 5.625639310187692255e-01 7.851649477259431409e-01 +7.050881789462218885e-01 5.302805297690829089e-01 7.636124721626524892e-01 +6.762693114550958340e-01 4.953415569730459933e-01 7.404207375243810896e-01 +6.517912360501287861e-01 4.587593976723408074e-01 7.166589548313024860e-01 +6.294171674813368034e-01 4.212253612177472295e-01 6.928095728598714365e-01 +6.077882060069819126e-01 3.831868627309770736e-01 6.688349720194523007e-01 +5.860059395082031219e-01 3.449961231831933373e-01 6.444254002678728721e-01 +5.633019127215219690e-01 3.070716971501701309e-01 6.191087573569722391e-01 +5.388922630410429848e-01 2.700276638574735100e-01 5.923009006765995732e-01 +5.121182005529967274e-01 2.346165576727894941e-01 5.634752525056647698e-01 +4.827461836049378729e-01 2.014304616321936914e-01 5.324428187371255117e-01 +4.511233066836186079e-01 1.705617177957048647e-01 4.995004888153025679e-01 +4.180000933862609291e-01 1.415324018359887526e-01 4.652975085785351905e-01 +3.841911983452363510e-01 1.134918877382977420e-01 4.305617096124739196e-01 +3.503684772212236065e-01 8.531603060917344883e-02 3.959457343993016964e-01 +3.170584348590873569e-01 5.515718708797005126e-02 3.620573876341695585e-01 +2.846879783788356377e-01 2.120036336828947862e-02 3.295099346165862864e-01 +2.535503873992720481e-01 0.000000000000000000e+00 2.988424429514020542e-01 diff --git a/pyart/graph/cm_colorblind.py b/pyart/graph/cm_colorblind.py index 7f6e4405e3..4d7b06d5a2 100644 --- a/pyart/graph/cm_colorblind.py +++ b/pyart/graph/cm_colorblind.py @@ -5,6 +5,9 @@ colormaps are available within matplotlib with names pyart_COLORMAP': * HomeyerRainbow + * balance + * ChaseSpectral + * SpectralExtended """ import warnings diff --git a/pyart/graph/spectral-extended-rgb.txt b/pyart/graph/spectral-extended-rgb.txt new file mode 100644 index 0000000000..8e9f793f2c --- /dev/null +++ b/pyart/graph/spectral-extended-rgb.txt @@ -0,0 +1,180 @@ +7.959147299103611073e-02 6.647558492714741862e-02 1.045726997595241847e-01 +8.073045518328400560e-02 6.761264811292452825e-02 1.061401083833245218e-01 +8.290153602823913115e-02 6.982558504352573414e-02 1.092585259199206349e-01 +8.591114534445465356e-02 7.300325551098113541e-02 1.138945127963576776e-01 +8.951109590787198478e-02 7.700278999126289325e-02 1.199968319554120255e-01 +9.378566221102949130e-02 8.154973024079711919e-02 1.275008997508187691e-01 +9.918195340116894854e-02 8.626887416512279971e-02 1.363284500926722487e-01 +1.054046424076473809e-01 9.140087144498826310e-02 1.463492598123308508e-01 +1.122480103015721375e-01 9.705303188267169756e-02 1.574367559884072842e-01 +1.196319334713024651e-01 1.031606942150487261e-01 1.694743576934913953e-01 +1.274794935881096714e-01 1.096614567565062648e-01 1.823471029307589530e-01 +1.357191564823542473e-01 1.164970497527424986e-01 1.959452542869422609e-01 +1.442863135018101484e-01 1.236147178938120372e-01 2.101671779832966491e-01 +1.531241722718969522e-01 1.309680861535170160e-01 2.249213592106039661e-01 +1.621840345905675163e-01 1.385175389930088097e-01 2.401275190164792739e-01 +1.714250337652426792e-01 1.462301894927255930e-01 2.557168896874402186e-01 +1.808134276524254180e-01 1.540795432603876136e-01 2.716317740392488744e-01 +1.903215563900753082e-01 1.620449713778708278e-01 2.878245518696216920e-01 +1.999265692169769904e-01 1.701111025053571868e-01 3.042563038537445252e-01 +2.096090038709633174e-01 1.782672315790595485e-01 3.208952059329976403e-01 +2.193512752120891363e-01 1.865068234666351354e-01 3.377148164877421532e-01 +2.291361067810147034e-01 1.948271660167623098e-01 3.546923457468231788e-01 +2.389449237745931987e-01 2.032292011454129854e-01 3.718069680952632572e-01 +2.487562205743801269e-01 2.117175378455504187e-01 3.890382122373722829e-01 +2.585439236860112566e-01 2.203006278792830619e-01 4.063644406115695662e-01 +2.682757910793269196e-01 2.289910620705115085e-01 4.237614153907300341e-01 +2.779119160851196146e-01 2.378059218117546392e-01 4.412009514198724225e-01 +2.874034334097996801e-01 2.467670980319073837e-01 4.586496720060818100e-01 +2.966915532218268314e-01 2.559014715577878629e-01 4.760678999058476912e-01 +3.057069559673253889e-01 2.652407310214515146e-01 4.934086064040388853e-01 +3.143701079595965231e-01 2.748210817229806424e-01 5.106168756618215676e-01 +3.225922990147400138e-01 2.846824240393669991e-01 5.276295620665821806e-01 +3.302773199372101010e-01 2.948667554781008171e-01 5.443749615770362427e-01 +3.373243304154094901e-01 3.054162357047723875e-01 5.607730153070219492e-01 +3.436317255552699401e-01 3.163708054329131825e-01 5.767358618750311194e-01 +3.491019355229523224e-01 3.277655200726502516e-01 5.921687521943315158e-01 +3.536470082360088640e-01 3.396278325383250696e-01 6.069713190128596114e-01 +3.571947424927285897e-01 3.519751072172809248e-01 6.210391759542966961e-01 +3.596950660241797215e-01 3.648126525112107554e-01 6.342658151091270513e-01 +3.611262963997214359e-01 3.781325157019488348e-01 6.465447765229366262e-01 +3.615008856831722905e-01 3.919131963358077897e-01 6.577720704431756493e-01 +3.608702306473749455e-01 4.061203186676177190e-01 6.678488387647185665e-01 +3.593281252886444399e-01 4.207081823295961143e-01 6.766842409225740651e-01 +3.570124380320331414e-01 4.356220062817706129e-01 6.841985361554031586e-01 +3.541046111266861196e-01 4.508006120806057893e-01 6.903263059852636774e-01 +3.508266107475581097e-01 4.661792670178171449e-01 6.950197200028594979e-01 +3.474350263658521620e-01 4.816924239451370604e-01 6.982516987260910524e-01 +3.442121668904340459e-01 4.972761433015626120e-01 7.000187754809288343e-01 +3.414542720095634643e-01 5.128700512144641621e-01 7.003434153093187620e-01 +3.394573719786597721e-01 5.284187624634965053e-01 6.992755265545987919e-01 +3.385018569612127104e-01 5.438727671213804404e-01 6.968929104529584251e-01 +3.388373422416445235e-01 5.591888362913115529e-01 6.933004396771994537e-01 +3.406697342328875999e-01 5.743300408442411076e-01 6.886278386229178761e-01 +3.441522909789181406e-01 5.892654964991628219e-01 6.830260541889426884e-01 +3.493818305376555911e-01 6.039699505601199281e-01 6.766623437460339563e-01 +3.564002119084053177e-01 6.184233130354810370e-01 6.697143435340348061e-01 +3.652001467909685162e-01 6.326102116523214525e-01 6.623634936868909584e-01 +3.757336785303606042e-01 6.465196213007566861e-01 6.547882738875248076e-01 +3.879214996228287915e-01 6.601445886654497830e-01 6.471577413189065764e-01 +4.016616269753213175e-01 6.734820462538469998e-01 6.396258561954487609e-01 +4.168365794034923910e-01 6.865326895196159906e-01 6.323270290561490148e-01 +4.333186877517255509e-01 6.993007316473748292e-01 6.253730893350112341e-01 +4.509741415771013062e-01 7.117938845249605073e-01 6.188522736290673620e-01 +4.696657719865688363e-01 7.240230905140672135e-01 6.128298648776979718e-01 +4.892551442843893761e-01 7.360021034890209535e-01 6.073505052598986431e-01 +5.096045354047374909e-01 7.477471465750414881e-01 6.024421494481483341e-01 +5.305785298566415564e-01 7.592761648212922321e-01 5.981207892863068531e-01 +5.520455903628074257e-01 7.706079863889458981e-01 5.943957303092465283e-01 +5.738794746959497983e-01 7.817613144372587142e-01 5.912747459709642994e-01 +5.959604017987559788e-01 7.927535606745834684e-01 5.887685018191998187e-01 +6.181758652319407910e-01 8.035995345769391118e-01 5.868936864512387386e-01 +6.404210159903399591e-01 8.143100032786239062e-01 5.856743863591433730e-01 +6.625985709976299765e-01 8.248901403766597529e-01 5.851413914346840217e-01 +6.846182390146854368e-01 8.353378907668309594e-01 5.853293112517259367e-01 +7.063956983863167727e-01 8.456422933647234075e-01 5.862716095245250614e-01 +7.278512162360851745e-01 8.557818233392611162e-01 5.879939056781191553e-01 +7.489080575265074646e-01 8.657228405048492670e-01 5.905061228064122369e-01 +7.694908790172138024e-01 8.754182602887310427e-01 5.937942541568311805e-01 +7.895243271175770294e-01 8.848065942725550359e-01 5.978126495629132453e-01 +8.089320573022135141e-01 8.938115309300815881e-01 6.024777666068298343e-01 +8.276363665352869381e-01 9.023422345683445034e-01 6.076642735523902772e-01 +8.455585790940522983e-01 9.102945239387606469e-01 6.132042245965863003e-01 +8.626202519954684345e-01 9.175530471309770730e-01 6.188897568595336240e-01 +8.787451752576680430e-01 9.239944954757592921e-01 6.244794104536306456e-01 +8.938620462140344225e-01 9.294917998564128370e-01 6.297077969255604479e-01 +9.079076110322242821e-01 9.339191372321701268e-01 6.342979857045154546e-01 +9.208300026548933426e-01 9.371574585675285229e-01 6.379756794656018526e-01 +9.325919702386654686e-01 9.391001502953207902e-01 6.404840395645747808e-01 +9.431736940785498957e-01 9.396583781220109177e-01 6.415979290063021923e-01 +9.525749099295707234e-01 9.387656493352846132e-01 6.411363736969654115e-01 +9.608161205997257648e-01 9.363811760961288089e-01 6.389721981998278677e-01 +9.679387436779899323e-01 9.324917252081926788e-01 6.350380597468359145e-01 +9.740041273289689050e-01 9.271117862070459292e-01 6.293284656422339918e-01 +9.790914543013290450e-01 9.202820593123550719e-01 6.218977715017525165e-01 +9.832946405451113980e-01 9.120664346105038511e-01 6.128545552233133353e-01 +9.867184145164032971e-01 9.025477796596380609e-01 6.023530831310218714e-01 +9.894738297196780108e-01 8.918229543614475396e-01 5.905827974161248495e-01 +9.916735069416652282e-01 8.799975177703909246e-01 5.777568489248827710e-01 +9.934269178744022932e-01 8.671805795866250888e-01 5.641006773269551244e-01 +9.948360070645206887e-01 8.534801864790825254e-01 5.498415134338413557e-01 +9.959914064062390660e-01 8.389995341583059707e-01 5.351994731424959406e-01 +9.969694311920690444e-01 8.238341781243665451e-01 5.203806652657535503e-01 +9.978299672741043347e-01 8.080702976588781672e-01 5.055724805955424950e-01 +9.986152755200011777e-01 7.917839643213361311e-01 4.909409971699357222e-01 +9.993496644342189095e-01 7.750412875856198536e-01 4.766302525630438658e-01 +1.000000000000000000e+00 7.578992596689748673e-01 4.627630115977645064e-01 +1.000000000000000000e+00 7.404070982128728717e-01 4.494425965876829854e-01 +1.000000000000000000e+00 7.226078853558431936e-01 4.367553372312334981e-01 +1.000000000000000000e+00 7.045403189475895056e-01 4.247732275957959436e-01 +1.000000000000000000e+00 6.862404190815422078e-01 4.135564310273877608e-01 +1.000000000000000000e+00 6.677430645795988662e-01 4.031553357596466269e-01 +1.000000000000000000e+00 6.490832665343708729e-01 3.936119444620202468e-01 +1.000000000000000000e+00 6.302971189242915218e-01 3.849605032325212894e-01 +1.000000000000000000e+00 6.114223973011004842e-01 3.772274190273837702e-01 +9.987143223576534501e-01 5.924988011064784565e-01 3.704306154646974103e-01 +9.966750572458377144e-01 5.735678535899910724e-01 3.645785180317929197e-01 +9.940253003746631899e-01 5.546724916184571086e-01 3.596688894704767048e-01 +9.907131801447089936e-01 5.358563980565791418e-01 3.556877751435070234e-01 +9.866953852620946597e-01 5.171632258732753451e-01 3.526089033257215899e-01 +9.819380407907557506e-01 4.986354759502349965e-01 3.503934769142552641e-01 +9.764174278578449107e-01 4.803135498542445148e-01 3.489909168254815564e-01 +9.701202614286646986e-01 4.622347865047098936e-01 3.483403550970441964e-01 +9.630433962778782719e-01 4.444323881066749027e-01 3.483726724103061723e-01 +9.551935181791487706e-01 4.269346871356953232e-01 3.490132856080493395e-01 +9.465864403814977512e-01 4.097643694148530025e-01 3.501850668480632756e-01 +9.372462608518417060e-01 3.929377811936853315e-01 3.518112247408826110e-01 +9.272044599697516487e-01 3.764642997966962112e-01 3.538178448973089973e-01 +9.164989919920020212e-01 3.603457603821017541e-01 3.561358208613781828e-01 +9.051733868469687971e-01 3.445759591910168562e-01 3.587019702490814033e-01 +8.932758437887721170e-01 3.291402869594022285e-01 3.614592179451823761e-01 +8.808582715141434205e-01 3.140155774084079643e-01 3.643558278922833238e-01 +8.679752061674695929e-01 2.991702864618860924e-01 3.673437753322991162e-01 +8.546825133079478665e-01 2.845651533881089490e-01 3.703764763574156627e-01 +8.410357700696978744e-01 2.701545198544624826e-01 3.734062105644784246e-01 +8.270882633981374576e-01 2.558884609359898255e-01 3.763816390592134575e-01 +8.128886267625741180e-01 2.417158101372383627e-01 3.792458146365308980e-01 +7.984782267327027450e-01 2.275880853576436880e-01 3.819350292013608539e-01 +7.838884773993184396e-01 2.134642810224467446e-01 3.843787657047838535e-01 +7.691383169451568858e-01 1.993164770947806752e-01 3.865009103136440860e-01 +7.542321316504898565e-01 1.851362175274934296e-01 3.882222324229723798e-01 +7.391584402435399381e-01 1.709416324041624358e-01 3.894639769776152560e-01 +7.238896390542415293e-01 1.567853063429178739e-01 3.901522664992533862e-01 +7.083830515063570532e-01 1.427628704751509325e-01 3.902229027986255372e-01 +6.925834256463139216e-01 1.290220834532910532e-01 3.896261003276241253e-01 +6.764268848807574175e-01 1.157715098880473525e-01 3.883306754130895211e-01 +6.598461728871937160e-01 1.032863505908989121e-01 3.863272557251372641e-01 +6.427768662935301469e-01 9.190598531768404134e-02 3.836301597552764231e-01 +6.251640863478575838e-01 8.201350077216837398e-02 3.802777185370084800e-01 +6.069691458647389348e-01 7.398490337887758672e-02 3.763309541013383219e-01 +5.881755328416535811e-01 6.810303053659069739e-02 3.718706692572659178e-01 +5.687936622291205335e-01 6.445638017581523105e-02 3.669931268191238827e-01 +5.488639201777438803e-01 6.287386254161608790e-02 3.618046012852911275e-01 +5.284579031598465315e-01 6.294342685412240845e-02 3.564153740473430809e-01 +5.076771686626675439e-01 6.410787037625603757e-02 3.509331506348410401e-01 +4.866497878088127949e-01 6.578196090071078417e-02 3.454565641706477952e-01 +4.655253382608708912e-01 6.743874407703651097e-02 3.400695762692915181e-01 +4.444682766600520640e-01 6.864897758214305590e-02 3.348368121305085321e-01 +4.236503229070958110e-01 6.908577446983940606e-02 3.298002998507838512e-01 +4.032424129931614920e-01 6.851147219478972983e-02 3.249778750895409574e-01 +3.834067874107578433e-01 6.675819938627222672e-02 3.203633956830531093e-01 +3.642897534880149557e-01 6.370724252061271686e-02 3.159287815286221934e-01 +3.460156019524993631e-01 5.926800252917770878e-02 3.116277591999295771e-01 +3.286820827717469307e-01 5.335431378279093667e-02 3.074010590632726414e-01 +3.123577637098835513e-01 4.585205692616727696e-02 3.031827008661945877e-01 +2.970815051726980460e-01 3.660852180738822376e-02 2.989069247664139506e-01 +2.828641688706141633e-01 2.653877237753106758e-02 2.945152797935748912e-01 +2.696925137296155017e-01 1.632180081618199094e-02 2.899633666616674432e-01 +2.575350150609929667e-01 6.302384894788494452e-03 2.852267426395614369e-01 +2.463490990355240440e-01 0.000000000000000000e+00 2.803055275650705447e-01 +2.360890586945984526e-01 0.000000000000000000e+00 2.752273049381980252e-01 +2.267137515836473161e-01 0.000000000000000000e+00 2.700480118231524118e-01 +2.181931228923175148e-01 0.000000000000000000e+00 2.648506664183972736e-01 +2.105127189048587866e-01 0.000000000000000000e+00 2.597419550297703217e-01 +2.036756624999893628e-01 0.000000000000000000e+00 2.548468520964998763e-01 +1.977615140884450007e-01 0.000000000000000000e+00 2.503076628606556997e-01 +1.929046655677319477e-01 0.000000000000000000e+00 2.462736956007085531e-01 +1.890760172775479975e-01 0.000000000000000000e+00 2.428711469817661506e-01 +1.862414647995699057e-01 0.000000000000000000e+00 2.402115163945445220e-01 +1.843709148334545522e-01 0.000000000000000000e+00 2.383851520678009206e-01 +1.834417329885095482e-01 0.000000000000000000e+00 2.374555838818699360e-01 diff --git a/tests/graph/test_cm_colorblind.py b/tests/graph/test_cm_colorblind.py index 00dcebd6f7..129ac832bd 100644 --- a/tests/graph/test_cm_colorblind.py +++ b/tests/graph/test_cm_colorblind.py @@ -1,4 +1,4 @@ -""" Unit Tests for Py-ART's graph/cm.py module. """ +""" Unit Tests for Py-ART's graph/cm_colorblind.py module. """ import matplotlib @@ -8,7 +8,13 @@ def test_colormaps_exist(): assert isinstance(cm_colorblind.HomeyerRainbow, matplotlib.colors.Colormap) - assert isinstance(cm_colorblind.HomeyerRainbow, matplotlib.colors.Colormap) + assert isinstance(cm_colorblind.HomeyerRainbow_r, matplotlib.colors.Colormap) + assert isinstance(cm_colorblind.balance, matplotlib.colors.Colormap) + assert isinstance(cm_colorblind.balance_r, matplotlib.colors.Colormap) + assert isinstance(cm_colorblind.ChaseSpectral, matplotlib.colors.Colormap) + 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) def test_colormaps_registered(): @@ -17,3 +23,21 @@ def test_colormaps_registered(): cmap = matplotlib.cm.get_cmap('pyart_HomeyerRainbow_r') assert isinstance(cmap, matplotlib.colors.Colormap) + + cmap = matplotlib.cm.get_cmap('pyart_balance') + assert isinstance(cmap, matplotlib.colors.Colormap) + + cmap = matplotlib.cm.get_cmap('pyart_balance_r') + assert isinstance(cmap, matplotlib.colors.Colormap) + + cmap = matplotlib.cm.get_cmap('pyart_ChaseSpectral') + assert isinstance(cmap, matplotlib.colors.Colormap) + + cmap = matplotlib.cm.get_cmap('pyart_ChaseSpectral_r') + assert isinstance(cmap, matplotlib.colors.Colormap) + + cmap = matplotlib.cm.get_cmap('pyart_SpectralExtended') + assert isinstance(cmap, matplotlib.colors.Colormap) + + cmap = matplotlib.cm.get_cmap('pyart_SpectralExtended_r') + assert isinstance(cmap, matplotlib.colors.Colormap)