In [1]:
import numpy as np

To get the new matplotlib colorbars into IDL, we need to write each out as a text file. Because they are few, we can do this by hand, pasting the RGB colormap data into this notebook and using numpy to write a CSV.


In [2]:
cm_data = [[  0.0,                     0.0,              0.0],
       [  1.23208396e-03,   9.55473090e-04,   1.39798823e-03],
       [  2.29615544e-03,   1.78942817e-03,   2.87482272e-03],
       [  3.65605723e-03,   2.83344018e-03,   4.92480921e-03],
       [  5.30551794e-03,   4.06778716e-03,   7.60691909e-03],
       [  7.23736344e-03,   5.48161371e-03,   1.09431791e-02],
       [  9.45254296e-03,   7.05778542e-03,   1.50171636e-02],
       [  1.19482347e-02,   8.78720053e-03,   1.98667312e-02],
       [  1.47228881e-02,   1.06611909e-02,   2.55349090e-02],
       [  1.77835018e-02,   1.26603657e-02,   3.21519132e-02],
       [  2.11220928e-02,   1.47877065e-02,   3.96871750e-02],
       [  2.47515394e-02,   1.70167645e-02,   4.78036366e-02],
       [  2.86638456e-02,   1.93519218e-02,   5.59687827e-02],
       [  3.28682397e-02,   2.17723779e-02,   6.42706842e-02],
       [  3.73641166e-02,   2.42719221e-02,   7.26898674e-02],
       [  4.21050647e-02,   2.68397654e-02,   8.12355395e-02],
       [  4.68284728e-02,   2.94586559e-02,   8.99433646e-02],
       [  5.15141518e-02,   3.21256410e-02,   9.87816900e-02],
       [  5.61710528e-02,   3.48169996e-02,   1.07806321e-01],
       [  6.07964611e-02,   3.75295002e-02,   1.16986953e-01],
       [  6.53942936e-02,   4.02451065e-02,   1.26350147e-01],
       [  6.99678963e-02,   4.28589320e-02,   1.35923729e-01],
       [  7.45082197e-02,   4.53694998e-02,   1.45639655e-01],
       [  7.90330506e-02,   4.77307435e-02,   1.55656679e-01],
       [  8.35202958e-02,   4.99952955e-02,   1.65809116e-01],
       [  8.79834474e-02,   5.21177479e-02,   1.76237541e-01],
       [  9.24150207e-02,   5.41059968e-02,   1.86915608e-01],
       [  9.68029626e-02,   5.59815865e-02,   1.97781923e-01],
       [  1.01151155e-01,   5.77100082e-02,   2.08936447e-01],
       [  1.05451837e-01,   5.92849001e-02,   2.20396438e-01],
       [  1.09686880e-01,   6.07326502e-02,   2.32095082e-01],
       [  1.13843713e-01,   6.20506875e-02,   2.44050536e-01],
       [  1.17904959e-01,   6.32397421e-02,   2.56278000e-01],
       [  1.21846598e-01,   6.43068710e-02,   2.68785988e-01],
       [  1.25635500e-01,   6.52701612e-02,   2.81570678e-01],
       [  1.29226271e-01,   6.61657005e-02,   2.94607743e-01],
       [  1.32557443e-01,   6.70572149e-02,   3.07841226e-01],
       [  1.35547409e-01,   6.80479794e-02,   3.21169632e-01],
       [  1.38091076e-01,   6.92926359e-02,   3.34430764e-01],
       [  1.40040521e-01,   7.09626931e-02,   3.47508660e-01],
       [  1.41240948e-01,   7.33731827e-02,   3.59972935e-01],
       [  1.41507741e-01,   7.68055544e-02,   3.71470975e-01],
       [  1.40750085e-01,   8.15085404e-02,   3.81459968e-01],
       [  1.38978078e-01,   8.75006802e-02,   3.89596616e-01],
       [  1.36328543e-01,   9.45637193e-02,   3.95783386e-01],
       [  1.33020255e-01,   1.02337765e-01,   4.00175258e-01],
       [  1.29250417e-01,   1.10478799e-01,   4.03074022e-01],
       [  1.25151398e-01,   1.18742158e-01,   4.04788627e-01],
       [  1.20897791e-01,   1.26928615e-01,   4.05612684e-01],
       [  1.16503773e-01,   1.34976096e-01,   4.05743218e-01],
       [  1.12091791e-01,   1.42800379e-01,   4.05380296e-01],
       [  1.07667720e-01,   1.50397779e-01,   4.04637066e-01],
       [  1.03261075e-01,   1.57763499e-01,   4.03610287e-01],
       [  9.89139075e-02,   1.64894349e-01,   4.02386180e-01],
       [  9.46605957e-02,   1.71795271e-01,   4.01032857e-01],
       [  9.04966075e-02,   1.78488051e-01,   3.99581412e-01],
       [  8.64400964e-02,   1.84985184e-01,   3.98068674e-01],
       [  8.25068783e-02,   1.91299899e-01,   3.96523264e-01],
       [  7.87110863e-02,   1.97445454e-01,   3.94967383e-01],
       [  7.50656260e-02,   2.03434722e-01,   3.93418199e-01],
       [  7.15824638e-02,   2.09279955e-01,   3.91888928e-01],
       [  6.82727786e-02,   2.14992675e-01,   3.90389666e-01],
       [  6.51469969e-02,   2.20583627e-01,   3.88928035e-01],
       [  6.22147318e-02,   2.26062789e-01,   3.87509681e-01],
       [  5.94846413e-02,   2.31439400e-01,   3.86138652e-01],
       [  5.69642263e-02,   2.36722005e-01,   3.84817703e-01],
       [  5.46595872e-02,   2.41918503e-01,   3.83548521e-01],
       [  5.25751624e-02,   2.47036203e-01,   3.82331902e-01],
       [  5.07134751e-02,   2.52081870e-01,   3.81167890e-01],
       [  4.90749156e-02,   2.57061774e-01,   3.80055881e-01],
       [  4.76575847e-02,   2.61981734e-01,   3.78994708e-01],
       [  4.64572218e-02,   2.66847155e-01,   3.77982702e-01],
       [  4.54672343e-02,   2.71663063e-01,   3.77017741e-01],
       [  4.46840991e-02,   2.76433278e-01,   3.76100669e-01],
       [  4.40912972e-02,   2.81163132e-01,   3.75224852e-01],
       [  4.36760356e-02,   2.85856732e-01,   3.74386744e-01],
       [  4.34247319e-02,   2.90517832e-01,   3.73582732e-01],
       [  4.33230538e-02,   2.95149919e-01,   3.72808888e-01],
       [  4.33563883e-02,   2.99756226e-01,   3.72060986e-01],
       [  4.35103092e-02,   3.04339740e-01,   3.71334509e-01],
       [  4.37710212e-02,   3.08903211e-01,   3.70624672e-01],
       [  4.41282904e-02,   3.13448805e-01,   3.69928058e-01],
       [  4.45674054e-02,   3.17979294e-01,   3.69237225e-01],
       [  4.50786065e-02,   3.22496756e-01,   3.68546588e-01],
       [  4.56542782e-02,   3.27003032e-01,   3.67850463e-01],
       [  4.62889953e-02,   3.31499739e-01,   3.67142985e-01],
       [  4.69796908e-02,   3.35988283e-01,   3.66418129e-01],
       [  4.77257788e-02,   3.40469852e-01,   3.65669737e-01],
       [  4.85291489e-02,   3.44945431e-01,   3.64891487e-01],
       [  4.93936792e-02,   3.49415875e-01,   3.64076553e-01],
       [  5.03265816e-02,   3.53881729e-01,   3.63218552e-01],
       [  5.13376114e-02,   3.58343330e-01,   3.62311095e-01],
       [  5.24389267e-02,   3.62800809e-01,   3.61347801e-01],
       [  5.36449018e-02,   3.67254102e-01,   3.60322329e-01],
       [  5.49718276e-02,   3.71702955e-01,   3.59228375e-01],
       [  5.64358645e-02,   3.76147176e-01,   3.58058223e-01],
       [  5.80577474e-02,   3.80585934e-01,   3.56806935e-01],
       [  5.98575991e-02,   3.85018417e-01,   3.55468636e-01],
       [  6.18558200e-02,   3.89443647e-01,   3.54037625e-01],
       [  6.40725510e-02,   3.93860487e-01,   3.52508403e-01],
       [  6.65271332e-02,   3.98267655e-01,   3.50875686e-01],
       [  6.92375954e-02,   4.02663728e-01,   3.49134426e-01],
       [  7.22190954e-02,   4.07047379e-01,   3.47278053e-01],
       [  7.54864540e-02,   4.11416856e-01,   3.45302457e-01],
       [  7.90521742e-02,   4.15770242e-01,   3.43204352e-01],
       [  8.29254846e-02,   4.20105651e-01,   3.40979770e-01],
       [  8.71129773e-02,   4.24421110e-01,   3.38625025e-01],
       [  9.16186670e-02,   4.28714566e-01,   3.36136719e-01],
       [  9.64441393e-02,   4.32983895e-01,   3.33511739e-01],
       [  1.01588767e-01,   4.37226916e-01,   3.30747257e-01],
       [  1.07049974e-01,   4.41441396e-01,   3.27840728e-01],
       [  1.12823855e-01,   4.45625238e-01,   3.24786969e-01],
       [  1.18904971e-01,   4.49775948e-01,   3.21586143e-01],
       [  1.25286565e-01,   4.53891139e-01,   3.18237146e-01],
       [  1.31961058e-01,   4.57968449e-01,   3.14738541e-01],
       [  1.38920254e-01,   4.62005502e-01,   3.11089142e-01],
       [  1.46155540e-01,   4.65999917e-01,   3.07288006e-01],
       [  1.53658052e-01,   4.69949317e-01,   3.03334418e-01],
       [  1.61418810e-01,   4.73851329e-01,   2.99227888e-01],
       [  1.69428819e-01,   4.77703598e-01,   2.94968134e-01],
       [  1.77679155e-01,   4.81503786e-01,   2.90555072e-01],
       [  1.86161019e-01,   4.85249581e-01,   2.85988805e-01],
       [  1.94865778e-01,   4.88938703e-01,   2.81269612e-01],
       [  2.03784988e-01,   4.92568909e-01,   2.76397933e-01],
       [  2.12910409e-01,   4.96137998e-01,   2.71374357e-01],
       [  2.22234002e-01,   4.99643819e-01,   2.66199611e-01],
       [  2.31747934e-01,   5.03084276e-01,   2.60874541e-01],
       [  2.41444557e-01,   5.06457333e-01,   2.55400105e-01],
       [  2.51316401e-01,   5.09761021e-01,   2.49777354e-01],
       [  2.61356155e-01,   5.12993445e-01,   2.44007420e-01],
       [  2.71556645e-01,   5.16152793e-01,   2.38091502e-01],
       [  2.81910816e-01,   5.19237338e-01,   2.32030849e-01],
       [  2.92411709e-01,   5.22245452e-01,   2.25826750e-01],
       [  3.03052439e-01,   5.25175609e-01,   2.19480519e-01],
       [  3.13826172e-01,   5.28026396e-01,   2.12993484e-01],
       [  3.24726102e-01,   5.30796524e-01,   2.06366974e-01],
       [  3.35745430e-01,   5.33484834e-01,   1.99602318e-01],
       [  3.46877341e-01,   5.36090309e-01,   1.92700836e-01],
       [  3.58114982e-01,   5.38612089e-01,   1.85663845e-01],
       [  3.69451439e-01,   5.41049476e-01,   1.78492672e-01],
       [  3.80879719e-01,   5.43401953e-01,   1.71188671e-01],
       [  3.92392725e-01,   5.45669194e-01,   1.63753271e-01],
       [  4.03983240e-01,   5.47851079e-01,   1.56188035e-01],
       [  4.15643905e-01,   5.49947710e-01,   1.48494759e-01],
       [  4.27367201e-01,   5.51959427e-01,   1.40675619e-01],
       [  4.39145431e-01,   5.53886824e-01,   1.32733383e-01],
       [  4.50975035e-01,   5.55729609e-01,   1.24665418e-01],
       [  4.62844980e-01,   5.57489617e-01,   1.16480779e-01],
       [  4.74745559e-01,   5.59168661e-01,   1.08188475e-01],
       [  4.86668130e-01,   5.60768549e-01,   9.97986900e-02],
       [  4.98603802e-01,   5.62291436e-01,   9.13261437e-02],
       [  5.10543429e-01,   5.63739843e-01,   8.27923167e-02],
       [  5.22477839e-01,   5.65116597e-01,   7.42284389e-02],
       [  5.34402935e-01,   5.66423108e-01,   6.56717853e-02],
       [  5.46302550e-01,   5.67665088e-01,   5.72025049e-02],
       [  5.58166439e-01,   5.68846718e-01,   4.89257073e-02],
       [  5.69984146e-01,   5.69972607e-01,   4.09987564e-02],
       [  5.81745024e-01,   5.71047800e-01,   3.38796140e-02],
       [  5.93441855e-01,   5.72076359e-01,   2.82747543e-02],
       [  6.05060162e-01,   5.73065496e-01,   2.42670210e-02],
       [  6.16587919e-01,   5.74021935e-01,   2.19268218e-02],
       [  6.28014050e-01,   5.74952422e-01,   2.13281856e-02],
       [  6.39327939e-01,   5.75863873e-01,   2.25506518e-02],
       [  6.50519264e-01,   5.76763426e-01,   2.56803655e-02],
       [  6.61575187e-01,   5.77659706e-01,   3.08113161e-02],
       [  6.72485257e-01,   5.78560654e-01,   3.80424961e-02],
       [  6.83239371e-01,   5.79474363e-01,   4.70405860e-02],
       [  6.93826945e-01,   5.80409470e-01,   5.68940115e-02],
       [  7.04238654e-01,   5.81374288e-01,   6.73716976e-02],
       [  7.14466086e-01,   5.82376907e-01,   7.83172031e-02],
       [  7.24501348e-01,   5.83425344e-01,   8.96249873e-02],
       [  7.34336170e-01,   5.84528004e-01,   1.01222566e-01],
       [  7.43962862e-01,   5.85693159e-01,   1.13059557e-01],
       [  7.53377595e-01,   5.86927042e-01,   1.25105089e-01],
       [  7.62575552e-01,   5.88236442e-01,   1.37336358e-01],
       [  7.71552684e-01,   5.89627716e-01,   1.49737263e-01],
       [  7.80304203e-01,   5.91107689e-01,   1.62292912e-01],
       [  7.88827159e-01,   5.92682093e-01,   1.74992652e-01],
       [  7.97121904e-01,   5.94354494e-01,   1.87833650e-01],
       [  8.05187420e-01,   5.96129166e-01,   2.00810256e-01],
       [  8.13023314e-01,   5.98009857e-01,   2.13917489e-01],
       [  8.20629771e-01,   5.99999799e-01,   2.27150700e-01],
       [  8.28007021e-01,   6.02102078e-01,   2.40503564e-01],
       [  8.35155259e-01,   6.04319751e-01,   2.53966787e-01],
       [  8.42077988e-01,   6.06653209e-01,   2.67542263e-01],
       [  8.48777144e-01,   6.09103800e-01,   2.81225295e-01],
       [  8.55254945e-01,   6.11672485e-01,   2.95010966e-01],
       [  8.61513837e-01,   6.14359877e-01,   3.08894128e-01],
       [  8.67556445e-01,   6.17166278e-01,   3.22869395e-01],
       [  8.73385523e-01,   6.20091710e-01,   3.36931148e-01],
       [  8.79003914e-01,   6.23135957e-01,   3.51073543e-01],
       [  8.84414511e-01,   6.26298593e-01,   3.65290519e-01],
       [  8.89620221e-01,   6.29579022e-01,   3.79575807e-01],
       [  8.94623936e-01,   6.32976504e-01,   3.93922939e-01],
       [  8.99428507e-01,   6.36490186e-01,   4.08325253e-01],
       [  9.04036723e-01,   6.40119127e-01,   4.22775895e-01],
       [  9.08451317e-01,   6.43862346e-01,   4.37267309e-01],
       [  9.12674913e-01,   6.47718773e-01,   4.51792549e-01],
       [  9.16709977e-01,   6.51687316e-01,   4.66344842e-01],
       [  9.20558895e-01,   6.55766912e-01,   4.80916487e-01],
       [  9.24223945e-01,   6.59956497e-01,   4.95499568e-01],
       [  9.27707304e-01,   6.64255023e-01,   5.10085944e-01],
       [  9.31011045e-01,   6.68661459e-01,   5.24667240e-01],
       [  9.34137216e-01,   6.73174796e-01,   5.39234468e-01],
       [  9.37087683e-01,   6.77794059e-01,   5.53778998e-01],
       [  9.39864212e-01,   6.82518315e-01,   5.68291979e-01],
       [  9.42468542e-01,   6.87346665e-01,   5.82764066e-01],
       [  9.44902364e-01,   6.92278238e-01,   5.97185613e-01],
       [  9.47167346e-01,   6.97312194e-01,   6.11546658e-01],
       [  9.49265154e-01,   7.02447712e-01,   6.25836915e-01],
       [  9.51197479e-01,   7.07683987e-01,   6.40045758e-01],
       [  9.52966062e-01,   7.13020218e-01,   6.54162211e-01],
       [  9.54572726e-01,   7.18455599e-01,   6.68174947e-01],
       [  9.56019406e-01,   7.23989311e-01,   6.82072273e-01],
       [  9.57308180e-01,   7.29620507e-01,   6.95842134e-01],
       [  9.58441302e-01,   7.35348303e-01,   7.09472110e-01],
       [  9.59421236e-01,   7.41171767e-01,   7.22949416e-01],
       [  9.60250683e-01,   7.47089909e-01,   7.36260905e-01],
       [  9.60932615e-01,   7.53101675e-01,   7.49393068e-01],
       [  9.61470299e-01,   7.59205936e-01,   7.62332032e-01],
       [  9.61867319e-01,   7.65401491e-01,   7.75063555e-01],
       [  9.62127596e-01,   7.71687064e-01,   7.87573001e-01],
       [  9.62255401e-01,   7.78061314e-01,   7.99845309e-01],
       [  9.62255368e-01,   7.84522837e-01,   8.11864934e-01],
       [  9.62132504e-01,   7.91070186e-01,   8.23615749e-01],
       [  9.61892203e-01,   7.97701884e-01,   8.35080911e-01],
       [  9.61535931e-01,   8.04418041e-01,   8.46247612e-01],
       [  9.61069177e-01,   8.11217509e-01,   8.57096621e-01],
       [  9.60501198e-01,   8.18097944e-01,   8.67603854e-01],
       [  9.59839454e-01,   8.25057914e-01,   8.77746324e-01],
       [  9.59092622e-01,   8.32095826e-01,   8.87498342e-01],
       [  9.58271129e-01,   8.39209776e-01,   8.96830951e-01],
       [  9.57379148e-01,   8.46400731e-01,   9.05716781e-01],
       [  9.56426557e-01,   8.53668016e-01,   9.14119954e-01],
       [  9.55450902e-01,   8.61000457e-01,   9.21988100e-01],
       [  9.54482975e-01,   8.68389760e-01,   9.29276063e-01],
       [  9.53544413e-01,   8.75831712e-01,   9.35942516e-01],
       [  9.52715057e-01,   8.83298026e-01,   9.41937385e-01],
       [  9.52060170e-01,   8.90765365e-01,   9.47234674e-01],
       [  9.51663891e-01,   8.98200733e-01,   9.51831906e-01],
       [  9.51600045e-01,   9.05573176e-01,   9.55758457e-01],
       [  9.51948354e-01,   9.12845998e-01,   9.59081968e-01],
       [  9.52754314e-01,   9.19994695e-01,   9.61896029e-01],
       [  9.54024962e-01,   9.27010498e-01,   9.64296862e-01],
       [  9.55761682e-01,   9.33885958e-01,   9.66387156e-01],
       [  9.57951675e-01,   9.40619651e-01,   9.68263946e-01],
       [  9.60573473e-01,   9.47214333e-01,   9.70013814e-01],
       [  9.63602865e-01,   9.53674551e-01,   9.71712469e-01],
       [  9.67018286e-01,   9.60004011e-01,   9.73429691e-01],
       [  9.70802859e-01,   9.66203343e-01,   9.75243531e-01],
       [  9.74923592e-01,   9.72274812e-01,   9.77275094e-01],
       [  9.79184400e-01,   9.78278064e-01,   9.79710814e-01],
       [  9.83037174e-01,   9.84450133e-01,   9.82356003e-01],
       [  9.86480330e-01,   9.90875647e-01,   9.84384974e-01],
       [  9.89906220e-01,   9.97424842e-01,   9.85544042e-01],
       [            1.0,              1.0,              1.0]]

In [4]:
np.savetxt("MPL_rainbow_BW.csv",cm_data,delimiter=",")