-
Notifications
You must be signed in to change notification settings - Fork 76
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
Specviz2d: smoothed spectrum not showing #1956
Comments
I've been digging into this effort and am copying over my notes to this ticket: 2023-01-27:I am deep in a glue sink hole; this is safely no longer a 3 point ticket! I'm resurfacing and saving my progress so I don't forget, for my own future sanity. The root of the issue is that the marks aren't generating properly; the data is being smoothed properly and produces a valid object. To confirm this, I smoothed the dataset in Specviz2D, extracted the smoothed dataset, and replotted it in Specviz; it renders properly: Back in Specviz2D, we can actually see that the data is intact because the "bouncing ball" actually tracks the smoothed data properly! It correctly falls off the main spectra as expected: We can reveal the problem by going into plot options and exaggerating the line width; we can see the smoothed spectrum IS plotting, it's just all squished at the end: If we inspect the spectrum-viewer's marks, we can see the root of the error: Specifically, these values are the DEFAULT values of the marks. This importantly suggests that the values are not being updated properly somewhere downstream, not that the values are being miscalculated somehow:
From here, we need to figure out what's happening with the marks. In following the cascade of events when the smoothed data is attempted to be added to the spectrum viewer, I found the following line, where the Y (or "profile") values are being forced to be calculated:
I found the following traceback that is being swallowed up by glue, when calculating the Y ("profile") values:
This is the code that swallows the exception:
The reason why this is important is because it skips the
Figuring out why this traceback is firing is my biggest lead thus far to fixing the issue. 2023-02-10:Coming back to this ticket after the crazy Jwebbinar effort sucking all my time, but the new eyes gave me a clearer view of what's going on. I'll try to describe it below: One small piece of context I should leave here that I hadn't commented on yet is the source of the Traceback is fundamentally trying to convert the pixel axis to microns. It turns out the original data's wavelength axis is in microns. Keep this in mind for later. In trying to remember where I left off, I decided to take a step back; rather than dive into trying to fix the traceback, I instead asked, "Why is this even happening to begin with?" Looking deeper at the callstack that leads up to the traceback, the "area" of glue where this is failing is in the component linking. By my eyes, the source of the error appears to be the resulting gaussian smooth (in pixels) trying to be linked against the original 2D spectrum, which is in microns! So... where do I need to go from here?
2023-02-15I was able to get the gaussian data to plot properly by frankensteining it with the autocollapsed data. At least I now have something that will load. I'm going to look into what could possibly be the difference between the two. I've uploaded my notebook with the data: https://stsci.box.com/s/l8muozr3fqfo0vw01zlbqnmwotw83vpr |
Two other points I should mention as well: In Specviz2D, we currently convert both the 2D and 1D spectral axes to pixels due to lack of support of uneven spectral axes (which is currently in progress). Kyle presented a theory that this may be causing the linking issue (see Secondly, and this is where SME eyes may be useful, is that we have custom linking logic for Gaussian Smooth data products: Lines 442 to 486 in f8b3191
Kyle had another theory that we're might be linking improperly here. Ignoring the special logic didn't change the behavior, and I haven't been able to find anything troubling in the linking logic yet. |
Reporter: Camilla Pacifici
Load a s2d file.
Use gaussian smooth plugin on 1d spectrum.
Smoothed spectrum is in the list of data, but does not show in the viewer.
DISCLAIMER: This issue was autocreated by the Jdaviz Issue Creation Bot on behalf of the reporter. If any information is incorrect, please contact Duy Nguyen
The text was updated successfully, but these errors were encountered: