galsci / pysm

PySM 3: Sky emission simulations for Cosmic Microwave Background experiments
https://pysm3.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
36 stars 23 forks source link

Fix WCS issue in CAR maps #192

Closed zonca closed 1 month ago

zonca commented 1 month ago

the PySM function apply_smoothing_and_coord_transform supports CAR outputs, however, there was a bug due to astropy.units.Quantity stripping away the WCS, then some default WCS was attached in the map writing process but this was the wrong WCS.

See https://gist.github.com/zonca/278a243f19bbb59cd55a9f42f6348575

@msyriac the WCS which I think is the right one is:

car:{cdelt:[-1,1],crval:[0.5,0],crpix:[180.50,90.50]}

can you confirm this is fine?

I create it here:

https://github.com/zonca/pysm/blob/9e6090d23db71ce4b0de36595e7885e1416dc585/src/pysm3/utils/spherical_harmonics.py#L116-L119

zonca commented 1 month ago

better use nbviewer: https://nbviewer.org/gist/zonca/278a243f19bbb59cd55a9f42f6348575

msyriac commented 1 month ago

Yes, that WCS makes more sense. Which function wrote the default WCS? If it is a pixell function, we should fix it.

zonca commented 1 month ago

this was fixed in 58645c2a45585cbf27a34f869b84dc35b2e87fbe