How to convert sky map projections?ΒΆ

The following code illustrates how to convert a map in HealPix projection into a map in cartesian projection. Map conversion is performed using the += operator that adds the bilinearly interpolated intensity values from one map to another. The example code applies to any kind of map projections.

C++

1GSkyMap healpix("healpix.fits");
2GSkyMap map("CAR","GAL",0.0,0.0,0.5,0.5,100,100);
3map += healpix;
4map.save("carmap.fits");

Python

1healpix = gammalib.GSkyMap('healpix.fits')
2map = gammalib.GSkyMap('CAR','GAL',0.0,0.0,0.5,0.5,100,100)
3map += healpix
4map.save('carmap.fits')