-
Notifications
You must be signed in to change notification settings - Fork 5
Stomp Installation
This will walk you through the corse grain steps of installing the spherical pixelization library STOMP. The original repository can be found here. It is recommended to use fork associated with the-wizz (https://github.com/morriscb/astro-stomp) which removes the need for some specialized libraries.
To use STOMP for the-wizz we need to compile both the C++ version of the code and the python wrappers. Throughout this process we will assume the user will be locally installing STOMP into a custom directory.
First, download code from https://github.com/morriscb/astro-stomp. In this tutorial we will assume one is using git. In the parent directory of your choice run the command
git clone https://github.com/morriscb/astro-stomp.git astro-stomp
This will create a directory of the source files called astro-stomp. Before we compile the code we need to generate the configuration files and Makefiles required for compilation. This is done with autogen tools. Make sure autogen is installed on your system before attempting this. In the STOMP parent directory run the script
./autogen.sh
This will create the proper configuration and Makefiles. After this we run the commands
./configure --prefix=[directory]
make clean
make
make install
This should create and install libstomp.la check to see that this file was properly created in the stomp subdirectory. If you see a large amount of errors related to s2 do not worry, you do not need this portion of the code and it is in fact highly unstable at the moment [TODO: create a clean branch that doesn't have s2]
Now we need to build the python wrappers for the STOMP library. Make sure you have the python2.7 development packages installed before attempting this. First from the astro-stomp directory we need to move to the python subdirectory
cd python
Now we need to build the swig wrappers for the code
python runswig.py
Several warnings will appear durning this step (lambda) don't worry. Now we need to build and install
python setup.py build
python steup.py install --prefix=[directory]
Check to see that stomp.py was created and try importing it in python or ipython. I usually test this by trying to create a single STOMP pixel and testing its coordinates. In an interactive python session try.
import stomp
pix = stomp.Pixel() #Load the origin STOMP pixel
print(pix.Area(pix)) # print the area of the pixel in deg^2. Should return ~88.14735309704973
print(pix.RA()) # Get the pixel RA should be 289.61721970719054
print(pix.DEC()) # Get the pixel DEC should be 17.454934600660582
We haven't tested the whole code base, but we have just tested the most important parts which are the point and pixel classes. Make sure stomp.py is included in your PYTHONPATH before running the rest of the-wizz.