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

Support Spectrum1D objects with 2D data and 1D WCS #41

Merged
merged 6 commits into from
Sep 3, 2021

Conversation

astrofrog
Copy link
Member

@astrofrog astrofrog commented Sep 2, 2021

This adds a way to translate Spectrum1D objects with 1D spectral WCS and 2D datasets to glue objects and back, and is needed for spacetelescope/jdaviz#733. In future we should just support ND datasets with 1D WCS but the code for that will be a bit more complex and it would be easier to just wait for a release of NDCube so that we can use the compound WCS class from there. For now this PR makes it possible to support 2D spectra.

This also removes the use of SpectralCoordinate in to_data as glue and Spectrum1D now both support GWCS.

@codecov
Copy link

codecov bot commented Sep 2, 2021

Codecov Report

Merging #41 (e26342b) into main (90f6376) will decrease coverage by 1.40%.
The diff coverage is 91.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #41      +/-   ##
==========================================
- Coverage   95.84%   94.43%   -1.41%     
==========================================
  Files          15       15              
  Lines        1034     1114      +80     
==========================================
+ Hits          991     1052      +61     
- Misses         43       62      +19     
Impacted Files Coverage Δ
glue_astronomy/translators/spectrum1d.py 89.05% <86.88%> (-7.38%) ⬇️
...lue_astronomy/translators/tests/test_spectrum1d.py 91.33% <100.00%> (-3.79%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 90f6376...e26342b. Read the comment docs.

@astrofrog astrofrog merged commit 312e959 into glue-viz:main Sep 3, 2021
@pllim
Copy link
Contributor

pllim commented Sep 3, 2021

Did this break jdaviz? 😬 spacetelescope/jdaviz#837

@astrofrog
Copy link
Member Author

astrofrog commented Sep 3, 2021

Yes because we now leave GWCS objects untouched instead of transforming to SpectralCoordinate. I think jdaviz needs to be updated to reflect this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants