Plotting HEALPix map onto mollweide projection with GeoMakie

See also Add an example of how to use Healpix.jl with GeoMakie. by asinghvi17 · Pull Request #246 · MakieOrg/GeoMakie.jl · GitHub, which adds an example of how to use Healpix with GeoMakie.

In that context, an adapted version of your code is:

healpix_map = readMapFromFITS("./haslam408_ds_Remazeilles2014.fits", 1, Float32)
erect, _, _ = equirectangular(healpix_map)


fig = Figure(size=(800, 500))
ax = GeoAxis(fig[1, 1], xticks=-180:30:180; dest="+proj=moll")

ylims!(ax, -90, 90)
xlims!(ax, -180, 180)

meshimage!(ax, -180 .. 180, -90 .. 90, reverse(erect; dims = 1); colorrange = Makie.PlotUtils.zscale(erect), npoints=720)
arc!(ax, (0, -60), 10, -pi, pi; linewidth=5)
arc!(ax, (-150, -60), 10, -pi, pi; linewidth=5)
fig

Changes are:

  • Use equirectangular instead of mollweide as a projection
  • Use npoints=720, since that’s the number of pixels that Healpix’s projection functions return. Using more isn’t really useful, and one can get away with even less (~300) points in meshimage if using GLMakie.
  • Colorrange changed to use zscale (not sure if you want to use this or not)