Skip to content
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

[FEAT] support Spectrum1D objects with 2D flux arrays in Specviz #3223

Closed
rileythai opened this issue Oct 16, 2024 · 0 comments · Fixed by #3229
Closed

[FEAT] support Spectrum1D objects with 2D flux arrays in Specviz #3223

rileythai opened this issue Oct 16, 2024 · 0 comments · Fixed by #3229
Labels
feature Feature request needs-triage Issue opened via template and needs triaging

Comments

@rileythai
Copy link
Contributor

Jdaviz component

Specviz

What is the problem this feature will solve?

Specviz currently does not support 2D flux arrays in Spectrum1D objects when loading data via the specutils default loaders.

As an example:

spec = Spectrum1D(spectral_axis=np.linspace(4000,6000,100)*u.Angstrom,flux=np.ones((4,100))*u.Unit("1e-17 erg / (Angstrom cm2 s)
"))
s = Specviz()
s.load_data(spec)

will load to the NotImplementedError.

NotImplementedError                       Traceback (most recent call last)
File ~/miniforge3/envs/sudev/lib/python3.10/site-packages/jdaviz/core/helpers.py:500, in ConfigHelper._get_data.<locals>._handle_display_units(data, use_display_units)
500         raise NotImplementedError(f"converting {data.__class__.__name__} to display units is not supported")  # noqa
NotImplementedError: converting NDData to display units is not supported

Describe the desired outcome

Since multi-dimensional flux can be passed into the Spectrum1D object (see here in specutils docs), it would be nice to have this automagically converted and imported into Specviz by jdaviz.

A potential implementation is to just convert all Spectrum1D objects with ND flux sent into the app into SpectrumList objects.

Additional context

This issue is related to astropy/specutils#1185 (comment) and astropy/specutils#1107 (comment) .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request needs-triage Issue opened via template and needs triaging
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant