# Add API to afwDisplay.Display to select the colour map

XMLWordPrintable

## Details

• Type: Story
• Status: Done
• Resolution: Done
• Fix Version/s: None
• Component/s:
• Labels:
None
• Templates:
• Team:
Data Release Production

## Description

Alex Drlica-Wagner has added a facility to set the colour map in display_matplotlib;  this makes sense, but should be pulled up to the afwDisplay level.  Because we'd implement a dummy version of the API in interface.py there would be no immediate need for other backends to support this immediately.  The proposed API is:

  display.setImageColormap(name)

where name is a string;  the only one I see in common between ds9 and matplotlib is "gray" and "viridis" (which firefly doesn't understand) so it is probably not worth trying to come up with a set of standard names beyond "gray".

The interpretation of "name" is backend specific;  for matplotlib I propose that we interpret it as pyplot.cm.name.  If name is invalid, we should attempt to interpret it as a colormap and use it directly (or possibly vice-versa).  For ds9 I'll pass it to an xpa cmap command and trap errors. I leave it up to IPAC to make suitable choices for firefly.

## People

• Assignee:
Robert Lupton
Reporter:
Robert Lupton
Reviewers:
David Shupe
Watchers:
David Shupe, Robert Lupton