Galactic Magnetic Field Calculator

Interactive web tool to evaluate the Galactic magnetic field (GMF) and calculate the deflection of ultra-high-energy cosmic rays via backtracking, using the UF23 model ensemble [1].

x (kpc)
y (kpc)
z (kpc)

Magnetic Field Components

Bx
0.00
μG
By
0.00
μG
Bz
0.00
μG
Sky Map 3D Trajectories
The rigidity slider updates automatically; press Update after changing other parameters.
Initializing...
18 21
Keyboard: ← / → to adjust rigidity
l (°)
b (°)

Backtracking Results

modell (°)b (°)δ (°)
About this tool

This calculator provides an interactive interface to the UF23 model of the coherent Galactic magnetic field (GMF). The model was fit to extragalactic Faraday rotation measures and Galactic synchrotron emission data [1].

Backtracking simulates the propagation of a charged cosmic ray backwards through the Galaxy. Because the equation of motion is time-reversible, sending an anti-particle from Earth into the GMF yields the asymptotic arrival direction the particle would have had in the absence of the field. The deflection δ between observed and true direction is reported for each of the eight UF23 model variants, giving a measure of the systematic uncertainty from the GMF modelling.

The relevant quantity is the magnetic rigidity R = E/(Ze), where E is the particle energy and Z the charge number. At the same rigidity, all particle species follow identical trajectories.

The integration uses an adaptive Boris push with step-size control relative to the local Larmor radius. Default tolerances are suitable for most applications; they can be adjusted under Advanced Settings.

Sky map displays the results in an Aitoff projection of Galactic coordinates. The open marker shows the observed arrival direction; the colored markers indicate the backtracked source direction for each model variant. The spread of the markers illustrates the systematic uncertainty due to the GMF model choice.

Results table lists the backtracked Galactic longitude l and latitude b of the source direction together with the angular deflection δ for each model variant.

The default coordinates and rigidity correspond to the Amaterasu particle, backtracked under the assumption that it is an iron nucleus [2].

3D view shows the cosmic-ray trajectories in Galactocentric Cartesian coordinates. The Sun is located at(x, y, z) = (−8.178, 0, 0) kpc. Tracking stops when the galactocentric distance exceeds the maximum galactocentric distance (set under Advanced Settings). Spiral arms are drawn following the YMW17 electron-density model for orientation.

Animation controls allow playback of the backtracked trajectories in the 3D view. Press ▶ to animate the propagation from the Sun outward (backtracking will run automatically if needed). The ⏸ button pauses and resumes playback, ■ stops and resets to the full static view. Pressing ⏺ before ▶ records the animation as a video file (.webm). The recording can also be armed by engaging ⏺ + ▶ + ⏸ and then releasing ⏸ to start both simultaneously.

Field Calculator returns the three Cartesian components of the coherent GMF at any point in the Galaxy for a selected model variant or the full ensemble.

Model variants. The UF23 ensemble consists of eight model fits that describe the astrophysical data with similar fidelity.

  • base – reference fit with default data and field geometry
  • neCL – uses the NE2001 thermal-electron-density model (Cordes & Lazio) instead of YMW17
  • expX – exponential radial dependence of the X-shaped halo field
  • spur – replaces the logarithmic-spiral disk field with a local spur geometry
  • cre10 – the height of the diffusive Galactic halo is set to 10 kpc (instead of 6 kpc)
  • synCG – synchrotron-emission data taken from CosmoGlobe instead of WMAP/Planck
  • twistX – dynamical creation of the azimuthal magnetic halo from rotational shear of the X-field
  • nebCor – allows for a correlation between thermal-electron density and magnetic-field strength

The spread across the eight variants provides a measure of the systematic modelling uncertainty on any derived quantity such as the deflection angle.

All computation runs locally in the browser – no data is sent to a server. For production-level calculations, a C++ implementation with Python bindings is available.

 
[1] M. Unger & G. R. Farrar, The Coherent Magnetic Field of the Milky Way, Astrophys.J. 970 (2024) 1, 95, arXiv:2311.12120.
[2] M. Unger & G. R. Farrar, Where Did the Amaterasu Particle Come From?, Astrophys.J.Lett. 962 (2024) L5, arXiv:2312.13273.