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

SHTs not working for resampled maps #195

Open
ajvanengelen opened this issue Jun 22, 2022 · 1 comment
Open

SHTs not working for resampled maps #195

ajvanengelen opened this issue Jun 22, 2022 · 1 comment

Comments

@ajvanengelen
Copy link
Contributor

  • pixell version: 0.16.0
  • Python version: 3.8
  • Operating System: Linux

Description

Taking an SHT of a higher-res map that was upsampled from a lower-res map is throwing an error. The difference is apparently the crval value in the WCS, being different from what it is if I just make the higher-res map from the start.

What I Did

from pixell import enmap, curvedsky
import numpy as np

#Check that we can take an SHT of a full-sky map at 5-arcmin resolution
small_resolution_arcmin = 5.
shape_small, wcs_small = enmap.fullsky_geometry(res = small_resolution_arcmin / 60 * np.pi / 180.)
mymap_small = enmap.ndmap( (np.zeros(shape_small)), wcs_small)
#This SHT works fine:
mysht_small = curvedsky.map2alm(mymap_small, lmax = 3000)

#Now start with a low-res map, then upsample it to the shape of the high-res map, and try the SHT
big_resolution_arcmin = 60
shape_big, wcs_big =  enmap.fullsky_geometry(res = big_resolution_arcmin / 60 * np.pi / 180.)
mymap_big = enmap.ndmap( (np.zeros(shape_big)), wcs_big)
mymap_resampled = enmap.resample(mymap_big, oshape = shape_small, method = 'spline')
#This SHT throws an error:
mysht_resampled = curvedsky.map2alm(mymap_resampled, lmax = 3000)

Here is the error report:
Screen Shot 2022-06-22 at 10 59 50 AM

Here is the difference in WCS values:

Screen Shot 2022-06-22 at 11 00 45 AM

@ajvanengelen
Copy link
Contributor Author

Am I supposed to get the ainfo in some other way for this map which apparently has slightly different pixel positions?

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

No branches or pull requests

1 participant