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

Return NDData for GWCS #58

Merged
merged 3 commits into from
Dec 7, 2021
Merged

Return NDData for GWCS #58

merged 3 commits into from
Dec 7, 2021

Conversation

pllim
Copy link
Contributor

@pllim pllim commented Nov 29, 2021

Description

Return NDData for GWCS instead of crashing in CCDData.

This works around astropy/astropy#11727 and is a hacky version of #38.

cc @rosteen

@codecov
Copy link

codecov bot commented Nov 29, 2021

Codecov Report

Merging #58 (e54b08c) into main (25d7711) will decrease coverage by 0.23%.
The diff coverage is 81.81%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #58      +/-   ##
==========================================
- Coverage   96.03%   95.80%   -0.24%     
==========================================
  Files          15       15              
  Lines        1136     1145       +9     
==========================================
+ Hits         1091     1097       +6     
- Misses         45       48       +3     
Impacted Files Coverage Δ
glue_astronomy/translators/ccddata.py 94.33% <81.81%> (-5.67%) ⬇️

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 25d7711...e54b08c. Read the comment docs.

if isinstance(data.coords, WCS):
wcs = data.coords
elif type(data.coords) is Coordinates or data.coords is None:
wcs = None
elif isinstance(data.coords, BaseHighLevelWCS):
has_gwcs = True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is not a general enough name as there might be other non-GWCS APE 14 WCSes. I think it would be better to special case has_fitswcs in the first clause.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Looks good now?

@pllim pllim force-pushed the imviz-nddata-gwcs branch from 19195fc to 7f77c19 Compare December 2, 2021 17:32
Copy link
Member

@astrofrog astrofrog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me but the test failure is related - it might just be a case of updating the test?

@pllim
Copy link
Contributor Author

pllim commented Dec 7, 2021

Re: Test failure -- I forgot to handle the case for wcs = None in a backward compatible way. The tests should pass now. Good catch and thanks for review!

@pllim
Copy link
Contributor Author

pllim commented Dec 7, 2021

casa job failure is unrelated.

@astrofrog astrofrog merged commit 7f3229d into glue-viz:main Dec 7, 2021
@pllim pllim deleted the imviz-nddata-gwcs branch December 7, 2021 22:26
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