Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-15218

Add API to afwDisplay.Display to select the colour map

    XMLWordPrintable

Details

    • Story
    • Status: Done
    • Resolution: Done
    • None
    • afw
    • None

    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.

      Attachments

        Issue Links

          Activity

            We probably also want

             display.setDefaultImageColormap(name)

            rhl Robert Lupton added a comment - We probably also want display.setDefaultImageColormap(name)

            Tested with display_matplotlib. I'll add support to display_ds9, or you could test by adding support to display_firefly first!

            rhl Robert Lupton added a comment - Tested with display_matplotlib . I'll add support to display_ds9 , or you could test by adding support to display_firefly first!
            shupe David Shupe added a comment -

            Reviewed and approved on the Github PR. 

            shupe David Shupe added a comment - Reviewed and approved on the Github PR. 

            Ran Jenkins, merged, pushed

            rhl Robert Lupton added a comment - Ran Jenkins, merged, pushed

            People

              rhl Robert Lupton
              rhl Robert Lupton
              David Shupe
              David Shupe, Robert Lupton
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Jenkins

                  No builds found.