Skip to content

Commit

Permalink
centralize a DEP data ramps
Browse files Browse the repository at this point in the history
WIP on akrherz/dep#60
  • Loading branch information
akrherz committed Jun 25, 2018
1 parent e90c177 commit f81a1ee
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
14 changes: 14 additions & 0 deletions pyiem/dep.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@
YLD_DATA = re.compile((r"Crop Type #\s+(?P<num>\d+)\s+Date = (?P<doy>\d+)"
r" OFE #\s+(?P<ofe>\d+)\s+yield=\s+(?P<yield>[0-9\.]+)"
r" \(kg/m\*\*2\) year= (?P<year>\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):
Expand Down
12 changes: 6 additions & 6 deletions pyiem/plot/colormaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit f81a1ee

Please sign in to comment.