Commit d91cb762 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

more packaging

parent 34138251
prune mr_util
prune libsharp2
include mr_util/threading.cc
#include mr_util/geom_utils.cc
#include mr_util/pointing.cc
include mr_util/string_utils.cc
#include mr_util/space_filling.cc
include libsharp2/sharp.h
include libsharp2/sharp_internal.h
include libsharp2/sharp.cc
include libsharp2/sharp_core.cc
include libsharp2/sharp_core_inc.cc
include libsharp2/sharp_geomhelpers.cc
include libsharp2/sharp_almhelpers.cc
include libsharp2/sharp_geomhelpers.h
include libsharp2/sharp_almhelpers.h
include libsharp2/sharp_ylmgen.cc
include mr_util/fft1d.h
#include mr_util/mav.h
include mr_util/threading.h
include mr_util/math_utils.h
include mr_util/aligned_array.h
#include mr_util/space_filling.h
include mr_util/gl_integrator.h
include mr_util/simd.h
#include mr_util/rangeset.h
include mr_util/cmplx.h
include mr_util/string_utils.h
#include mr_util/geom_utils.h
include mr_util/timers.h
#include mr_util/pointing.h
#include mr_util/vec3.h
include mr_util/constants.h
include mr_util/unity_roots.h
include mr_util/error_handling.h
include mr_util/useful_macros.h
include libsharp2/sharp.h
include libsharp2/sharp_internal.h
include libsharp2/sharp_geomhelpers.h
include libsharp2/sharp_almhelpers.h
include mr_util/threading.cc
include mr_util/string_utils.cc
include libsharp2/sharp.cc
include libsharp2/sharp_core.cc
include libsharp2/sharp_core_inc.cc
include libsharp2/sharp_geomhelpers.cc
include libsharp2/sharp_almhelpers.cc
include libsharp2/sharp_ylmgen.cc
......@@ -34,14 +34,32 @@ else:
def get_extension_modules():
return [Extension('pysharp',
language='c++',
sources=['pysharp.cc','mr_util/threading.cc','mr_util/string_utils.cc',
'libsharp2/sharp.cc', 'libsharp2/sharp_core.cc', 'libsharp2/sharp_geomhelpers.cc',
'libsharp2/sharp_almhelpers.cc','libsharp2/sharp_ylmgen.cc'],
depends=['mr_util/string_utils.h', 'mr_util/fft1d.h', 'mr_util/mav.h', 'mr_util/threading.h',
'mr_util/aligned_array.h', 'mr_util/simd.h',
'mr_util/cmplx.h', 'mr_util/unity_roots.h', 'mr_util/error_handling.h',
sources=['pysharp.cc',
'mr_util/threading.cc',
'mr_util/string_utils.cc',
'libsharp2/sharp.cc',
'libsharp2/sharp_core.cc',
'libsharp2/sharp_geomhelpers.cc',
'libsharp2/sharp_almhelpers.cc',
'libsharp2/sharp_ylmgen.cc'],
depends=['mr_util/fft1d.h',
'mr_util/threading.h',
'mr_util/math_utils.h',
'mr_util/aligned_array.h',
'mr_util/gl_integrator.h',
'mr_util/simd.h',
'mr_util/cmplx.h',
'mr_util/string_utils.h',
'mr_util/timers.h',
'mr_util/constants.h',
'mr_util/unity_roots.h',
'mr_util/error_handling.h',
'mr_util/useful_macros.h',
'libsharp2/sharp.h',
'libsharp2/sharp_internal.h',
'libsharp2/sharp_geomhelpers.h',
'libsharp2/sharp_almhelpers.h'
'setup.py'],
include_dirs=include_dirs,
define_macros=define_macros,
extra_compile_args=extra_compile_args,
......
import pysharp
import numpy as np
import math
import pytest
from numpy.testing import assert_equal, assert_allclose
pmp = pytest.mark.parametrize
@pmp('params', [(511, 511, 512, 1024),
(511, 2, 512, 5),
(511, 0, 512, 1)])
def test_GL(params):
lmax, mmax, nlat, nlon = params
job = pysharp.sharpjob_d()
nalm = ((mmax+1)*(mmax+2))//2 + (mmax+1)*(lmax-mmax)
nalm_r = nalm*2-lmax-1
alm_r = np.random.uniform(-1., 1., nalm_r)
alm = np.empty(nalm, dtype=np.complex128)
alm[0:lmax+1] = alm_r[0:lmax+1]
alm[lmax+1:] = np.sqrt(0.5)*(alm_r[lmax+1::2] + 1j*alm_r[lmax+2::2])
job.set_triangular_alm_info(lmax, mmax)
job.set_Gauss_geometry(nlat, nlon)
alm2 = job.map2alm(job.alm2map(alm))
assert_allclose(alm, alm2)
@pmp('params', [(511, 511, 1024, 1024),
(511, 2, 1024, 5),
(511, 0, 1024, 1)])
def test_ECP(params):
lmax, mmax, nlat, nlon = params
job = pysharp.sharpjob_d()
nalm = ((mmax+1)*(mmax+2))//2 + (mmax+1)*(lmax-mmax)
nalm_r = nalm*2-lmax-1
alm_r = np.random.uniform(-1., 1., nalm_r)
alm = np.empty(nalm, dtype=np.complex128)
alm[0:lmax+1] = alm_r[0:lmax+1]
alm[lmax+1:] = np.sqrt(0.5)*(alm_r[lmax+1::2] + 1j*alm_r[lmax+2::2])
job.set_triangular_alm_info(lmax, mmax)
job.set_ECP_geometry(nlat, nlon)
alm2 = job.map2alm(job.alm2map(alm))
assert_allclose(alm, alm2)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment