Image importer expose data label#26
Merged
javerbukh merged 29 commits intoJul 11, 2025
Merged
Conversation
c2ca307 to
e73fb39
Compare
49aa7dc to
8a344e5
Compare
b1213ff to
32c5a58
Compare
…pe#3478) Co-authored-by: Kyle Conroy <kyleconroy@gmail.com>
2587c01 to
73556c3
Compare
* clearer as we extend support for loaders, but also will enable for lcviz * deprecates import button for imviz
5a9a93c to
91650e8
Compare
91650e8 to
16bc94f
Compare
This reverts commit 2b49a73.
* Remove jwst s3d parser now that it can be handled by Spectrum1D * Update Jdaviz for specutils 2 compatibility Fix coords mouseover when SkyCoord is before SpectralCoord More debugging Fix slice with different spectral_axis_index, add specutils_format kwarg to cubeviz parser Remove unused import Remove ESA parser from commissioning [skip ci] Generalizing coords_info to handle spectral axis first or last [ci skip] Working on debugging aperture photometry Need to pull meta from data not comp Fix aperture photometry and wrong coord order in coords_info Fix codestyle, delete defunct case in parser Change Spectrum1D to Spectrum Change class name in recent code additions Get spectral extraction working again for cylinder case Debugging wavelength dependent case Make sure spectral extraction result is linked when added to data collection Moved fix to correct place Fix indents Remove stray code from rebase Update missed Spectrum1D Debugging cubeviz parser First start on fixing testt Fix bad rebase in spectral extraction Starting to work through test failures Working through test failures Debugging spectral extraction Fixing errors after rebase to main Finish fixing codestyle, probably still need functional fixes Replace new occurances of Spectrum1D with Spectrum Missed committing a file (re-) fix spectral extraction Handle checking GWCS for spectral subset, fix codestyle More debugging More debugging Remove parent data label code reintroduced by rebase * Update newer instances of Spectrum1D * Working on resolving test failures Trying to fix slicing Add keyword in velocity calculation Fix spectral extraction for arrays Update collapse Debugging moment maps * Fix bugs revealed by CI and update tests with new values where needed More debugging Debugging cube model fitting Fixing more tests Debugging spectral extraction and collapse Keep metadata in return_spectrum_with_correct_units Update gaussian smooth tests Take correct slice index in coords info Look for SpectralGWCS for linking as well as SpectralCoordinate More debugging Fix spectrum-at-spaxel for spectral-first cubes, linking for plugin generated cubes Fix model initialization and subset application for non-last spectral axis Link moment maps to correct cube components Update moment map test Remove debugging prints Update test value Remove debugging prints * Missed a couple codestyle things and Spectrum1D instances Fix moment map test * Fix remaining Spectrum1D instances Codestyle * Trying to fix tests related to this fixture * Update test values here as well for fixed test fixture * Changelog and updated specutils pin to use 2.0 RC * Update test values for fixed test fixture Codestyle * Add missing spectral_axis_index to this case * Temporarily pin glue-astronomy PR in dependencies Also pin dev specreduce for now, for CI Try this again... Same thing for glue-astronomy * Rename Spectrum1D instances after rebase to main * Remove new Spectrum1D usage * Glue-astronomy PR has been merged, pin to main * Revert specutils intersphinx mapping to stable * Fix cross dispersion profile wav calculation with specutils 2 * Update pins, fix aperture mask, update docs links Update specutils documentation links Fix specreduce pin * Fix moment map coordinate handling for GWCS, slice check for data ndim=1 Fix another remote data test * Remove duplicate line * Generalize generate_spaxels * Getting sonification working with specutils 2 and multiprocessing More work on cube listener Move wcs code to where it's actually used for readability Still trying to get sonification working, wrong pixel axes are getting linked in external_links Codestyle Get percentile along correct axis for sonification Link sonified data properly, fix expand_di axis Missed this Spectrum1D Got sonification working Fix failing testtest * Codestyle, debugging tests, addressing review comments Fixing spectrum2d loader Ignore warning in this test Move time information to snackbar output Revert check on len(subset_region) * Fix two minor rebase problems * Update jdaviz/configs/cubeviz/plugins/viewers.py Co-authored-by: Kyle Conroy <kyleconroy@gmail.com> * Apply suggestions from code review Co-authored-by: Kyle Conroy <kyleconroy@gmail.com> * Handle case where meta doesn't have spectral_axis_index * Update jdaviz/configs/imviz/plugins/aper_phot_simple/aper_phot_simple.py Co-authored-by: Kyle Conroy <kyleconroy@gmail.com> * Ignore new FitsFixed warning * Debugging failing test * Fix failing spectrum2d test * Make this more robust --------- Co-authored-by: Kyle Conroy <kyleconroy@gmail.com>
fac8646 to
1a30204
Compare
1a30204 to
15395fa
Compare
4141113
into
javerbukh:enable-loaders-with-tests
10 of 17 checks passed
javerbukh
pushed a commit
that referenced
this pull request
Jul 11, 2025
* ignore deprecation warning from astropy via spectral-cube (spacetelescope#3683) * feat: allow exporting of figures in a custom resolution (spacetelescope#3478) Co-authored-by: Kyle Conroy <kyleconroy@gmail.com> * loaders: use filename/URL as default label (spacetelescope#3684) * expose proposed data_label to user * allow passing extension through load * simplify repr of importers for debugging * import button enabled for all BUT listed configs * clearer as we extend support for loaders, but also will enable for lcviz * deprecates import button for imviz * codestyle * pass extension through _load * hdu2data to not return data * load_data: support list of filenames * allow defaulting to have extension for data without extension * strip out repeated data_label logic * load_data: backwards compatibility for appending [DATA] * orientation: bypass load_data * load_data: backwards compatibility for appending extension to ImageHDU * loaders: use filename/URL as default label (spacetelescope#3684) * update to use filename as default prefix * handle appending "extensions" for NDData * fix HDUList case when providing data_label through load_data * bypass NDData extension logic if coming from plugin (incl orientation) * Revert "orientation: bypass load_data" This reverts commit 2b49a73. * fix tests * maintain .reg support through load_data * Specutils 2 compatibility (spacetelescope#2922) * Remove jwst s3d parser now that it can be handled by Spectrum1D * Update Jdaviz for specutils 2 compatibility Fix coords mouseover when SkyCoord is before SpectralCoord More debugging Fix slice with different spectral_axis_index, add specutils_format kwarg to cubeviz parser Remove unused import Remove ESA parser from commissioning [skip ci] Generalizing coords_info to handle spectral axis first or last [ci skip] Working on debugging aperture photometry Need to pull meta from data not comp Fix aperture photometry and wrong coord order in coords_info Fix codestyle, delete defunct case in parser Change Spectrum1D to Spectrum Change class name in recent code additions Get spectral extraction working again for cylinder case Debugging wavelength dependent case Make sure spectral extraction result is linked when added to data collection Moved fix to correct place Fix indents Remove stray code from rebase Update missed Spectrum1D Debugging cubeviz parser First start on fixing testt Fix bad rebase in spectral extraction Starting to work through test failures Working through test failures Debugging spectral extraction Fixing errors after rebase to main Finish fixing codestyle, probably still need functional fixes Replace new occurances of Spectrum1D with Spectrum Missed committing a file (re-) fix spectral extraction Handle checking GWCS for spectral subset, fix codestyle More debugging More debugging Remove parent data label code reintroduced by rebase * Update newer instances of Spectrum1D * Working on resolving test failures Trying to fix slicing Add keyword in velocity calculation Fix spectral extraction for arrays Update collapse Debugging moment maps * Fix bugs revealed by CI and update tests with new values where needed More debugging Debugging cube model fitting Fixing more tests Debugging spectral extraction and collapse Keep metadata in return_spectrum_with_correct_units Update gaussian smooth tests Take correct slice index in coords info Look for SpectralGWCS for linking as well as SpectralCoordinate More debugging Fix spectrum-at-spaxel for spectral-first cubes, linking for plugin generated cubes Fix model initialization and subset application for non-last spectral axis Link moment maps to correct cube components Update moment map test Remove debugging prints Update test value Remove debugging prints * Missed a couple codestyle things and Spectrum1D instances Fix moment map test * Fix remaining Spectrum1D instances Codestyle * Trying to fix tests related to this fixture * Update test values here as well for fixed test fixture * Changelog and updated specutils pin to use 2.0 RC * Update test values for fixed test fixture Codestyle * Add missing spectral_axis_index to this case * Temporarily pin glue-astronomy PR in dependencies Also pin dev specreduce for now, for CI Try this again... Same thing for glue-astronomy * Rename Spectrum1D instances after rebase to main * Remove new Spectrum1D usage * Glue-astronomy PR has been merged, pin to main * Revert specutils intersphinx mapping to stable * Fix cross dispersion profile wav calculation with specutils 2 * Update pins, fix aperture mask, update docs links Update specutils documentation links Fix specreduce pin * Fix moment map coordinate handling for GWCS, slice check for data ndim=1 Fix another remote data test * Remove duplicate line * Generalize generate_spaxels * Getting sonification working with specutils 2 and multiprocessing More work on cube listener Move wcs code to where it's actually used for readability Still trying to get sonification working, wrong pixel axes are getting linked in external_links Codestyle Get percentile along correct axis for sonification Link sonified data properly, fix expand_di axis Missed this Spectrum1D Got sonification working Fix failing testtest * Codestyle, debugging tests, addressing review comments Fixing spectrum2d loader Ignore warning in this test Move time information to snackbar output Revert check on len(subset_region) * Fix two minor rebase problems * Update jdaviz/configs/cubeviz/plugins/viewers.py Co-authored-by: Kyle Conroy <kyleconroy@gmail.com> * Apply suggestions from code review Co-authored-by: Kyle Conroy <kyleconroy@gmail.com> * Handle case where meta doesn't have spectral_axis_index * Update jdaviz/configs/imviz/plugins/aper_phot_simple/aper_phot_simple.py Co-authored-by: Kyle Conroy <kyleconroy@gmail.com> * Ignore new FitsFixed warning * Debugging failing test * Fix failing spectrum2d test * Make this more robust --------- Co-authored-by: Kyle Conroy <kyleconroy@gmail.com> * allow API access to imviz.loaders * nddata without meta * for HDUList, always append extension to user-passed data_label --------- Co-authored-by: Maarten Breddels <maartenbreddels@gmail.com> Co-authored-by: Ricky O'Steen <39831871+rosteen@users.noreply.github.com>
javerbukh
pushed a commit
that referenced
this pull request
Jul 17, 2025
* ignore deprecation warning from astropy via spectral-cube (spacetelescope#3683) * feat: allow exporting of figures in a custom resolution (spacetelescope#3478) Co-authored-by: Kyle Conroy <kyleconroy@gmail.com> * loaders: use filename/URL as default label (spacetelescope#3684) * expose proposed data_label to user * allow passing extension through load * simplify repr of importers for debugging * import button enabled for all BUT listed configs * clearer as we extend support for loaders, but also will enable for lcviz * deprecates import button for imviz * codestyle * pass extension through _load * hdu2data to not return data * load_data: support list of filenames * allow defaulting to have extension for data without extension * strip out repeated data_label logic * load_data: backwards compatibility for appending [DATA] * orientation: bypass load_data * load_data: backwards compatibility for appending extension to ImageHDU * loaders: use filename/URL as default label (spacetelescope#3684) * update to use filename as default prefix * handle appending "extensions" for NDData * fix HDUList case when providing data_label through load_data * bypass NDData extension logic if coming from plugin (incl orientation) * Revert "orientation: bypass load_data" This reverts commit 2b49a73. * fix tests * maintain .reg support through load_data * Specutils 2 compatibility (spacetelescope#2922) * Remove jwst s3d parser now that it can be handled by Spectrum1D * Update Jdaviz for specutils 2 compatibility Fix coords mouseover when SkyCoord is before SpectralCoord More debugging Fix slice with different spectral_axis_index, add specutils_format kwarg to cubeviz parser Remove unused import Remove ESA parser from commissioning [skip ci] Generalizing coords_info to handle spectral axis first or last [ci skip] Working on debugging aperture photometry Need to pull meta from data not comp Fix aperture photometry and wrong coord order in coords_info Fix codestyle, delete defunct case in parser Change Spectrum1D to Spectrum Change class name in recent code additions Get spectral extraction working again for cylinder case Debugging wavelength dependent case Make sure spectral extraction result is linked when added to data collection Moved fix to correct place Fix indents Remove stray code from rebase Update missed Spectrum1D Debugging cubeviz parser First start on fixing testt Fix bad rebase in spectral extraction Starting to work through test failures Working through test failures Debugging spectral extraction Fixing errors after rebase to main Finish fixing codestyle, probably still need functional fixes Replace new occurances of Spectrum1D with Spectrum Missed committing a file (re-) fix spectral extraction Handle checking GWCS for spectral subset, fix codestyle More debugging More debugging Remove parent data label code reintroduced by rebase * Update newer instances of Spectrum1D * Working on resolving test failures Trying to fix slicing Add keyword in velocity calculation Fix spectral extraction for arrays Update collapse Debugging moment maps * Fix bugs revealed by CI and update tests with new values where needed More debugging Debugging cube model fitting Fixing more tests Debugging spectral extraction and collapse Keep metadata in return_spectrum_with_correct_units Update gaussian smooth tests Take correct slice index in coords info Look for SpectralGWCS for linking as well as SpectralCoordinate More debugging Fix spectrum-at-spaxel for spectral-first cubes, linking for plugin generated cubes Fix model initialization and subset application for non-last spectral axis Link moment maps to correct cube components Update moment map test Remove debugging prints Update test value Remove debugging prints * Missed a couple codestyle things and Spectrum1D instances Fix moment map test * Fix remaining Spectrum1D instances Codestyle * Trying to fix tests related to this fixture * Update test values here as well for fixed test fixture * Changelog and updated specutils pin to use 2.0 RC * Update test values for fixed test fixture Codestyle * Add missing spectral_axis_index to this case * Temporarily pin glue-astronomy PR in dependencies Also pin dev specreduce for now, for CI Try this again... Same thing for glue-astronomy * Rename Spectrum1D instances after rebase to main * Remove new Spectrum1D usage * Glue-astronomy PR has been merged, pin to main * Revert specutils intersphinx mapping to stable * Fix cross dispersion profile wav calculation with specutils 2 * Update pins, fix aperture mask, update docs links Update specutils documentation links Fix specreduce pin * Fix moment map coordinate handling for GWCS, slice check for data ndim=1 Fix another remote data test * Remove duplicate line * Generalize generate_spaxels * Getting sonification working with specutils 2 and multiprocessing More work on cube listener Move wcs code to where it's actually used for readability Still trying to get sonification working, wrong pixel axes are getting linked in external_links Codestyle Get percentile along correct axis for sonification Link sonified data properly, fix expand_di axis Missed this Spectrum1D Got sonification working Fix failing testtest * Codestyle, debugging tests, addressing review comments Fixing spectrum2d loader Ignore warning in this test Move time information to snackbar output Revert check on len(subset_region) * Fix two minor rebase problems * Update jdaviz/configs/cubeviz/plugins/viewers.py Co-authored-by: Kyle Conroy <kyleconroy@gmail.com> * Apply suggestions from code review Co-authored-by: Kyle Conroy <kyleconroy@gmail.com> * Handle case where meta doesn't have spectral_axis_index * Update jdaviz/configs/imviz/plugins/aper_phot_simple/aper_phot_simple.py Co-authored-by: Kyle Conroy <kyleconroy@gmail.com> * Ignore new FitsFixed warning * Debugging failing test * Fix failing spectrum2d test * Make this more robust --------- Co-authored-by: Kyle Conroy <kyleconroy@gmail.com> * allow API access to imviz.loaders * nddata without meta * for HDUList, always append extension to user-passed data_label --------- Co-authored-by: Maarten Breddels <maartenbreddels@gmail.com> Co-authored-by: Ricky O'Steen <39831871+rosteen@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR modifies spacetelescope#3662 to:
data_labelto the user if there will be a single entry added, and otherwise exposes the prefix (future work could expose how the for-loop will result in multiple data labels in the UI). This requires moving backwards-compatibility logic out of the old parser functions and either into the new default labels or into the mapping fromload_data.extensionthroughimviz._load, and allow mapping from extension names so that previous inputs toload_dataare supported.load_datawith general logic in importer, where possible, and by mapping when sending fromload_datato_loadin other cases