From f81a1ee33956b6196718e2f21481423efbf45665 Mon Sep 17 00:00:00 2001 From: akrherz Date: Mon, 25 Jun 2018 14:22:05 -0500 Subject: [PATCH] centralize a DEP data ramps WIP on akrherz/dep#60 --- pyiem/dep.py | 14 ++++++++++++++ pyiem/plot/colormaps.py | 12 ++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/pyiem/dep.py b/pyiem/dep.py index 42916c875..feed6f62e 100644 --- a/pyiem/dep.py +++ b/pyiem/dep.py @@ -16,6 +16,20 @@ YLD_DATA = re.compile((r"Crop Type #\s+(?P\d+)\s+Date = (?P\d+)" r" OFE #\s+(?P\d+)\s+yield=\s+(?P[0-9\.]+)" r" \(kg/m\*\*2\) year= (?P\d+)")) +# 11 values to make for 10 colors +RAMPS = { + 'english': [ + [0.01, 0.1, 0.25, 0.5, 0.75, 1., 1.5, 2., 3., 5., 7.], + [0.05, 0.5, 1., 1.5, 2., 3., 4., 5., 7., 10., 20.], + [1., 2., 5., 7., 10., 15., 20., 25., 30., 35., 40.], + ], + 'metric': [ + [0.25, 1., 10., 15., 25., 35., 50., 75., 100., 150., 200.], + [0.5, 2., 20., 30., 50., 70., 100., 150., 200., 300., 400.], + [25., 50., 125., 200., 250., 300., 350., 400., 500., 700., 1000.], + ], + +} def get_cli_fname(lon, lat, scenario=0): diff --git a/pyiem/plot/colormaps.py b/pyiem/plot/colormaps.py index b6e47932a..7d853892d 100644 --- a/pyiem/plot/colormaps.py +++ b/pyiem/plot/colormaps.py @@ -30,12 +30,12 @@ def nwssnow(): [0.19215686, 0.50980392, 0.74117647], [0.03137255, 0.31764706, 0.61176471], [0.03137255, 0.14901961, 0.58039216], - [1., 1., 0.58823529], - [1., 0.76862745, 0.], - [1., 0.52941176, 0.], - [0.85882353, 0.07843137, 0.], - [0.61960784, 0., 0.], - [0.41176471, 0., 0.]] + [1., 1., 0.58823529], + [1., 0.76862745, 0.], + [1., 0.52941176, 0.], + [0.85882353, 0.07843137, 0.], + [0.61960784, 0., 0.], + [0.41176471, 0., 0.]] cmap = mpcolors.ListedColormap(cpool, 'nwssnow') cmap.set_over([0.16862745, 0., 0.18039216]) cmap.set_under('#FFFFFF')