Skip to content

Commit

Permalink
ADD: correlation coefficient colormaps
Browse files Browse the repository at this point in the history
  • Loading branch information
wx4stg committed Nov 4, 2023
1 parent d58b687 commit 366c697
Show file tree
Hide file tree
Showing 6 changed files with 436 additions and 1 deletion.
2 changes: 2 additions & 0 deletions examples/plotting/plot_choose_a_colormap.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ def plot_color_gradients(cmap_category, cmap_list):
"NWSRef",
"NWSVel",
"NWS_SPW",
"NWS_CC"
"plasmidis"
"PD17",
"RRate11",
"RefDiff",
Expand Down
1 change: 1 addition & 0 deletions pyart/graph/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
* NWSRef
* NWSVel
* NWS_SPW
* NWS_CC
* PD17
* RRate11
* RdYlBu11b
Expand Down
328 changes: 328 additions & 0 deletions pyart/graph/_cm.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,333 @@
],
}

_NWS_CC_data = {
"blue": [
(0.00000000, 0.54901961, 0.54901961),
(0.00952381, 0.54901961, 0.54901961),
(0.01904762, 0.54901961, 0.54901961),
(0.02857143, 0.54901961, 0.54901961),
(0.03809524, 0.54901961, 0.54901961),
(0.04761905, 0.54901961, 0.54901961),
(0.05714286, 0.54901961, 0.54901961),
(0.06666667, 0.54901961, 0.54901961),
(0.07619048, 0.54901961, 0.54901961),
(0.08571429, 0.54901961, 0.54901961),
(0.09523810, 0.54901961, 0.54901961),
(0.10476190, 0.54901961, 0.54901961),
(0.11428571, 0.54901961, 0.54901961),
(0.12380952, 0.54901961, 0.54901961),
(0.13333333, 0.54901961, 0.54901961),
(0.14285714, 0.54901961, 0.54901961),
(0.15238095, 0.54901961, 0.54901961),
(0.16190476, 0.54901961, 0.54901961),
(0.17142857, 0.54901961, 0.54901961),
(0.18095238, 0.54901961, 0.54901961),
(0.19047619, 0.54901961, 0.54901961),
(0.20000000, 0.54901961, 0.54901961),
(0.20952381, 0.54901961, 0.54901961),
(0.21904762, 0.54901961, 0.54901961),
(0.22857143, 0.54901961, 0.54901961),
(0.23809524, 0.54901961, 0.54901961),
(0.24761905, 0.54901961, 0.54901961),
(0.25714286, 0.54901961, 0.54901961),
(0.26666667, 0.54901961, 0.54901961),
(0.27619048, 0.54901961, 0.54901961),
(0.28571429, 0.54901961, 0.54901961),
(0.29523810, 0.54901961, 0.54901961),
(0.30476190, 0.54901961, 0.54901961),
(0.31428571, 0.54901961, 0.54901961),
(0.32380952, 0.54901961, 0.54901961),
(0.33333333, 0.54901961, 0.54901961),
(0.34285714, 0.54901961, 0.54901961),
(0.35238095, 0.54901961, 0.54901961),
(0.36190476, 0.54901961, 0.54901961),
(0.37142857, 0.54901961, 0.54901961),
(0.38095238, 0.54901961, 0.54901961),
(0.39047619, 0.54901961, 0.54901961),
(0.40000000, 0.54901961, 0.54901961),
(0.40952381, 0.54901961, 0.54901961),
(0.41904762, 0.54901961, 0.54901961),
(0.42857143, 0.54901961, 0.54901961),
(0.43809524, 0.56209150, 0.56209150),
(0.44761905, 0.57516340, 0.57516340),
(0.45714286, 0.58823529, 0.58823529),
(0.46666667, 0.60130719, 0.60130719),
(0.47619048, 0.61437908, 0.61437908),
(0.48571429, 0.62745098, 0.62745098),
(0.49523810, 0.64052288, 0.64052288),
(0.50476190, 0.65359477, 0.65359477),
(0.51428571, 0.66666667, 0.66666667),
(0.52380952, 0.67973856, 0.67973856),
(0.53333333, 0.69281046, 0.69281046),
(0.54285714, 0.70588235, 0.70588235),
(0.55238095, 0.71895425, 0.71895425),
(0.56190476, 0.73202614, 0.73202614),
(0.57142857, 0.74509804, 0.74509804),
(0.58095238, 0.76209150, 0.76209150),
(0.59047619, 0.77908497, 0.77908497),
(0.60000000, 0.79607843, 0.79607843),
(0.60952381, 0.81307190, 0.81307190),
(0.61904762, 0.83006536, 0.83006536),
(0.62857143, 0.84705882, 0.84705882),
(0.63809524, 0.86405229, 0.86405229),
(0.64761905, 0.88104575, 0.88104575),
(0.65714286, 0.89803922, 0.89803922),
(0.66666667, 0.91503268, 0.91503268),
(0.67619048, 0.93202614, 0.93202614),
(0.68571429, 0.94901961, 0.94901961),
(0.69523810, 0.96601307, 0.96601307),
(0.70476190, 0.98300654, 0.98300654),
(0.71428571, 1.00000000, 1.00000000),
(0.72380952, 0.87843137, 0.87843137),
(0.73333333, 0.75686275, 0.75686275),
(0.74285714, 0.63529412, 0.63529412),
(0.75238095, 0.51372549, 0.51372549),
(0.76190476, 0.39215686, 0.39215686),
(0.77142857, 0.32156863, 0.32156863),
(0.78095238, 0.25098039, 0.25098039),
(0.79047619, 0.18039216, 0.18039216),
(0.80000000, 0.10980392, 0.10980392),
(0.80952381, 0.03921569, 0.03921569),
(0.81904762, 0.03137255, 0.03137255),
(0.82857143, 0.02352941, 0.02352941),
(0.83809524, 0.01568627, 0.01568627),
(0.84761905, 0.00784314, 0.00784314),
(0.85714286, 0.00000000, 0.00000000),
(0.86666667, 0.00000000, 0.00000000),
(0.87619048, 0.00000000, 0.00000000),
(0.88571429, 0.00000000, 0.00000000),
(0.89523810, 0.00000000, 0.00000000),
(0.90476190, 0.00000000, 0.00000000),
(0.91428571, 0.00000000, 0.00000000),
(0.92380952, 0.00000000, 0.00000000),
(0.93333333, 0.15686275, 0.15686275),
(0.94285714, 0.31372549, 0.31372549),
(0.95238095, 0.84313725, 0.84313725),
(0.96190476, 0.79215686, 0.79215686),
(0.97142857, 0.74117647, 0.74117647),
(0.98095238, 0.69019608, 0.69019608),
(0.99047619, 0.63921569, 0.63921569),
(1.00000000, 0.58823529, 0.58823529)
],
"green": [
(0.00000000, 0.05882353, 0.05882353),
(0.00952381, 0.05882353, 0.05882353),
(0.01904762, 0.05882353, 0.05882353),
(0.02857143, 0.05882353, 0.05882353),
(0.03809524, 0.05882353, 0.05882353),
(0.04761905, 0.05882353, 0.05882353),
(0.05714286, 0.05882353, 0.05882353),
(0.06666667, 0.05882353, 0.05882353),
(0.07619048, 0.05882353, 0.05882353),
(0.08571429, 0.05882353, 0.05882353),
(0.09523810, 0.05882353, 0.05882353),
(0.10476190, 0.05882353, 0.05882353),
(0.11428571, 0.05882353, 0.05882353),
(0.12380952, 0.05882353, 0.05882353),
(0.13333333, 0.05882353, 0.05882353),
(0.14285714, 0.05882353, 0.05882353),
(0.15238095, 0.05882353, 0.05882353),
(0.16190476, 0.05882353, 0.05882353),
(0.17142857, 0.05882353, 0.05882353),
(0.18095238, 0.05882353, 0.05882353),
(0.19047619, 0.05882353, 0.05882353),
(0.20000000, 0.05882353, 0.05882353),
(0.20952381, 0.05882353, 0.05882353),
(0.21904762, 0.05882353, 0.05882353),
(0.22857143, 0.05882353, 0.05882353),
(0.23809524, 0.05882353, 0.05882353),
(0.24761905, 0.05882353, 0.05882353),
(0.25714286, 0.05882353, 0.05882353),
(0.26666667, 0.05882353, 0.05882353),
(0.27619048, 0.05882353, 0.05882353),
(0.28571429, 0.05882353, 0.05882353),
(0.29523810, 0.05882353, 0.05882353),
(0.30476190, 0.05882353, 0.05882353),
(0.31428571, 0.05882353, 0.05882353),
(0.32380952, 0.05882353, 0.05882353),
(0.33333333, 0.05882353, 0.05882353),
(0.34285714, 0.05882353, 0.05882353),
(0.35238095, 0.05882353, 0.05882353),
(0.36190476, 0.05882353, 0.05882353),
(0.37142857, 0.05882353, 0.05882353),
(0.38095238, 0.05882353, 0.05882353),
(0.39047619, 0.05882353, 0.05882353),
(0.40000000, 0.05882353, 0.05882353),
(0.40952381, 0.05882353, 0.05882353),
(0.41904762, 0.05882353, 0.05882353),
(0.42857143, 0.05882353, 0.05882353),
(0.43809524, 0.05751634, 0.05751634),
(0.44761905, 0.05620915, 0.05620915),
(0.45714286, 0.05490196, 0.05490196),
(0.46666667, 0.05359477, 0.05359477),
(0.47619048, 0.05228758, 0.05228758),
(0.48571429, 0.05098039, 0.05098039),
(0.49523810, 0.04967320, 0.04967320),
(0.50476190, 0.04836601, 0.04836601),
(0.51428571, 0.04705882, 0.04705882),
(0.52380952, 0.04575163, 0.04575163),
(0.53333333, 0.04444444, 0.04444444),
(0.54285714, 0.04313725, 0.04313725),
(0.55238095, 0.04183007, 0.04183007),
(0.56190476, 0.04052288, 0.04052288),
(0.57142857, 0.03921569, 0.03921569),
(0.58095238, 0.06797386, 0.06797386),
(0.59047619, 0.09673203, 0.09673203),
(0.60000000, 0.12549020, 0.12549020),
(0.60952381, 0.15424837, 0.15424837),
(0.61904762, 0.18300654, 0.18300654),
(0.62857143, 0.21176471, 0.21176471),
(0.63809524, 0.24052288, 0.24052288),
(0.64761905, 0.26928105, 0.26928105),
(0.65714286, 0.29803922, 0.29803922),
(0.66666667, 0.32679739, 0.32679739),
(0.67619048, 0.35555556, 0.35555556),
(0.68571429, 0.38431373, 0.38431373),
(0.69523810, 0.41307190, 0.41307190),
(0.70476190, 0.44183007, 0.44183007),
(0.71428571, 0.47058824, 0.47058824),
(0.72380952, 0.56862745, 0.56862745),
(0.73333333, 0.66666667, 0.66666667),
(0.74285714, 0.76470588, 0.76470588),
(0.75238095, 0.86274510, 0.86274510),
(0.76190476, 0.96078431, 0.96078431),
(0.77142857, 0.93725490, 0.93725490),
(0.78095238, 0.91372549, 0.91372549),
(0.79047619, 0.89019608, 0.89019608),
(0.80000000, 0.86666667, 0.86666667),
(0.80952381, 0.84313725, 0.84313725),
(0.81904762, 0.87450980, 0.87450980),
(0.82857143, 0.90588235, 0.90588235),
(0.83809524, 0.93725490, 0.93725490),
(0.84761905, 0.96862745, 0.96862745),
(0.85714286, 1.00000000, 1.00000000),
(0.86666667, 0.90980392, 0.90980392),
(0.87619048, 0.81960784, 0.81960784),
(0.88571429, 0.72941176, 0.72941176),
(0.89523810, 0.63921569, 0.63921569),
(0.90476190, 0.54901961, 0.54901961),
(0.91428571, 0.27450980, 0.27450980),
(0.92380952, 0.00000000, 0.00000000),
(0.93333333, 0.05882353, 0.05882353),
(0.94285714, 0.11764706, 0.11764706),
(0.95238095, 0.70588235, 0.70588235),
(0.96190476, 0.60784314, 0.60784314),
(0.97142857, 0.50980392, 0.50980392),
(0.98095238, 0.41176471, 0.41176471),
(0.99047619, 0.31372549, 0.31372549),
(1.00000000, 0.21568627, 0.21568627)
],
"red": [
(0.00000000, 0.05882353, 0.05882353),
(0.00952381, 0.05882353, 0.05882353),
(0.01904762, 0.05882353, 0.05882353),
(0.02857143, 0.05882353, 0.05882353),
(0.03809524, 0.05882353, 0.05882353),
(0.04761905, 0.05882353, 0.05882353),
(0.05714286, 0.05882353, 0.05882353),
(0.06666667, 0.05882353, 0.05882353),
(0.07619048, 0.05882353, 0.05882353),
(0.08571429, 0.05882353, 0.05882353),
(0.09523810, 0.05882353, 0.05882353),
(0.10476190, 0.05882353, 0.05882353),
(0.11428571, 0.05882353, 0.05882353),
(0.12380952, 0.05882353, 0.05882353),
(0.13333333, 0.05882353, 0.05882353),
(0.14285714, 0.05882353, 0.05882353),
(0.15238095, 0.05882353, 0.05882353),
(0.16190476, 0.05882353, 0.05882353),
(0.17142857, 0.05882353, 0.05882353),
(0.18095238, 0.05882353, 0.05882353),
(0.19047619, 0.05882353, 0.05882353),
(0.20000000, 0.05882353, 0.05882353),
(0.20952381, 0.05882353, 0.05882353),
(0.21904762, 0.05882353, 0.05882353),
(0.22857143, 0.05882353, 0.05882353),
(0.23809524, 0.05882353, 0.05882353),
(0.24761905, 0.05882353, 0.05882353),
(0.25714286, 0.05882353, 0.05882353),
(0.26666667, 0.05882353, 0.05882353),
(0.27619048, 0.05882353, 0.05882353),
(0.28571429, 0.05882353, 0.05882353),
(0.29523810, 0.05882353, 0.05882353),
(0.30476190, 0.05882353, 0.05882353),
(0.31428571, 0.05882353, 0.05882353),
(0.32380952, 0.05882353, 0.05882353),
(0.33333333, 0.05882353, 0.05882353),
(0.34285714, 0.05882353, 0.05882353),
(0.35238095, 0.05882353, 0.05882353),
(0.36190476, 0.05882353, 0.05882353),
(0.37142857, 0.05882353, 0.05882353),
(0.38095238, 0.05882353, 0.05882353),
(0.39047619, 0.05882353, 0.05882353),
(0.40000000, 0.05882353, 0.05882353),
(0.40952381, 0.05882353, 0.05882353),
(0.41904762, 0.05882353, 0.05882353),
(0.42857143, 0.05882353, 0.05882353),
(0.43809524, 0.05751634, 0.05751634),
(0.44761905, 0.05620915, 0.05620915),
(0.45714286, 0.05490196, 0.05490196),
(0.46666667, 0.05359477, 0.05359477),
(0.47619048, 0.05228758, 0.05228758),
(0.48571429, 0.05098039, 0.05098039),
(0.49523810, 0.04967320, 0.04967320),
(0.50476190, 0.04836601, 0.04836601),
(0.51428571, 0.04705882, 0.04705882),
(0.52380952, 0.04575163, 0.04575163),
(0.53333333, 0.04444444, 0.04444444),
(0.54285714, 0.04313725, 0.04313725),
(0.55238095, 0.04183007, 0.04183007),
(0.56190476, 0.04052288, 0.04052288),
(0.57142857, 0.03921569, 0.03921569),
(0.58095238, 0.06797386, 0.06797386),
(0.59047619, 0.09673203, 0.09673203),
(0.60000000, 0.12549020, 0.12549020),
(0.60952381, 0.15424837, 0.15424837),
(0.61904762, 0.18300654, 0.18300654),
(0.62857143, 0.21176471, 0.21176471),
(0.63809524, 0.24052288, 0.24052288),
(0.64761905, 0.26928105, 0.26928105),
(0.65714286, 0.29803922, 0.29803922),
(0.66666667, 0.32679739, 0.32679739),
(0.67619048, 0.35555556, 0.35555556),
(0.68571429, 0.38431373, 0.38431373),
(0.69523810, 0.41307190, 0.41307190),
(0.70476190, 0.44183007, 0.44183007),
(0.71428571, 0.47058824, 0.47058824),
(0.72380952, 0.45098039, 0.45098039),
(0.73333333, 0.43137255, 0.43137255),
(0.74285714, 0.41176471, 0.41176471),
(0.75238095, 0.39215686, 0.39215686),
(0.76190476, 0.37254902, 0.37254902),
(0.77142857, 0.40392157, 0.40392157),
(0.78095238, 0.43529412, 0.43529412),
(0.79047619, 0.46666667, 0.46666667),
(0.80000000, 0.49803922, 0.49803922),
(0.80952381, 0.52941176, 0.52941176),
(0.81904762, 0.62352941, 0.62352941),
(0.82857143, 0.71764706, 0.71764706),
(0.83809524, 0.81176471, 0.81176471),
(0.84761905, 0.90588235, 0.90588235),
(0.85714286, 1.00000000, 1.00000000),
(0.86666667, 1.00000000, 1.00000000),
(0.87619048, 1.00000000, 1.00000000),
(0.88571429, 1.00000000, 1.00000000),
(0.89523810, 1.00000000, 1.00000000),
(0.90476190, 1.00000000, 1.00000000),
(0.91428571, 0.94117647, 0.94117647),
(0.92380952, 0.88235294, 0.88235294),
(0.93333333, 0.71568627, 0.71568627),
(0.94285714, 0.54901961, 0.54901961),
(0.95238095, 1.00000000, 1.00000000),
(0.96190476, 0.92941176, 0.92941176),
(0.97142857, 0.85882353, 0.85882353),
(0.98095238, 0.78823529, 0.78823529),
(0.99047619, 0.71764706, 0.71764706),
(1.00000000, 0.64705882, 0.64705882)
]
}

# Colors maps from Patrick Marsh (http://www.pmarshwx.com/)
_RefDiff_data = {
"blue": [
Expand Down Expand Up @@ -1880,6 +2207,7 @@
"NWSRef": _NWSRef_data,
"NWSVel": _NWSVel_data,
"NWS_SPW": _NWS_SPW_data,
"NWS_CC": _NWS_CC_data,
"RefDiff": _RefDiff_data,
"Carbone11": _Carbone11_data,
"Carbone17": _Carbone17_data,
Expand Down
5 changes: 4 additions & 1 deletion pyart/graph/_cm_colorblind.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ def yuv_rainbow_24(nc):
spectral_ext_rgb_vals = np.genfromtxt(
os.path.join(data_dir, "spectral-extended-rgb.txt")
)

plasmidis_rgb_vals = np.genfromtxt(
os.path.join(data_dir, "plasmidis-rgb.txt")
)

# HomeyerRainbow developed by Cameron Homeyer with assistance from Bobby Jackson

Expand All @@ -61,4 +63,5 @@ def yuv_rainbow_24(nc):
"balance": bal_rgb_vals,
"ChaseSpectral": chase_spectral_rgb_vals,
"SpectralExtended": spectral_ext_rgb_vals,
"plasmidis": plasmidis_rgb_vals
}
1 change: 1 addition & 0 deletions pyart/graph/cm.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
* NWSRef
* NWSVel
* NWS_SPW
* NWS_CC
* PD17
* RRate11
* RdYlBu11b
Expand Down
Loading

0 comments on commit 366c697

Please sign in to comment.