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

Allow single inputs to find_optimal_celestial_wcs and add ability to specify HDU #344

Merged
merged 8 commits into from
Mar 3, 2023

Conversation

astrofrog
Copy link
Member

@astrofrog astrofrog commented Mar 2, 2023

Still to do:

  • Make the generation of the different input types into a fixture and use it to check all the different reprojection functions
  • Properly test the case where a single HDUList is passed depending on whether hdu_in is specified or not
  • We could also support WCSes with APE 14 shapes specified (similar to Make shape_out optional if input WCS has array_shape #309)

Fixes #323

…and add ability to pass in hdu_in for FITS files and HDULists
@codecov
Copy link

codecov bot commented Mar 2, 2023

Codecov Report

Merging #344 (702e76a) into main (42b3ee5) will decrease coverage by 0.23%.
The diff coverage is 95.00%.

@@            Coverage Diff             @@
##             main     #344      +/-   ##
==========================================
- Coverage   92.62%   92.39%   -0.23%     
==========================================
  Files          24       24              
  Lines         786      802      +16     
==========================================
+ Hits          728      741      +13     
- Misses         58       61       +3     
Impacted Files Coverage Δ
reproject/adaptive/high_level.py 100.00% <ø> (ø)
reproject/interpolation/high_level.py 100.00% <ø> (ø)
reproject/spherical_intersect/high_level.py 100.00% <ø> (ø)
reproject/utils.py 83.09% <87.50%> (-1.58%) ⬇️
reproject/mosaicking/wcs_helpers.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@astrofrog astrofrog force-pushed the find_optimal_celestial_wcs_hdu branch from 49eb575 to cb2729f Compare March 3, 2023 11:34
@astrofrog astrofrog marked this pull request as ready for review March 3, 2023 11:42
@astrofrog astrofrog requested a review from Cadair March 3, 2023 11:42
@astrofrog
Copy link
Member Author

astrofrog commented Mar 3, 2023

Once this is merged we can set up a similar fixture for output projections and add support for APE 14 shapes

Comment on lines +58 to +59
If only one input data needs to be provided, it is also possible to
pass it in without including it in an iterable.
Copy link
Member

Choose a reason for hiding this comment

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

Is the added complexity really worth this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Absolutely 😄

Copy link
Member

@Cadair Cadair 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 for a quick look to me

input_value = (array, wcs)
elif request.param == "nddata":
input_value = NDData(data=array, wcs=wcs)
elif request.param == "ape14_wcs":
Copy link
Member

Choose a reason for hiding this comment

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

This is in this elif twice?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

reproject/conftest.py Outdated Show resolved Hide resolved
astrofrog and others added 2 commits March 3, 2023 21:47
Co-authored-by: Stuart Mumford <stuart@cadair.com>
@astrofrog astrofrog merged commit bdadcb7 into astropy:main Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

find_optimal_celestial_wcs does not accept ImageHDU, PrimaryHDU and CompImageHDU
2 participants