Chapter 9: Synchrotron light in the cosmos

Below is a set of python codes associated with Chapter 9 of Daniele Pelliccia and David M. Paganin, “Synchrotron Light: A Physics Journey from Laboratory to Cosmos” (Oxford University Press, 2025).

In order to run any of these python codes, you will need to include the following header.

Spectrum of a single particle as a function of the pitch angle

See Fig. 9.6.

Effect of electron energy distribution on synchrotron-emission spectrum

Simulation of a collection of Gaussian spectral lines

See Fig. 9.8.

Spectrum emitted by an ensemble of electrons with power-law distribution of energies

See Fig. 9.9.

Qualitative spectral distribution of the synchrotron light emitted by an ensemble of charged particles

Qualitative synchrotron radiation spectrum, including self-absorption. See Fig. 9.12.

Synchrotron cooling time

See Fig. 9.14.

Synchrotron cooling: numerical calculation of the time-dependent Lorentz factor

See Fig. 9.15.

Synchrotron cooling: comparison of numerical and closed-form solution

See Fig. 9.16.

Fermi model for the acceleration of cosmic rays

See Fig. 9.21. Note: the code implements a Monte Carlo simulation, hence the plot will generally be different from the one reproduced in the figure, depending on the initialisation of the random number generator.

Energy equipartition

See Fig. 9.22.

All-sky radio survey

The data plotted in the all-sky radio survey maps of Figs. 9.32 and 9.33 can be downloaded at the following pages:

The following code generates the maps in Fig. 9.32.

The following code generates the close-up contour maps in Fig. 9.33.

Spectral-index occurrences for shell-type supernova remnants

See Fig. 9.34. The data for these plots have been downloaded from A Catalogue of Galactic Supernova Remnants (Dave Green, Astrophysics Group, Cavendish Laboratory, Cambridge, UK). At the time of writing, we used the “2006 June” version of the catalogue. A newer version, “2024 October” has since been made available.

Torus

See Fig. 9.41. Example adapted from the Example E7.26 of  C. Hill (2020) Learning Scientific Programming with Python (2nd edition), Cambridge University Press, Cambridge.