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

Bugfix: correction to Plot Options stretch function curve #2537

Merged
merged 1 commit into from
Nov 1, 2023

Conversation

bmorris3
Copy link
Contributor

@bmorris3 bmorris3 commented Oct 26, 2023

Description

The Plot Options stretch histogram curve from #2390 looks fine in Gray colormap, but does not look fine in other colormaps. Here's an image with a linear stretch showing a nonlinear curve in the stretch histogram:

Screen Shot 2023-10-26 at 13 09 47 (1)

In reproducing the logic in glue's CompositeArray module, I apply the stretch, contrast, and bias correctly, but then I went one line too far and also applied the colormap to the values that should represent the curve. That's not what we want! In the gray colormap case, the colormap is linear+monotonic so you don't notice the problem.

This PR corrects the implementation to work with any colormap:

Screen Shot 2023-10-26 at 13 56 50

Change log entry

  • Is a change log needed? If yes, is it added to CHANGES.rst? If you want to avoid merge conflicts,
    list the proposed change log here for review and add to CHANGES.rst before merge. If no, maintainer
    should add a no-changelog-entry-needed label.

Checklist for package maintainer(s)

This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.

  • Are two approvals required? Branch protection rule does not check for the second approval. If a second approval is not necessary, please apply the trivial label.
  • Do the proposed changes actually accomplish desired goals? Also manually run the affected example notebooks, if necessary.
  • Do the proposed changes follow the STScI Style Guides?
  • Are tests added/updated as required? If so, do they follow the STScI Style Guides?
  • Are docs added/updated as required? If so, do they follow the STScI Style Guides?
  • Did the CI pass? If not, are the failures related?
  • Is a milestone set? Set this to bugfix milestone if this is a bug fix and needs to be released ASAP; otherwise, set this to the next major release milestone.
  • After merge, any internal documentations need updating (e.g., JIRA, Innerspace)? 🐱

@bmorris3 bmorris3 added this to the 3.7.2 milestone Oct 26, 2023
@bmorris3 bmorris3 added bug Something isn't working imviz plugin Label for plugins common to multiple configurations labels Oct 26, 2023
@codecov
Copy link

codecov bot commented Oct 26, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Files Coverage Δ
...nfigs/default/plugins/plot_options/plot_options.py 91.29% <100.00%> (-0.71%) ⬇️

... and 3 files with indirect coverage changes

📢 Thoughts on this report? Let us know!.

Copy link
Member

@kecnry kecnry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad to see it wasn't anything too involved - thanks!

CHANGES.rst Show resolved Hide resolved
@kecnry kecnry modified the milestones: 3.7.2, 3.8 Oct 26, 2023
Copy link
Contributor

@pllim pllim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to add a regression test, to make sure a couple of stretch functions do not look weird when colormap is changed?

@kecnry kecnry mentioned this pull request Oct 27, 2023
9 tasks
@kecnry kecnry modified the milestones: 3.8, 3.7.2 Oct 30, 2023
@pllim pllim added the 💤 backport-v3.7.x on-merge: backport to v3.7.x label Oct 30, 2023
@kecnry kecnry merged commit bdce2af into spacetelescope:main Nov 1, 2023
15 of 16 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/jdaviz that referenced this pull request Nov 1, 2023
kecnry added a commit to meeseeksmachine/jdaviz that referenced this pull request Nov 1, 2023
kecnry added a commit that referenced this pull request Nov 1, 2023
…s stretch function curve) (#2542)

* Backport PR #2537: Bugfix: correction to Plot Options stretch function curve
* add additional fixes that were lost when rebasing #2537

---------

Co-authored-by: Brett M. Morris <morrisbrettm@gmail.com>
Co-authored-by: Kyle Conroy <kyleconroy@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working imviz plugin Label for plugins common to multiple configurations Ready for final review 💤 backport-v3.7.x on-merge: backport to v3.7.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants