mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-04 23:31:12 +00:00
Imported latest snapshot of cosmotoolbox
This commit is contained in:
parent
a53a757d5a
commit
e41c26a46c
12 changed files with 1497 additions and 0 deletions
25
external/cosmotool/sample/test_healpix_calls.cpp
vendored
Normal file
25
external/cosmotool/sample/test_healpix_calls.cpp
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
#include <iostream>
|
||||
#include "fourier/healpix.hpp"
|
||||
|
||||
using namespace CosmoTool;
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
HealpixFourierTransform<double> dft(128,2*128,2*128, 40);
|
||||
HealpixUtilityFunction<double> utils;
|
||||
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;
|
||||
cout << "Spectrum analysis" << endl;
|
||||
HealpixUtilityFunction<double>::Spectrum_ptr s = utils.estimateSpectrumFromMap(dft.fourierSpace());
|
||||
|
||||
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