-
Notifications
You must be signed in to change notification settings - Fork 16
FIREFLY-1694,1105,1784: Improve unit recognition of SpectrumDM #1798
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
base: dev
Are you sure you want to change the base?
Conversation
53710a4
to
0c06b30
Compare
dbe375a
to
afa6a60
Compare
Added some in-line code documentation too
For tracking everything at one place: Comments from @loitly on Jun 17, 2025:
|
minor word changes, not directly related to this issue so i made a new ticket: https://jira.ipac.caltech.edu/browse/FIREFLY-1784 Jaladh, i added you as a watcher since trey is out and i don't know if this is an easy fix or not. This looks really nice! i have also asked vandana to take a look. |
Testing at https://fireflydev.ipac.caltech.edu/firefly-1694-1105/firefly/ Test 1. Open a Euclid combspec file as delivered. a. The 1D spectrum extensions are correctly plotted as spectra. b. In the chart options, "Trace Style" is now at the top, and no longer in the Trace options. That's kinda strange. c. The conversion between erg/s/cm^2/Angstrom and W/m^2/micron looks correct. Test 2. I uploaded a file that I modified (modified_euclid_spectrum.vot). The flux has units of 1e-16erg.s**-1.cm**-2.Angstrom**-1 a. This was recognized as a spectrum and plotted correctly. b. The unit conversion looks correct, even with the factor out front! Nice! Test 3: I uploaded another modified file (mod2_euclid_spectrum.vot), in which I replaced all instances of "Angstrom" to "Ang". a. Firefly still recognized this as a spectrum. good. b. The units were displayed in the chart area, but there weren't any conversion options. On ops, the units were not shown. good. Test 4. I uploaded mod3.vot, which has units of 1e-16erg.s**-1.cm^-2.Angstrom**-1 Firefly did NOT understand this. Test 5. I uploaded mod4.vot, which has units of 1e-16erg.s**-1.cm-2.Angstrom**-1 Firefly did NOT understand this. Test 5. I uploaded mod5.vot, which has units of 1e-16erg/s/cm2/A Worked fine! Test 6. I uploaded mod6.vot, which has units of 1e-16erg/s/cm**2/A Worked fine! Test 7. I uploaded mod7.vot, which has units of 1e-16erg/s/cm^2/A Worked fine! |
@vandesai1 thanks for the detailed testing. It seems to me you’re mostly happy with your test results except the bolded ones:
I also feel it should be inside Trace options collapsible, I can move it there unless we had an historical reason to keep it outside?
|
I can see your code changes (oooh i'm getting more confident in understanding how to use github!) |
Yay!
Done! |
f4d738a
to
0953145
Compare
Nah, I think it's ok like this. I need to eat something and then look at #1. |
I agree that it's strange that the trace style has appeared in the Y axis section. I can't remember why that was there. Maybe we shouldn't change it without a ccb, since it wasn't part of any of these tickets? |
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.
Code looks good. About the Trace Style, I think it was mainly to keep frequently changed settings outside the collapsible panel. Whatever we decide, I think we should do the same for the Scatter plot options panel too.
// TODO: write tests for all exported functions? | ||
test('getUnitConvExpr', () => { | ||
|
||
}); |
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.
What I’m looking for here is documentation that demonstrates how this module is intended to be used and what results to expect(documenting behavior).
Some usage examples would help so I don’t have to read through the code. Simple examples are great, but a few trickier ones would be even better.
Fixes FIREFLY-1694, FIREFLY-1105, FIREFLY-1784
Following task-list is derived from the text and comments in above tickets (+ conversations about this work in meetings):
erg/s/cm^2
and convert to equivalent units:W/m^2/Hz <-> Jy <-> erg/s/cm^2/Hz
.erg/s/cm^2/A
can't be converted to flux density in frequency space so added one more wavelength space unitW/m^2/um
.field with a tiptext.Angstrom = angstrom = A
,erg/s/cm^2/Angstrom = erg/s/cm2/Angstrom = erg/s/cm**2/Angstrom = erg.s**-1.cm**-2.Angstrom**-1
, etc.Testing
https://fireflydev.ipac.caltech.edu/firefly-1694-1105/firefly/
Upload test files (attached in the 1694 ticket), first on irsaviewer ops and then on this build. Open chart dialogs for each file and notice how they differ between irsaviewer and this build. Change unit dropdowns (and redshift correction ones), it should update the column field with correct formula and chart axes label with correct label (once you hit apply)