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

Error while returning a CAR map #178

Open
Ankurdev-astro opened this issue Apr 10, 2024 · 2 comments
Open

Error while returning a CAR map #178

Ankurdev-astro opened this issue Apr 10, 2024 · 2 comments

Comments

@Ankurdev-astro
Copy link

I am describing here an issue that I ran into while trying to return a CAR map using pysm3.apply_smoothing_and_coord_transform

I find specifically the error originates when template.py tries to import pixell.sharp here:

try:
import pixell.enmap
import pixell.curvedsky
import pixell.sharp
except ImportError:
pixell = None

Full traceback error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[6], line 1
----> 1 sim_map_rot = pysm3.apply_smoothing_and_coord_transform(sim_map, rot=hp.Rotator(coord="GC"),
      2                                                         output_car_resol =  0.25 * u.arcmin,
      3                                                        return_healpix= False,
      4                                                        return_car=True)

File /venvs/toast-venv/lib/python3.10/site-packages/pysm3/models/template.py:261, in apply_smoothing_and_coord_transform(input_map, fwhm, rot, lmax, output_nside, output_car_resol, return_healpix, return_car, input_alm, map2alm_lsq_maxiter, map_dist)
    259 if return_car:
    260     log.info("Alm to map CAR")
--> 261     shape, wcs = pixell.enmap.fullsky_geometry(
    262         output_car_resol.to_value(u.radian),
    263         dims=(3,),
    264         variant="fejer1",
    265     )
    266     ainfo = pixell.sharp.alm_info(lmax=lmax)
    267     output_maps.append(
    268         u.Quantity(
    269             pixell.curvedsky.alm2map(
   (...)
    274         )
    275     )

AttributeError: 'NoneType' object has no attribute 'enmap'

This happens because import pixell.sharp fails and pixell = None is assigned. I do not find pixell.sharp here:
https://github.com/simonsobs/pixell/tree/master/pixell

I would like to get a pysm3 map in CAR format, and would greatly appreciate your suggestions in case I am going wrong in the steps. Thanks

Some additional package version info:


import pixell
print(f"pixell version : {pixell.__version__}")
print(f"pysm3 version : {pysm3.__version__}")

import pixell.sharp
pixell version : 0.23.8
pysm3 version : 3.4.0
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[5], line 5
      2 print(f"pixell version : {pixell.__version__}")
      3 print(f"pysm3 version : {pysm3.__version__}")
----> 5 import pixell.sharp

ModuleNotFoundError: No module named 'pixell.sharp'
@zonca
Copy link
Member

zonca commented Apr 18, 2024

I'll need to update to a newer pixell version,
for now I recommend you downgrade:

pysm/setup.cfg

Line 34 in b154253

pixell == 0.17.3

@Ankurdev-astro
Copy link
Author

Yes, I shall do that. Thanks.

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

2 participants