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

Add API to afwDisplay.Display to select the colour map

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: afw
    • Labels:
      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

            Hide
            rhl Robert Lupton added a comment -

            We probably also want

             display.setDefaultImageColormap(name)

            Show
            rhl Robert Lupton added a comment - We probably also want display.setDefaultImageColormap(name)
            Hide
            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!

            Show
            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!
            Hide
            shupe David Shupe added a comment -

            Reviewed and approved on the Github PR. 

            Show
            shupe David Shupe added a comment - Reviewed and approved on the Github PR. 
            Hide
            rhl Robert Lupton added a comment -

            Ran Jenkins, merged, pushed

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

              People

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

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.