LibHealpix

A Julia wrapper of the Healpix library.


Keywords
astronomy, healpix, julia, julia-wrapper, pixelization, sphere, spherical-harmonics
License
GPL-3.0

Documentation

LibHealpix

Build Status Coverage Status License

Healpix is an acronym for Hierarchical Equal Area isoLatitude Pixelization of a sphere. As suggested in the name, this pixelization produces a subdivision of a spherical surface in which each pixel covers the same surface area as every other pixel.

A HealpixMap in Mollweide projection

Getting Started

To get started using LibHealpix, run:

Pkg.add("LibHealpix")
Pkg.test("LibHealpix")
using LibHealpix

The build process will attempt to download and build the Healpix library.

Examples

Creating a Map

using LibHealpix
nside = 16
map = HealpixMap(Float64, nside)
for i = 1:length(map)
    map[i] = i
end

Spherical Harmonic Transforms

using LibHealpix
lmax = mmax = 10
alm = Alm(Complex128, lmax, mmax)
for m = 0:mmax, l = m:lmax
    alm[l,m] = l + m
end
nside = 16
map = alm2map(alm, nside)
blm = map2alm(map, lmax, mmax)

FITS I/O

using LibHealpix
map = readhealpix("map.fits")
writehealpix("othermap.fits", map)

Visualization

using LibHealpix
using PyPlot # for imshow(...)
map = HealpixMap(Float64, nside)
for i = 1:length(map)
    map[i] = rand()
end
img = mollweide(map)
imshow(img)

Development

This package is very much a work in progress. Only a small part of the Healpix library is currently wrapped. Please open issues or pull requests for missing functionality.