A simple python module to do cic and calculate FFTPower P(k) and P(k,\mu) based on C++ and pybind11. Now support Doing cic 3D mesh and calculating 1D and 2D PS(Pk and Pkmu) of simulation box.
-
Easy to use. Without some complex objects. Do cic, do fft and compensating and calculate P(k) and P(k,\mu) just need input simple ndarray data. It means you can insert them to your codes easily.
-
Based on C++ and support openmp. Fast and fully use multiple cores with saving memory.
CXX compilers: support c++11 and openmp (Note that you need install "libomp-dev" in Ubuntu or other similar name in other systems first if you want to use clang)
Python: >=3.8
others: pybind11>=1.29.0. Recommend to install it by pip or conda, especially when you want to install my_fft with Method 1.
-
setup.py or pyproject.toml: pip install . or python -m build(Recommend)
-
Makefile: make && pip install .
-
CMake: mkdir build; cd build; cmake ../ -DCMAKE_BUILD_TYPE="Release"; make. And then go back the root direction to do pip install .
-
"pip install ." can check if lib files exist. If they exist, will just install the package without compilation. The compilation use Makefile, so you can modify it by yourself if you meet some errors.
-
For Makefile: it's neccessary to install pybind11 using pip or conda if you don't want to change CXXFLAGS by yourself. For mac user, you may need to deal with the environment of openmp. You can try Makefile_mac instead of default Makefile.
-
For CMake: you need to change the path of cmake files of pybind11 in CMakeLists.txt by yourself. Or you need to delete the path of them if you install pybind11 by cmake or conan with cmake build tools.
You can python test/test.py to see if you install it completely. You will obtain two fftpower files and you can compare them with test/test_power_1D_check.pkl and test_power_2D_check.pkl to see if the result is correct.
You can open test/example.ipynb to see how to use it.
A detailed document will be provided later.
I provide conan file at conanfile.txt