Night 4:Gamma-ray Speed


Active galactic nuclei

Mkn 421 is a galaxy withi an active nucleus located in Ursa Major. In fact, it’s one of the closest to Earth, only 400 million light years away.

It was one of the first sources that we discovered gamma rays arrived from. It’s also one of the known sources from which gamma rays reach the Earth regularly.

Also, on rare occasions, it emits much more light and, becomes the brightest object in the gamma-ray universe. We’re not talking about just a little more light, but a full order of magnitude more. That’s to say, it becomes 10 times brighter.

At the heart of an active galaxy, matter falling into a supermassive black hole creates jets of particles that travel at almost the speed of light. For active galaxies classified as blazars, one of these jets points almost directly towards Earth. Image Credit: NASA

In the notebook on the right, you can see how we analyse the data. First of all, if there’s a signal in the data collected tonight on Mkn 421. Then, we check the temporal evolution of the signal during the night.

Is there or is there not a flare?

Enter

Leyre’s scientific notebook

Surely after spending a night with Daniel, Alba and Quim, you are already an expert in analysing data and programming with python. I bet you already know how to do a lot of what is in my notebook without my help, too. That said, I hope I can still teach you something new!


To begin with, let’s see if there are any gamma rays in the data we’ve collected. The people from VERITAS were very excited. But it wouldn’t be the first time that a build-up of excitement leads to a disappointment.

You’ve already got the theta plot under control, right?

import pandas as pd
import numpy as np
import matplotlib.pyplot as pl
%matplotlib inline
# We read the files and give them a name
mrk421_ON= pd.read_csv('data/EvtList_ON_Mrk421.txt', sep=' ')
mrk421_OFF= pd.read_csv('data/EvtList_OFF.txt', sep=' ')

# We define the cut variables had_cut and theta_cut
had_cut = 0.20
theta2_cut = 0.40

# We select the data:
mrk421_ON_cut = mrk421_ON[(mrk421_ON['had'] < had_cut) & (mrk421_ON['theta2'] < theta2_cut)]
mrk421_OFF_cut = mrk421_OFF[(mrk421_OFF['had'] < had_cut) & (mrk421_OFF['theta2'] < theta2_cut)]


pl.figure(1, figsize=(10, 5), facecolor='w', edgecolor='k')
Noff, ThetasOff, _ = pl.hist(mrk421_OFF_cut.theta2, bins=40, histtype='stepfilled', color='red', alpha=0.5, normed=False)
Non, ThetasOn, _ = pl.hist(mrk421_ON_cut.theta2, bins=40, histtype='step', color = 'blue',alpha=0.9, normed=False)
pl.xlabel('$\Theta^2$ [$grados^2$]')
pl.ylabel('Numero de Eventos')
pl.show()

png

Correct!!! As Mrk 421 was in flare we didn’t waste time collecting OFF data, but rather we collected as much ON as we could. You never know how long a flare will last. So, we basically spent three straight hours collecting ON data from Mrk 421. Now, of course, ON and OFF events don’t coincide.

Well, this is easy to resolve. What I am really interested in knowing is what the OFF is in the area where there is a signal: Theta Square small values. So I can see by what factor I have to multiply OFF so that it coincides with ON of large Theta Square values (between 0.25 and 0.35, for example). I use this factor to scale the whole OFF and I already have a good estimation of how many ON events are not gamma rays coming from Mrk 421.

eventos_off =  sum(Noff[26:35])
eventos_on = sum(Non[26:35])
factor = eventos_on / eventos_off
print ("We need to scale OFF by a factor:", factor)
('We need to scale OFF by a factor:', 4.7118271695349687)

Now I have the scale factor, do you understand how I got it? Let’s see how I can apply it to all events from the OFF observations.

The easiest way to do this is by using weights …

pl.figure(2, figsize=(10, 5), facecolor='w', edgecolor='k')
# We create a variable 'weights' and we complete it with ones (ones_like) multiplied by
# the factor that we have just found
weights = np.ones_like(mrk421_OFF_cut.theta2)*factor
# Now we just need to add a parameter weights=weights
# to the function we already know: pl.hist
Noff, ThetasOff, _ = pl.hist(mrk421_OFF_cut.theta2, bins=40, histtype='stepfilled', color='red', alpha=0.5, normed=False, weights=weights)
Non, ThetasOn, _ = pl.hist(mrk421_ON_cut.theta2, bins=40, histtype='step', color = 'blue',alpha=0.9, normed=False)
pl.xlabel('$\Theta^2$ [$grados^2$]')
pl.ylabel('Numero de Eventos')
pl.show()

png

Wow! Well yes, it was a flare. I’ve got more gamma rays in three hours (specifically 10,000 seconds) than Daniel, Alba and Quim will ever have!


In fact, with so many gamma rays, we can now see if the amount that we receive changes over time. Because this is actually what flares consist of: the number of gamma rays that reach us from a given direction increases for a certain time.

To do so, the first thing I need is to find the arrival time of each ON event. I will always use the same OFF, which doesn’t change over time.

Our data includes a new column called Tiempo (Time) that tells us when the telescope detects each of the gamma rays.

mrk421_ON_cut.head()
Energiahadtheta2Tiempo
2490.00.1300.3338346.26
31172.00.0060.0039033.70
3285.00.0620.2391300.29
3461.00.1590.2682116.28
543081.00.1960.2047509.42

To use the Tiempo column, you know that for both ON and *OFF you just have to do:

mrk421_ON_cut.Tiempo


Now I want to see how the gamma rays reach us as the seconds go by. Remember, this is a flare, an explosion, so we expect the number of gammas to change quickly over time. But the best thing is seeing it with our own eyes.

The graph we are looking for is called a light curve and it shows us the amount of excesses (ON - OFF) that I have in each time interval.

This is how you can do the calculations and create the graph.

# How to calculate a light curve

# 1 We prepare the data taking into account that the excesses are calculated with:
#    a / After the hadroness cut
#    b / Using the events in the first two bins of the theta plot,
#        which is Theta Square <0.02
#    c / With OFF and ON normalized
had_cut = 0.20
theta2_cut = 0.02
mrk421_ON_cut_LightCurve = mrk421_ON[(mrk421_ON['had'] < had_cut) & (mrk421_ON['theta2'] < theta2_cut)]
mrk421_OFF_cut_LightCurve = mrk421_OFF[(mrk421_OFF['had'] < had_cut) & (mrk421_OFF['theta2'] < theta2_cut)]
weights = np.ones_like(mrk421_OFF_cut_LightCurve.theta2)*factor

# 2 Calculate Non and Noff for each time interval.
# We are going to define 100 intervals (bins) in the 10,000 seconds of our data
bins =100
Non, tiempos= np.histogram(mrk421_ON_cut_LightCurve.Tiempo, bins=bins)
Noff, bins_off= np.histogram(mrk421_OFF_cut_LightCurve.Tiempo, bins=tiempos, weights=weights)

# 3 Calculate the excess and its error for each time interval.

Exceso= Non - Noff
Error= (Non + Noff)**0.5

# 4 Display the light curve: the excesses with their errors over time 
pl.figure(1, figsize=(10, 5), facecolor='w', edgecolor='k')
pl.errorbar(tiempos[1:], Exceso, xerr=10000.0/(2.0*bins), yerr= Error, fmt='or', ecolor='red')
pl.xlabel('Tiempo [s]')
pl.ylabel('Numero de rayos Gammas')
pl.show()

png

Cool! Not only does the number of gamma rays change, but it also does so quickly. When we are lucky enough to observe a flare like this, we can get a lot of information, both about the source itself and the processes that occur within it, as well as about what happens to the gamma rays as they travel from the source to the Earth. What interests me most is this second part!


Note: Unlike the theta plot, in step 4 I don’t want to show how many times something happens in my data. Instead, I want to show one variable (Number of Excesses) depending on another (Time), with its errors. For that I can’t use “pl.hist”. That’s why I use another function that does exactly what I need:

pl.errorbar (VariableEjeX, VariableEjeY)

Also, additional parameters can be given:

Error in the X axis: xerr = ??? Error in Y axis: yerr = ??? Format of the points: fmt = ‘or’, or to have a circle at each point and r to be in red Color to represent the errors: ecolor = ‘red’

That way, we can represent the number of excesses as a function of time, this is what we call a light curve.


Now, we are going to show the data in a different way:

We can see how the gamma rays detected by the telescope’s camera change over the 10,000 seconds that the flare lasts. If you look closely, you can clearly see when the flare occurs in ON, while in OFF everything remains the same. Of course, it coincides with the peaks of the lightcurve. The events are concentrated in the centre of the camera because we are pointing towards Mrk421.

Why are there some detections that are circumferences? The size of an event depicts its energy.

from IPython.display import HTML
HTML("""
<video width="600" height="600" controls="" autoplay="" loop="">
  <source src="data/animation_ONOFF.mp4" type="video/mp4">
</video>
""")

Dictionary of the gamma ray hunter


Active Galactic Nuclei

There's party going on inside!

This type of galaxy (known as AGN) has a compact central core that generates much more radiation than usual. It is believed that this emission is due to the accretion of matter in a supermassive black hole located in the centre. They are the most luminous persistent sources known in the Universe.

Find out more:


Black Hole

We love everything unknown. And a black hole keeps many secrets.

A black hole is a supermassive astronomical object that shows huge gravitational effects so that nothing (neither particles nor electromagnetic radiation) can overcome its event horizon. That is, nothing can escape from within.


Blazar

No, it's not a 'blazer', we aren't going shopping

A blazar is a particular type of active galactic nucleus, characterised by the fact that its jet points directly towards the Earth. In other words, it’s a very compact energy source associated with a black hole in the centre of a galaxy that’s pointing at us.


Cherenkov Radiation

It may sound like the name of a ames Bond villain, but this phenomenon is actually our maximum object of study

Cherenkov radiation is the electromagnetic radiation emitted when a charged particle passes through a dielectric medium at a speed greater than the phase velocity of light in that medium. When a very energetic gamma photon or cosmic ray interacts with the Earth’s atmosphere, a high-speed cascade of particles is produced. The Cherenkov radiation of these charged particles is used to determine the origin and intensity of cosmic or gamma rays.

Find out more:


Cherenkov Telescopes

Our favourite toys!

Cherenkov telescopes are high-energy gamma photon detectors located on the Earth’s surface. They have a mirror to gather light and focus it towards the camera. They detect light produced by the Cherenkov effect from blue to ultraviolet on the electromagnetic spectrum. The images taken by the camera allow us to identify if the particular particle in the atmosphere is a gamma ray and at the same time determine its direction and energy. The MAGIC telescopes at Roque de Los Muchachos (La Palma) are an example.

Find out more:


Cosmic Rays

You need to know how to distinguish between rays, particles and sparks!

Cosmic rays are examples of high-energy radiation composed mainly of highly energetic protons and atomic nuclei. They travel almost at the speed of light and when they hit the Earth’s atmosphere, they produce cascades of particles. These particles generate Cherenkov radiation and some can even reach the surface of the Earth. However, when cosmic rays reach the Earth, it is impossible to know their origin, because their trajectory has changed. This is due to the fact that they have travelled through magnetic fields which force them to change their initial direction.

Find out more:


Dark Matter

What can it be?

How can we define something that is unknown? We know of its existence because we detect it indirectly thanks to the gravitational effects it causes in visible matter, but we can’t study it directly. This is because it doesn’t interact with the electromagnetic force so we don’t know what it is composed of. Here, we are talking about something that represents 25% of everything known! So, it’s better not to discount it, but rather try to shed light on what it is …

Find out more:


Duality Particle Wave

But, what is it?

A duality particle wave is a quantum phenomenon in which particles take on the characteristics of a wave, and vice versa, on certain occasions. Things that we would expect to always act like a wave (for example, light) sometimes behave like a particle. This concept was introduced by Louis-Victor de Broglie and has been experimentally demonstrated.

Find out more:


Event

These really are the events of the year

When we talk about events in this field, we refer to each of the detections we make via telescopes. For each of them, we have information such as the position in the sky, the intensity, and so on. This information allows us to classify them. We are interested in having many events so that we can carry out statistical analysis a posteriori and draw conclusions.


Gamma Ray

Yes, we can!

Gamma rays are extreme-frequency electromagnetic ionizing radiation (above 10 exahertz). They are the most energetic range on the electromagnetic spectrum. The direction from which they reach the Earth indicates where they originate from.

Find out more:


Lorentz Covariance

The privileges of certain equations.

Certain physical equations have this property, by which they don’t change shape when certain coordinates changes are given. The special theory of relativity requires that the laws of physics take the same form in any inertial reference system. That is, if we have two observers whose coordinates can be related by a Lorentz transformation, any equation with covariant magnitudes will be written the same in both cases.

Find out more:


Microquasar

Below you will learn what a quasar is...well a microquasar is the same, but smaller!

A microquasar is a binary star system that produces high-energy electromagnetic radiation. Its characteristics are similar to those of quasars, but on a smaller scale. Microquasars produce strong and variable radio emissions often in the form of jets and have an accretion disk surrounding a compact object (e.g. a black hole or neutron star) that’s very bright in the range of X-rays.

Find out more:


Nebula

What shape do the clouds have?

Nebulae are regions of the interstellar medium composed basically of gases and some chemical elements in the form of cosmic dust. Many stars are born within them due to condensation and accumulation of matter. Sometimes, it’s just the remains of extinct stars.

Find out more:


Particle Shower

The Niagara Falls of particles!

A particle shower results from the interaction between high-energy particles and a dense medium, for example, the Earth’s atmosphere. In turn, each of these secondary particles produced creates a cascade of its own, so that they end up producing a large number of low-energy particles.


Pulsar

Now you see me, now you don't

The word ‘pulsar’ comes from the shortening of pulsating star and it is precisely this, a star from which we get a discontinuous signal. More formally speaking, it’s a neutron star that emits electromagnetic radiation while it’s spinning. The emissions are due to the strong magnetic field they have and the pulse is related to the rotation period of the object and the orientation relative to the Earth. One of the best known and studied is the pulsar of the Crab Nebula, which, by the way, is very beautiful.

Find out more:


Quantum Gravity

A union of 'grave' importance ...

This field of physics aims to unite the quantum field theory, which applies the principles of quantum mechanics to classical systems of continuous fields, and general relativity. We want to define a unified mathematical basis with which all the forces of nature can be described, the Unified Field Theory.

Find out more:


Quasar

A 'quasi' star

Quasars are the furthest and most energetic members of a class of objects called active core galaxies. The name, quasar, comes from ‘quasi-stellar’ or ‘almost stars’. This is because, when they were discovered, using optical instruments, it was very difficult to distinguish them from the stars. However, their emission spectrum was clearly unique. They have usually been formed by the collision of galaxies whose central black holes have merged to form a supermassive black hole or a binary system of black holes.

Find out more:


Supernova Remnant

A candy floss in the cosmos

When a star explodes (supernova) a nebula structure is created around it, formed by the material ejected from the explosion along with interstellar material.

Find out more:


Theory of relativity

In this life, everything is relative...or not!

Albert Einstein was the genius who, with his theories of special and general realtivity, took Newtonian mechanics and made it compatible with electromagnetism. The first theory is applicable to the movement of bodies in the absence of gravitational forces and in the second theory, Newtonian gravity is replaced with more complex formulas. However, for weak fields and small velocities it coincides numerically with classical theory.

Find out more: