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

WIP: Cubewcs mosaic and dask reproject #894

Draft
wants to merge 64 commits into
base: master
Choose a base branch
from

Conversation

keflavich
Copy link
Contributor

This is associated with astropy/reproject#351 and enables cube mosaicing with memory mapping. It might also work with astropy/reproject#388, but that's unclear.

@keflavich keflavich marked this pull request as draft December 3, 2023 00:50
@keflavich keflavich force-pushed the cubewcs_mosaic_and_dask_reproject branch from 5bc5a6c to cca08dc Compare December 8, 2023 01:20
if specw1.wcs.cdelt == 1.0:
raise NotImplementedError("Spectral WCS doesn't have a CDELT parameter; we don't know how to deal with this generally.")
if np.sign(specw1.wcs.cdelt) == 1:
new_crval3 = ranges.min().to(u.Hz).value
Copy link
Contributor

Choose a reason for hiding this comment

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

Keep in the same spectral unit?

Suggested change
new_crval3 = ranges.min().to(u.Hz).value
new_crval3 = ranges.min().value

Copy link
Contributor Author

Choose a reason for hiding this comment

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

CRVAL has to be in Hz - astropy wcs (wcslib) will force it to be if it isn't

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is the case, or only is when the spectral axis is already in freq. If it's velocity, the default is to m/s.

I added a couple commits that restructure this part to ensure it inherits the appropriate default WCS spectral unit (and this fixed our existing mosaic tests in this PR for me).

@keflavich keflavich force-pushed the cubewcs_mosaic_and_dask_reproject branch from 5290d36 to bbb71a1 Compare February 9, 2024 19:00
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