write_map attaches a default WCS if the input map has no WCS, it might be useful to add a warning (or even an error) if this happens. This can be a source of bugs if a user is not careful (e.g. https://github.com/galsci/pysm/issues/192) @msyriac
Minimal example below:
import pixell.enmap
import numpy as np
shape, wcs = pixell.enmap.fullsky_geometry(
np.radians(5),
dims=(3,),
variant="fejer1",
)
m = pixell.enmap.zeros(shape, wcs)
pixell.enmap.write_map("map_with_wcs.fits", m)
pixell.enmap.write_map("map_no_wcs.fits", np.array(m))
print(pixell.enmap.read_map("map_with_wcs.fits").wcs)
car:{cdelt:[-5,5],crval:[2.5,0],crpix:[36.50,18.50]}
print(pixell.enmap.read_map("map_no_wcs.fits").wcs)
:{cdelt:[1,1],crval:[0,0],crpix:[0.00,0.00]}
write_map
attaches a default WCS if the input map has no WCS, it might be useful to add a warning (or even an error) if this happens. This can be a source of bugs if a user is not careful (e.g. https://github.com/galsci/pysm/issues/192) @msyriacMinimal example below: