Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Spectral extraction in Cubeviz with composite subsets #2837

Merged
merged 4 commits into from
May 2, 2024

Conversation

bmorris3
Copy link
Contributor

This PR introduces spectral extraction to cubeviz for composite subsets. The implementation converts the composite subset to a boolean mask, and applies it in the NDData collapse. The only supported aperture extraction method is "center," since this approach completely avoids the photutils pixel weighting methods.

cubeviz-spectral-extract-composite.mov

I've added a test that extracts two spectra from individual non-composite subsets, and compares their sum with the spectrum of a composite subset that spans the same area as both subsets combined.

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. Bugfix milestone also needs an accompanying backport label.
  • After merge, any internal documentations need updating (e.g., JIRA, Innerspace)?

@github-actions github-actions bot added cubeviz plugin Label for plugins common to multiple configurations labels Apr 29, 2024
@bmorris3 bmorris3 added this to the 3.10 milestone Apr 29, 2024
Comment on lines 2318 to 2324
'aperture_message': 'composite subsets are not supported',
'aperture_message': 'composite subsets only support extraction '
'with aperture extraction method "center," and '
'without wavelength dependence',
Copy link
Member

@kecnry kecnry May 1, 2024

Choose a reason for hiding this comment

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

can we instead consider these as valid and add support for showing the orange outline?

EDIT: ah, I see, we definitely want to set something so that this message is displayed in the plugin, and it probably should not be considered a valid aperture for other cases, but it would still be nice if we can visualize the aperture itself 🤔 . The fact that this is a reusable component, also means that we probably should not refer to spectral-extraction specifics in the message set by the component (since this will then also appear in aperture photometry, etc, which won't make any sense).

@bmorris3
Copy link
Contributor Author

bmorris3 commented May 1, 2024

Removed the spectral extraction-specific aperture message in fbbdbd6, the UI warnings now looks like this:

Screen Shot 2024-05-01 at 13 59 14

Copy link
Collaborator

@rosteen rosteen left a comment

Choose a reason for hiding this comment

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

The diff (minus the tests) is smaller than I expected, nice implementation. It didn't break when I tested and the code looks good to me.

@rosteen
Copy link
Collaborator

rosteen commented May 2, 2024

I kicked the CI to see if Codecov will upload this time, that looked like a transient issue.

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.

I suspect this will motivate some UI/UX changes when we get to reviewing the plugin as a whole, but agree that doesn't need to be in scope here. I'm still a bit torn on whether we should visualize the selection for this case (and if we don't under the argument that its not exact, then perhaps we should also turn off the aperture visualization when the user turns off exact? - but again, that can be considered later).

@bmorris3 bmorris3 merged commit 3a0eff7 into spacetelescope:main May 2, 2024
14 checks passed
@bmorris3
Copy link
Contributor Author

bmorris3 commented May 2, 2024

Thanks both!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
cubeviz plugin Label for plugins common to multiple configurations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants