Skip to content

WCS and alignment operations fixed for datacubes#2147

Open
rcooke-ast wants to merge 32 commits into
kcwi_dec_2024_rjc2from
kcwi_dec_2024_WCS
Open

WCS and alignment operations fixed for datacubes#2147
rcooke-ast wants to merge 32 commits into
kcwi_dec_2024_rjc2from
kcwi_dec_2024_WCS

Conversation

@rcooke-ast

@rcooke-ast rcooke-ast commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

This is an extension to PR #1929 that fixes the alignment and WCS values discussed there. I will run the dev-suite to make sure I haven't broken everything, but all of the modes that I have tested work. This PR also includes a test (it's not ideal, because it doesn't touch the coadd3d file, but at least it's a fast way to confirm the core alignments codes). This addresses (I think!) Issue #2116.

I have also made some coding improvements that increased the speed (by almost 2x) of creating datacubes.

@rcooke-ast rcooke-ast mentioned this pull request Jun 5, 2026

@kbwestfall kbwestfall left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, @rcooke-ast ! Two main comments from me:

  • Can we split up the new datacube test?
  • Do we need the new linear_interpolate_extrapolate function?

The rest are some code clean-up comments.

Comment thread pypeit/core/datacube.py
Comment thread pypeit/core/datacube.py Outdated
Comment thread pypeit/core/datacube.py
Comment thread pypeit/core/datacube.py Outdated
Comment thread pypeit/core/datacube.py Outdated
Comment thread pypeit/core/datacube.py
Comment thread pypeit/core/datacube.py Outdated
Comment thread pypeit/core/datacube.py Outdated
assert np.isclose(ra_offsets[0].to(u.arcsec).value, 0.0, atol=atol)
assert np.isclose(dec_offsets[0].to(u.arcsec).value, 0.0, atol=atol)
assert np.isclose(ra_offsets[1].to(u.arcsec).value, offs_ra.to(u.arcsec).value, atol=atol)
assert np.isclose(dec_offsets[1].to(u.arcsec).value, offs_dec.to(u.arcsec).value, atol=atol)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks so much for the new tests!! Can we break this single test function into multiple separate functions, or does the entire test need to run for it to make sense?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Sure, I can break it up into three separate tests. That makes more sense. They are pseudo-independent, and it would be good to know if one crashes when another doesn't.

Comment thread pypeit/utils.py

@rcooke-ast rcooke-ast left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Thanks @kbwestfall -- comments addressed!

Comment thread pypeit/core/datacube.py
Comment thread pypeit/core/datacube.py Outdated
Comment thread pypeit/core/datacube.py
Comment thread pypeit/core/datacube.py Outdated
Comment thread pypeit/core/datacube.py Outdated
Comment thread pypeit/core/datacube.py
Comment thread pypeit/core/datacube.py Outdated
Comment thread pypeit/core/datacube.py Outdated
assert np.isclose(ra_offsets[0].to(u.arcsec).value, 0.0, atol=atol)
assert np.isclose(dec_offsets[0].to(u.arcsec).value, 0.0, atol=atol)
assert np.isclose(ra_offsets[1].to(u.arcsec).value, offs_ra.to(u.arcsec).value, atol=atol)
assert np.isclose(dec_offsets[1].to(u.arcsec).value, offs_dec.to(u.arcsec).value, atol=atol)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Sure, I can break it up into three separate tests. That makes more sense. They are pseudo-independent, and it would be good to know if one crashes when another doesn't.

Comment thread pypeit/utils.py
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.

3 participants