Commit 9568c54a authored by Martin Reinecke's avatar Martin Reinecke
Browse files

fixes

parent cf97669b
......@@ -35,6 +35,8 @@
#include "libsharp2/sharp.h"
#include "libsharp2/sharp_geomhelpers.h"
#include "libsharp2/sharp_almhelpers.h"
#include "mr_util/string_utils.h"
#include "mr_util/error_handling.h"
using namespace std;
using namespace mr;
......@@ -148,29 +150,7 @@ template<typename T> class py_sharpjob
}
};
a_d_c GL_weights(int64_t nlat, int64_t nlon)
{
a_d_c res(nlat);
auto rr=res.mutable_unchecked<1>();
GL_Integrator integ(nlat);
auto wgt = integ.weights();
for (size_t i=0; i<size_t(rr.shape(0)); ++i)
rr[i]=wgt[i]*twopi/nlon;
return res;
}
a_d_c GL_thetas(int64_t nlat)
{
a_d_c res(nlat);
auto rr=res.mutable_unchecked<1>();
GL_Integrator integ(nlat);
auto coord = integ.coords();
for (size_t i=0; i<size_t(rr.shape(0)); ++i)
rr[i]=acos(-coord[i]);
return res;
}
const char *pyHealpix_DS = R"DELIM(
const char *pysharp_DS = R"DELIM(
Python interface for some of the libsharp functionality
Error conditions are reported by raising exceptions.
......@@ -202,7 +182,4 @@ PYBIND11_MODULE(pysharp, m)
.def("map2alm_spin", &py_sharpjob<double>::map2alm_spin,"map"_a,"spin"_a)
.def("__repr__", &py_sharpjob<double>::repr)
;
m.def("GL_weights",&GL_weights, "nlat"_a, "nlon"_a);
m.def("GL_thetas",&GL_thetas, "nlat"_a);
}
......@@ -26,7 +26,7 @@ if sys.platform == 'darwin':
elif sys.platform == 'win32':
extra_compile_args = ['/Ox', '/EHsc']
else:
extra_compile_args += ['-Wfatal-errors', '-Wfloat-conversion', '-Wsign-conversion', '-Wconversion' ,'-W', '-Wall', '-Wstrict-aliasing=2', '-Wwrite-strings', '-Wredundant-decls', '-Woverloaded-virtual', '-Wcast-qual', '-Wcast-align', '-Wpointer-arith']
extra_compile_args += ['-Wfatal-errors', '-Wfloat-conversion', '-W', '-Wall', '-Wstrict-aliasing=2', '-Wwrite-strings', '-Wredundant-decls', '-Woverloaded-virtual', '-Wcast-qual', '-Wcast-align', '-Wpointer-arith']
python_module_link_args += ['-march=native', '-ffast-math', '-Wl,-rpath,$ORIGIN']
# if you don't want debugging info, add "-s" to python_module_link_args
......@@ -34,10 +34,10 @@ else:
def get_extension_modules():
return [Extension('pysharp',
language='c++',
sources=['pysharp.cc','../mr_util/threading.cc',
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/fft.h', '../mr_util/mav.h', '../mr_util/threading.h',
depends=['../mr_util/string_utils.h', '../mr_util/fft.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',
'setup.py'],
......
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