-
Notifications
You must be signed in to change notification settings - Fork 75
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
PoC: Cubeviz parser for Roman L1 (ramp) products #2376
Conversation
7352138
to
e2fe99a
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2376 +/- ##
==========================================
- Coverage 88.79% 88.40% -0.39%
==========================================
Files 111 111
Lines 17223 17337 +114
==========================================
+ Hits 15293 15327 +34
- Misses 1930 2010 +80 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
e2fe99a
to
85791bb
Compare
This is some high-level thoughts motivated by some out-of-band conversation with @bmorris3 about this PR: I think it would be much better from a tecchnical and user-facing perspective to treat this as a separate and distinct helper/viz-tool from cubeviz. The reason why is: I think the value of the fixed-layout viz tools (as opposed to more general "freeform" modes of Glue) is that they give the user useful mental shortcuts for 1) the kind of data that goes into the tool, and 2) the kinds of workflows they want to do with that data. Another way of thinking about is that the answer to the question "what's that viz tool for?" should be answereable in about one sentence. And "visualizing spectral data cubes" is a one sentence answer, whereas "visualizing spectral data cubes and other things that are cubical like ramps, although they're not exactly spectral" is too long of a sentence to count 😉 . So I think it's better to instead have this functionality be in a "RampViz" or simlar so we can actually tell users that they go to rampviz for viewing ramps. That said, what we do not want to do is duplicate a lot of code unnecessarily. So I think two approaches are possible there:
(I tilt towards 2 because I'm not sure we have good/well-documented ways to inherit layouts/configurations/etc, but I don't have a strong opinion either way.) There's also a technical reason to break it out into a separate viz tool: we may want a different set of plugins. While many of them make sense, some of them don't necessarily make sense when the "spectrum" is a ramp, and I can definitely foresee future uses of rampviz that don't make sense for cubeviz. E.g., a plugin that runs the ramp-fitting tool in the pipeline and highlights where various things like cosmic rays appear. |
Thanks for your input @eteq.
It sounds like Cubeviz should be a new base class and it should have a subclass Specviz3D? 😉 |
Just for public record, I tend to lean in the exact opposite direction and would like to make the case that we avoid splitting into separate configs whenever possible to (a) minimize maintainability overhead on the code and docs, (b) avoid confusion of "which do I use" when its not necessarily obvious, and (c) allow for more flexible workflows. Instead of more configs, I'd like to see viewers/layout, tools, and "plugins" be more self-aware of the type of data loaded into the app and adjust accordingly. As an example with the current code, we could imagine specviz2d being absorbed into specviz and just have the 2d viewer and spectral extraction plugin know when they're applicable based on whether there is a 2d spectrum loaded in the app or not. To some extent we already handle a simpler version of self-awareness for the spectral axis in pixels vs wavelength, and yet we don't have separate configs for specviz2dwavelength, specviz2dfrequency, and specviz2dpixels. To make things a bit more messy, this decision is coupled strongly with the helper-vs-plugin-API discussion, as the vision I described above would almost require minimizing plugin/context-specific API calls within the helper in favor of them living in the plugins so they are only exposed when it makes sense to expose them (think of it essentially as a responsive or dynamic helper - although if this is the deal-breaker, I can imagine ways to still have top-level methods which toggle their visibility similar to #2347). I see the added benefit of jdaviz (on top of glue) as providing data parsers for common data products with automatic linking, context-aware data analysis tools, and maybe sensible viewer layout defaults, but not so much a fixed layout or name for each individual case. Instead of having a separate freeform mode, why not make jdaviz in general more flexible and dynamic? This is obviously a more general and philosophical discussion than "just" supporting Roman ramps, and also involves considerations about dependency handling, but I do agree that this is a good scenario we can use to think about these ideas and their consequences. |
Thank you @bmorris3 for the prototype! It looks great. Maybe a little slow, but we can talk about performance later.
|
Now, about the controversy above, I am no technical expert here, but as a user, I would choose @kecnry's approach over @eteq's approach. To me (user) cubeviz is a cube viewer, whatever that cube contains. I would prefer to have cubeviz smart enough to recognize the type of data I am trowing at it rather than having to choose myself between speccubeviz, gifviz, rampviz, starformationhistoryviz. I think we do not have to solve the controversy at the moment. The first thing to do it to talk with the Roman team and see what their specific needs are, especially in terms of plugins. |
85791bb
to
9c82b2b
Compare
9c82b2b
to
f200c8d
Compare
f200c8d
to
fd66649
Compare
Description
Several folks on the Roman team have requested help visualizing WFI Level 1 (image ramp) products. These data are flux cubes with two spatial dimensions and one "sample"/"group"/"resultant" dimension (these three names sometimes have context-dependent meanings, and sometimes are used interchangeably). Typical ramp cubes for each of the 18 detectors have 4086^2 pixels and ~6 samples per pixel.
This PR implements a proof of concept that allows the user to load the ramps into Cubeviz. A dedicated Roman 3D data parser is introduced for Cubeviz, which updates each Cubeviz viewer name by taking advantage of the viewer reference name update support implemented in #2338.
The repurposed Cubeviz viewers for this use case are:
i
is selected, this viewer shows the flux integrated between groupsi-1
andi
. This viewer shows an all-zero slice wheni==0
.Here's what the helper looks like with an L1 file loaded:
cubeviz-roman-ramps.mov
Interactive subsets are supported, showing the median flux in the subset for each sample in the integration-viewer:
cubeviz-roman-ramps-subsets.mov
The single-pixel subset option allows you to interactively view the ramp for single pixels of interest in the integration viewer. This may be helpful e.g. for finding where/when the core of a PSF saturates, or cosmic ray hits:
cubeviz-roman-ramps-single-pixel.mov
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.