Skip to the content.

(one page up)

Step-by-step: broad-band radiation spectrum from a parent population of particles

Only a few steps are required to get the radiation spectra from a particle population. A complete working script can be found here (it creates the plots at the bottom of the page).

Step 1: Define a particle spectrum

Create a 2D vector (C++) or list / numpy array (python) representing a particle spectrum. This spectrum has to be differential in energy (1 / erg). For instance, a power-law can be defined like

e = np.logspace(-3,3,200) * gp.TeV_to_erg # energy axis
power_law = norm * e**-alpha # define power law
particles = list(zip(e,power_law)) # input needs to be 2D-array

Note: You have to make sure that the norm of the power-law is right. For example, if you normalise to an energy content E_tot, it should be something like norm = E_tot / np.sum(e[1:]*powerlaw[1:]*np.diff(e)).

Step 2: create a Radiation object and set it up

fr = gp.Radiation() # create the object

Step 3: Define relevant model parameters

b_field = 1e-5 # in Gauss, necessary for Synchrotron calculation
ambient_density = 1 # 1/cm^3, necessary for Bremsstrahlung and hadronic emission
# radiation field parameters, necessary for Inverse-Compton radiation. 
temp = 2.7 # Temperature in K
edens = 0.25 * gp.eV_to_erg # energy density in erg / cm^-3
distance = 1e3 # in pc

Step 4: Set up the Radiation object with these parameters

fr.SetAmbientDensity(ambient_density)
fr.SetBField(b_field)
fr.AddThermalTargetPhotons(t_cmb,edens_cmb)
fr.SetDistance(distance)

Step 5: Set up the particle spectrum

You can decide what kind of particles you put. This will determine which radiation processes will be calculated.

fr.SetProtons(particles) 
fr.SetElectrons(particles) 

Step 6: Calculate the radiation spectra and retrieve them

The differential spectrum is calculated at a specified set of points in energy space. The unit of these points in energy is erg. This set of points is defined by a 1D-vector (C++) or list / numpy array (python), for example:

e = np.logspace(-6,15,bins) * gp.eV_to_erg # has to be in erg!

The radiation spectrum is calculated at these energies via

fr.CalculateDifferentialPhotonSpectrum(e)

Step 7: Get the spectra

There are different formats you can now extract:

The so-retrieved spectra are in the format of 2D-vectors (C++) or 2D-lists (python).

Important Notes

particles

SEDs

More on the emission of hadronic origin

The current version of GAMERA includes the effect of heavier nuclei in the computation of the π⁰- and η-Decay. In this tutorial, it is described how to use the new functionalities.

(one page up)