gtracr simulates cosmic ray trajectories through Earth's geomagnetic field and computes geomagnetic rigidity cutoffs (GMRC).
- IGRF-14 magnetic field — full degree-13 spherical harmonic model, plus a fast 3D tabulated lookup (~7x speedup)
- Three solvers — RK4, Boris pusher (~30% faster), and adaptive RK45 (~100x fewer steps for escaping trajectories)
- C++ batch mode — entire GMRC Monte Carlo loop in C++ with std::thread parallelism (~35k trajectories/s)
- Muon transport ("mutracr") — deterministic batch transport of atmospheric muons between production and decay (dE/dX loss, expected-decay deposits, MCS variance; ~800k rays/s on 32 cores) — see docs/mutracr.md
- 10 predefined locations — Kamioka, IceCube, SNOLAB, and more
Pre-built wheels are available for Linux, macOS, and Windows (Python 3.10+):
pip install gtracrRequires a C++14 compiler, meson >= 1.1, and ninja.
git clone https://github.com/mceq-project/gtracr.git
cd gtracr
pip install . --no-build-isolationfrom gtracr.trajectory import Trajectory
traj = Trajectory(
zenith_angle=45., azimuth_angle=0., rigidity=20.,
location_name="Kamioka", bfield_type="igrf",
)
data = traj.get_trajectory(get_data=True)
print(traj.particle_escaped) # True = allowed trajectoryfrom gtracr.geomagnetic_cutoffs import GMRC
gmrc = GMRC(location="Kamioka", iter_num=10000,
bfield_type="table", solver="rk45")
gmrc.evaluate_batch(dt=1e-5, max_time=1.)
az, zen, cutoffs = gmrc.bin_results()See the full documentation for detailed guides on trajectories, cutoff maps, solvers, and architecture.
BSD 3-Clause. See LICENSE for details.