Healpy depends on the Healpix C++ and cfitsio C libraries. Source code is include with Healpy and you do not have to install them separately.
Healpy uses pkg-config to detect the presence of the Healpix and cfitsio libraries. pkg-config is available on most systems. If you do not have pkg-config installed, then Healpy will download and use (but not install) a Python clone called pykg-config.
If you want to provide your own external builds of Healpix and cfitsio, then download the following packages:
If you are going to install the packages in a nonstandard location (say, –prefix=/path/to/local), then you should set the environment variable PKG_CONFIG_PATH=/path/to/local/lib/pkgconfig when building. No other environment variable settings are necessary, and you do not need to set PKG_CONFIG_PATH to use Healpy after you have built it.
Then, unpack each of the above packages and build them with the usual ‘configure; make; make install’ recipe.
cd healpy
python setup.py build
sudo python setup.py install
If everything goes fine, you can test it:
cd build/lib*
python
>>> import matplotlib.pyplot as plt
>>> import numpy as np
>>> import healpy as H
>>> H.mollview(np.arange(12))
>>> plt.show()
or run the test suite with nose:
nosetests -v
If the plot looks good, you can install:
sudo python setup.py install # install in default location, need root rights
or:
python setup.py install --install-lib=~/Softs/Python # will install healpy in directory ~/Softs/Python, which then must be in your PYTHONPATH
or:
python setup.py install --user # will install it in your User python directory (python >= 2.6)
the best way to install healpy if you plan to develop is to build the C++ extensions in place with:
python setup.py build_ext --inplace
the add the healpy/healpy folder to your PYTHONPATH
When you run “python setup.py”, temporary build products are placed in the “build” directory. If you want to clean out and remove the “build” directory, then run:
python setup.py clean --all