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

spectral extraction defaults: fix case where background exactly on edge #1633

Merged
merged 1 commit into from
Sep 9, 2022

Conversation

kecnry
Copy link
Member

@kecnry kecnry commented Sep 9, 2022

Description

This pull request fixes the default spectral extraction parameters in specviz2d when the default background separation would otherwise fall directly on the edge of the image and cause the extraction to fail.

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 change log needed? If yes, is it added to CHANGES.rst?
  • Is a milestone set?
  • After merge, any internal documentations need updating (e.g., JIRA, Innerspace)?

@kecnry kecnry added bug Something isn't working trivial Only needs one approval instead of two specviz2d labels Sep 9, 2022
@kecnry kecnry added this to the 2.11 milestone Sep 9, 2022
@kecnry kecnry mentioned this pull request Sep 9, 2022
15 tasks
@kecnry kecnry force-pushed the spec-extract-edge-case branch from dec1422 to 2b9c304 Compare September 9, 2022 13:08
@kecnry kecnry marked this pull request as ready for review September 9, 2022 13:08
@codecov
Copy link

codecov bot commented Sep 9, 2022

Codecov Report

Base: 86.42% // Head: 86.42% // No change to project coverage 👍

Coverage data is based on head (a4c7073) compared to base (8896492).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1633   +/-   ##
=======================================
  Coverage   86.42%   86.42%           
=======================================
  Files          94       94           
  Lines        9457     9457           
=======================================
  Hits         8173     8173           
  Misses       1284     1284           
Impacted Files Coverage Δ
...plugins/spectral_extraction/spectral_extraction.py 91.42% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

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.

This is elegant fix, so LGTM. Except when I use this with #1608 , specreduce gives back flux unit in DN incorrectly. How do I overwrite that in the plot label?

Screenshot 2022-09-09 101031

CHANGES.rst Outdated Show resolved Hide resolved
@kecnry
Copy link
Member Author

kecnry commented Sep 9, 2022

Except when I use this with #1608 , specreduce gives back flux unit in DN incorrectly. How do I overwrite that in the plot label?

I think we should find the source of that and fix it rather than overwriting the plot label. But either way, I don't think that's directly related to the fix here.

@pllim
Copy link
Contributor

pllim commented Sep 9, 2022

If plot label is out of scope, then I will approve once we figure out the change log capitalization.

* should default to one-sided if the default background separation would fall exactly on the edge of the image
@kecnry kecnry force-pushed the spec-extract-edge-case branch from 2b9c304 to a4c7073 Compare September 9, 2022 14:17
@pllim
Copy link
Contributor

pllim commented Sep 9, 2022

p.s. A bit of a shame the wavelength info is lost in specreduce. Because if you use the old code that looks up certain header keywords, it actually has the wavelength info embedded.

Screenshot 2022-09-07 204916

@kecnry
Copy link
Member Author

kecnry commented Sep 9, 2022

p.s. A bit of a shame the wavelength info is lost in specreduce. Because if you use the old code that looks up certain header keywords, it actually has the wavelength info embedded.

We temporarily force plotting in pixel space in specviz2d because of the axes linking issues between wavelength and pixel. Once that is resolved, it is very easy to revert to plotting in wavelength/frequency.

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.

Thanks!

@kecnry kecnry merged commit c37fb45 into spacetelescope:main Sep 9, 2022
@kecnry kecnry deleted the spec-extract-edge-case branch September 9, 2022 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working specviz2d trivial Only needs one approval instead of two
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants