Skip to content
mceq-projectPublic

About

Geomagnetic Trajectory tracer for Cosmic Rays

Resources

Stars

7 stars

Watchers

2 watching

Forks

Repository files navigation

gtracr

CI

gtracr simulates cosmic ray trajectories through Earth's geomagnetic field and computes geomagnetic rigidity cutoffs (GMRC).

Features

  • 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

Installation

From PyPI (recommended)

Pre-built wheels are available for Linux, macOS, and Windows (Python 3.10+):

pip install gtracr

From source

Requires a C++14 compiler, meson >= 1.1, and ninja.

git clone https://github.com/mceq-project/gtracr.git
cd gtracr
pip install . --no-build-isolation

Quickstart

from 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 trajectory
from 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()

Documentation

See the full documentation for detailed guides on trajectories, cutoff maps, solvers, and architecture.

License

BSD 3-Clause. See LICENSE for details.

About

Geomagnetic Trajectory tracer for Cosmic Rays

Resources

Stars

7 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages