-
Notifications
You must be signed in to change notification settings - Fork 74
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
convert flux cubes to per-square-pixel surface brightness cubes #3156
Conversation
Loading a flux cube, setting the flux or sb switch in unit conversion to surface brightness, and then changing flux unit raises a bunch of errors, likely similar situations as #3139. |
That seems to be working fine for me, interesting. I'll try to reproduce the errors |
I was using:
|
jdaviz/configs/cubeviz/plugins/spectral_extraction/tests/test_spectral_extraction.py
Outdated
Show resolved
Hide resolved
Would you rebase to main and fix the conflicts, please? |
This doesn't give me any errors after loading that cube: it also works in the UI. Was there some other way to trigger this error? |
here's a full example to reproduce with the current branch.
|
0cad4a8
to
2ec83b1
Compare
2ec83b1
to
ca3e40e
Compare
7588350
to
c62565f
Compare
Fix test Codestyle
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.
Partial review. Will continue later.
Note to self: test_cubeviz_aperphot_cube_sr_and_pix2
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.
I think I will stop here. Looking like you are pushing commits while I am reviewing. I don't want to end up reviewing outdated content.
jdaviz/configs/default/plugins/model_fitting/tests/test_fitting.py
Outdated
Show resolved
Hide resolved
jdaviz/configs/default/plugins/model_fitting/tests/test_fitting.py
Outdated
Show resolved
Hide resolved
jdaviz/configs/default/plugins/model_fitting/tests/test_plugin.py
Outdated
Show resolved
Hide resolved
* Fix NaN handling in cube fitting and initial fixes for unit conversion/model fitting interaction * Remove debugging prints, add comment for context * Codestyle, changelog * Reestimate parameters when cube fitting is toggled * Only reestimate if spectral y type isn't SB * Codestyle * Changelog * Fix initializing linear component for cube fit * Handle linear component estimation for cube case * Only reshape here in 3D case * Skip tests that need #3156 * Respect selected display units when initializing model components * Use app._get_display_unit instead of relying on Unit Conversion * Add equivalency here * Only reestimate here if sb unit != spectral_y unit * Don't automatically reestimate when toggling cube fit, make the user do it * Remove print * Check for warning in test after cube toggle Fix test Codestyle * Add test for cube fitting after flux unit change * Add a to-do about a test for unit conversion with equivalency * Fix failing test * Back to parallel processing post-debugging
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.
Skipped tests that needed #3190 + this are unskipped and passing, approved. Thanks for all the work on this!
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.
I added 2 follow up items to #3192 . My one comment about the import is not that important since CI is passing. So approving.
Feel free to merge if you don't want to address that comment or after you address it.
Thanks!
This PR implements support of per-pixel surface brightness cubes. Cubes loaded in flux units will be loaded as flux per square pixel surface brightness cubes. Cubes loaded directly in flux/pix2 are now supported as well.
This also fixes an issue with units in moment maps that was required for this work (may overlap some with #3116)
Another issue with batch mode photometry not showing units in the plugin is fixed by this as well
Also adds some improvement of support for cubes in counts