Skip to content

Commit

Permalink
no healpy option added
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Wallis committed Jul 3, 2017
1 parent 5be40f5 commit e927d94
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 4 deletions.
10 changes: 8 additions & 2 deletions python_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

First you must have the python module of ssht installed (`pyssht`). This can be found at http://astro-informatics.github.io/ssht/.

To install run:
For some of the functions healpy must be installed (https://healpy.readthedocs.io/en/latest/). This is not necessary for all the code so can be skipped if you do not want to use the HEALPix sampling scheme.

python setup.py build_ext --inplace
To install (if you have healpy) run:

`python setup.py build_ext --inplace`

To install (if you do not have healpy) run:

`python setup_no_healpy.py build_ext --inplace`
48 changes: 48 additions & 0 deletions setup_no_healpy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import sys
import os
import shutil

from distutils.core import setup, Extension
from Cython.Distutils import build_ext
from Cython.Build import cythonize

import numpy

# clean previous build
for root, dirs, files in os.walk("./src/python/", topdown=False):
for name in dirs:
if (name == "build"):
shutil.rmtree(name)


include_dirs = [
numpy.get_include(),
]

extra_link_args=[
]

setup(
classifiers=['Programming Language :: Python :: 2.7'],
name = "pyssht",
version = "2.0",
prefix='.',
cmdclass={'build_ext': build_ext},
ext_modules=cythonize([Extension(
"src/python/cy_mass_mapping",
package_dir=['src'],
sources=["src/python/cy_mass_mapping.pyx"],
include_dirs=include_dirs,
libraries=[],#["ssht", "fftw3"],
extra_link_args=extra_link_args,
extra_compile_args=[]
),
Extension("src/python/cy_DES_utils",
package_dir=['src'],
sources=["src/python/cy_DES_utils.pyx"],
include_dirs=include_dirs,
libraries=[],
extra_link_args=extra_link_args,
extra_compile_args=[])
])
)
2 changes: 0 additions & 2 deletions src/python/mass_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
import matplotlib.pyplot as plt
import pyssht as ssht
import cy_mass_mapping as mm
import cy_healpy_mass_mapping as hp_mm
from matplotlib import cm, colors, colorbar, gridspec
import healpy as hp


L = 256
Expand Down

0 comments on commit e927d94

Please sign in to comment.