Added a test for the healpix/sharp tranform. Basic code compiles and work.
This commit is contained in:
parent
707a25bda3
commit
352c6b6eb6
4 changed files with 104 additions and 39 deletions
|
@ -49,7 +49,9 @@ if (FFTW3_FOUND AND EIGEN3_FOUND)
|
|||
target_link_libraries(test_fft_calls ${tolink} ${FFTW3_LIBRARIES})
|
||||
endif (FFTW3_FOUND AND EIGEN3_FOUND)
|
||||
|
||||
#if (SHARP_LIBRARY AND SHARP_INCLUDE_PATH AND EIGEN3_FOUND)
|
||||
# add_executable(test_sharp_calls test_sharp_calls.cpp)
|
||||
# target_link_libraries(test_sharp_calls ${tolink} ${SHARP_LIBRARY})
|
||||
#endif (SHARP_LIBRARY AND SHARP_INCLUDE_PATH AND EIGEN3_FOUND)
|
||||
if (SHARP_LIBRARY AND SHARP_INCLUDE_PATH AND EIGEN3_FOUND)
|
||||
include_directories(${SHARP_INCLUDE_PATH})
|
||||
add_executable(test_healpix_calls test_healpix_calls.cpp)
|
||||
target_link_libraries(test_healpix_calls ${tolink} ${SHARP_LIBRARIES})
|
||||
set_target_properties(test_healpix_calls PROPERTIES COMPILE_FLAGS ${OpenMP_CXX_FLAGS} LINK_FLAGS ${OpenMP_CXX_FLAGS})
|
||||
endif (SHARP_LIBRARY AND SHARP_INCLUDE_PATH AND EIGEN3_FOUND)
|
||||
|
|
20
sample/test_healpix_calls.cpp
Normal file
20
sample/test_healpix_calls.cpp
Normal file
|
@ -0,0 +1,20 @@
|
|||
#include <iostream>
|
||||
#include "fourier/healpix.hpp"
|
||||
|
||||
using namespace CosmoTool;
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
HealpixFourierTransform<double> dft(128,3*128,3*128, 40);
|
||||
long Npix = dft.realSpace().size();
|
||||
|
||||
dft.realSpace().eigen().setRandom();
|
||||
dft.analysis();
|
||||
cout << "Map dot-product = " << dft.realSpace().dot_product(dft.realSpace()) << endl;
|
||||
cout << "Fourier dot-product = " << dft.fourierSpace().dot_product(dft.fourierSpace()).real()*Npix/(4*M_PI) << endl;
|
||||
dft.synthesis();
|
||||
cout << "Resynthesis dot-product = " << dft.realSpace().dot_product(dft.realSpace()) << endl;
|
||||
return 0;
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue