Skip to content

First draft of SHTs in Python wrapper

Martin Reinecke requested to merge pythonsht into master

Created by: dagss

This is a first draft around a Python wrapper that supports MPI. There is a lot of lacking features.

The current testcase splits the alms, but does synthesis to all the nodes; this should be changed so that every node has one ring each, then there is MPI_gather in the end to gather the map for checking at the root node. Also obviously the testcase should compare to healpy or similar, rather than do a visual plot that needs human intervention.

So far only the layout that as built-in (i.e., takes an ms parameter where you can tell it how to split) is the realpacked format described here:

http://commander.readthedocs.org/en/latest/library_guide/sphere.html

I couldn't figure out how to (quickly...) link to MPI when using Python using Python distutils, so the wrapper extension .so is for now built like this:

SHARP_TARGET=your_mpi_config make python/libsharp/libsharp.so

after which you can do

cd python
mpiexec -np 4 nosetests libsharp/tests/test_sht.py

to run the incomplete, manual, test. Since libsharp needs to be built anyway, and thus the make system involved, I think it is probably smarter to keep building the Python extension this way -- we can emit a Wheel package in the build directory which can then be installed by setuptools/pip.

Merge request reports