Fixes for initializing plugins when new data has incompatible units #3982
+47
−3
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 fixes some issues related to loading data with incompatible spectral axis units (data with pixel-only SA units and data with wavelength info). If you load in a 1d spectrum with the spectral axis in pixels, and then try to load a 2d spectrum in nm, loading errors out with a traceback.
While there are other issues related to using plugins when there are multiple viewers with incompatible units, the fixes in this PR allow the data to at least be loaded by fixing the initialization of the cross-dispersion profile and spectral extraction plugins, where the incompatibility of the new loaded data and the unit of 'pixel' set in the unit conversion plugin by the first load (which has no equivalent units for conversion) was causing tracebacks.