BlackZiji is a general relativistic ray-tracing and X-ray reflection modeling toolkit. It enables fast simulation of photon trajectories around black holes and supports convolution with reflection models like XILLVER. The codebase includes C++ high-performance backends and Python bindings for easy use.
- Supports both standard Kerr and modified spacetime metrics
- Lamp-post corona geometry with relativistic ray tracing
- Full relativistic X-ray reflection spectrum calculation
- Iron line
git clone https://github.com/ABHModels/black_ziji.git
cd black_zijiThese packages are required to compile the C++ backend, enable OpenMP support, and build the Python C extensions using Cython.
sudo apt update
sudo apt install build-essential cmake libgsl-dev libomp-dev python3-dev python3-pipsudo dnf install gcc gcc-c++ cmake gsl-devel libomp-devel python3-devel python3-pipbrew install gsl libomp gcc cmakeMake sure Python 3 and
pipare installed and accessible. Use a virtual environment (venv) to avoid system-wide changes.
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txtTested with Python 3.8+
astropy>=5.2.2
Cython>=3.0.9
matplotlib>=3.7.5
numpy>=1.24.4
releash>=0.5.1
setuptools>=56.0.0
Run the following from the root of the project:
cmake .
make all
make line_bin
make reb_binAfter building, you can run the main script:
python3 main.pyIf you encounter ModuleNotFoundError, try:
PYTHONPATH=bin python3 main.pyblack_ziji/
├── bin/ # Compiled .so libraries
├── conv_core/ # Spectral convolution, Cython Python bindings
├── data/ # Input/output datasets
├── external/ # xtensor, xtl dependencies
├── main.py # Python main entry point
├── zijiray/ # Core C++ ray tracing engine
├── xillver/ # XILLVER integration
├── CMakeLists.txt # CMake configuration
├── Makefile # Optional Makefile-based build
├── requirements.txt # Python dependencies
└── README.md # You're here!
Missing Python.h during Cython build?
→ Install dev headers:
- Ubuntu/Debian:
sudo apt install python3-dev - CentOS/Fedora:
sudo dnf install python3-devel
Missing libomp?
→ Ubuntu: sudo apt install libomp-dev
→ Fedora: sudo dnf install libomp-devel
Can't import ray_line in Python?
→ Ensure bin/conv/ray_line.so exists and use PYTHONPATH=bin