-
Notifications
You must be signed in to change notification settings - Fork 73
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
Add option to get_data to apply spectral subset to collapse spatial #2199
Add option to get_data to apply spectral subset to collapse spatial #2199
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #2199 +/- ##
==========================================
- Coverage 91.78% 91.63% -0.16%
==========================================
Files 147 148 +1
Lines 16262 16458 +196
==========================================
+ Hits 14926 15081 +155
- Misses 1336 1377 +41
☔ View full report in Codecov by Sentry. |
It does what it is supposed to do, IF When applying the spectral subset, it returns a cropped spectrum, which is an ok behavior, but it is different than what
|
My issue with Looks like my logic did not cover that case! I thought we only get the collapsed data when applying a spatial subset but I forgot that function can do that as well. I'll work on all of these points, thank you @camipacifici ! |
Is that still an issue though if this is only exposed in the cubeviz helper? |
From a user perspective, I would probably expect to be able to call |
I'm not sure about that workflow. If we want to separate the parameters, we could do
So that a user can do How does that sound @camipacifici and @kecnry ? |
What is |
|
I like that plan, as long as somewhere handles the logic of checking to make sure I briefly thought to propose switching the order since spectral subset might be the more common use-case to request, but I like the way you propose as more intuitive to the order things are applied. |
If |
My thought was if both spectral and spatial subsets have subset names, then we assume the user wants the spectral subset applied to the collapsed data. In that case, function will just be |
Edit: Found a work around, latest commit implements it. Now working on updating docstrings and making tests. @camipacifici please let me know if the current implementation works better for you! |
Should it raise an error instead? |
Turns out that model fitting uses |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the configs act as I'd expect now, except for mosviz, but that should be as simple as copying the logic from specviz2d.
This also does prevent downstream apps from using this for non-spectral/spatial subsets. I'm working on testing against lcviz to propose some changes that would still allow for that flexibility while retaining the nice checks you've added here.
See javerbukh#15 for proposed changes to support downstream implementations (will still require minor modifications to lcviz). |
@kecnry Is there a reason that needs to be added to this PR and cannot be a follow-up? This PR's scope is already wider than initially planned. |
as-is this does break existing behavior downstream, but as long as we're willing to consider the follow-up PR a blocker for the release, I can do that as a separate PR after this is merged if you'd prefer. |
I'm just weary of adding more complexity and changes to this PR when I've spent a couple days now fixing bugs that crop up each time something changes. I would be more comfortable for that PR to exist in jdaviz where other devs can review and give their thoughts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good as long as we address the downstream concern as an immediate follow-up PR (I can open once this is merged) and before releasing 3.5.
i can't find any issues with this, so ill give it a good ol' 'LGTM' |
Description
This pull request is to add API to retrieve a data cube with a spatial subset applied to it, with a spectral subset then applied to that. The way to do that (using the CubevizExample notebook) is:
There are also now
get_data
methods in Imviz and Specviz2D since the coreget_data
method no longer allows a subset to be applied.Todo:
Fixes #1354
Fixes #1490
Change log entry
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, maintainershould 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.
trivial
label.