Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing color does not support all of the new color syntaxes. #1825

chaosphere2112 opened this issue Feb 12, 2016 · 1 comment


Copy link

import vcs, cdms2
x = vcs.init()
box = x.createboxfill()
box.missing = "white"
f = + "/")
s = f('clt')
x.plot(s, box)

Leads to a traceback:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/fries2/bin/uvcdat/cdatgui/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/vcs/", line 2424, in plot
    a = self.__plot(arglist, keyargs)
  File "/Users/fries2/bin/uvcdat/cdatgui/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/vcs/", line 3757, in __plot
    returned_kargs = self.backend.plot(*arglist, **keyargs)
  File "/Users/fries2/bin/uvcdat/cdatgui/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/vcs/", line 534, in plot
    vtk_backend_grid, vtk_backend_geo))
  File "/Users/fries2/bin/uvcdat/cdatgui/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/vcs/vcsvtk/", line 290, in plot
  File "/Users/fries2/bin/uvcdat/cdatgui/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/vcs/vcsvtk/", line 332, in _createMaskedDataMapper
    color = _colorMap.index[color]
  File "/Users/fries2/bin/uvcdat/cdatgui/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/vcs/", line 175, in __getitem__
    raise ValueError('Cell index must be in the range 0 to 255.')
ValueError: Cell index must be in the range 0 to 255.

This is because the code for retrieving the missing color does not properly account for all of our new methods for specifying colors.

I'm going to do a quick fix for this one, because I need some better logic for handling colors in the new GUI as well. I'll write up a quick function in vcs.utils that will take a color value and a colormap and spit back out the RGB values.

Copy link

@chaosphere2112 while you are at it, could you please add the transparent color. I think it would be a useful one to have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants