PHYS 291 project - Correlation study of AGILE gamma-ray data and WWLLN lightning data

by Anders Lindanger

Project Description

I will study the correlation between gamma-rays detected from space by the AGILE satellite and lightning detected by the World Wide Lighting Location Network (WWLLN).

I have access to four months of data (March - June 2015) from WWLLN and AGILE. The WWLLN data consist of detected lightning on Earth (time, longitude, latitude). (45 lightning per second so this is a relatively large data set.) The AGILE data is time and energy of photons. The detector is triggered when hit by photons. I also have a file with satellite position (height, longitude, latitude) for each second in 2015.

WWLLN files is a new txt file for each day. I must convert these to .root files for faster computation.

I will reduce both WWLLN file and position file timing by excluding everything but +- some seconds when the AGILE detector is triggered. This will make further analyses more efficient.

The goal is to find Terrestrial Gamma-ray Flashes (TGFs) which is found by a time correspondence of +- 200 microseconds (when you correct for photon time of flight) from the production point of lightning till the photons are detected by a satellite.

I will also superpose all counts, with t0 at the time of lightning, in a histogram. If I count all photons measured by AGILE I hope to find an increased background at t0. If I remove already known TGFs I also hope to see some increased background, if so it indicates that not all TGFs are found in this dataset.

I will also plot (counts, time), (counts, Energy), and a TH2 histogram with both Energy, time and counts.

Code and Data

The source codes are available below and on the code page.

Some data which I used are available here.


This is a study of the correlation between gamma-rays detected from space by the AGILE satellite and lightning detected by the World Wide Lightning Location Network (WWLLN). The data is from 23.03.2015 - 23.06.2015. A description of data and software are found below. At the end, it is shown some histograms and a short conclusion of the analyses.

AGILE data

AGILE is an X-ray and Gamma-ray satellite which belong to the Italian Space Agency. The mini calorimeter (MCAL) is used in this analyses. The MCAL creates data when photons or particles activates a trigger system. The information used here are time and energy of the event. The time is given as seconds since epoch, where the epoch is 1. January 2004 at 00:00:00.

The position of AGILE is found in an own root file which consists of time for each second of the day, latitude and longitude of footprint, and the height of the satellite.

WWLLN data

The lightning data from WWLLN contained time, longitude and latitude of lightning. The timing was given as year, month, day, hour, minute, second, microsecond. This was changed to seconds since AGILEs epoch. The WWLLN data consist of 3.5 GB of ASCII files. This was converted to .root files for faster computations.

Already known TGFs

This is a list of already known TGFs in this time period. The TGFs are found by my supervisor Martino Marisaldi.

What each code does

Create WWLLN tree

This software converts WWLLN files from .loc to .root for faster computations.

Input: WWLLN.loc files from 23.03.2015 until 23.06.2015

Output: WWLLN.root files for each day

Create super tree WWLLN.

This software merges all WWLLN.root files (A20150323.root to A20150623.root) to one large super_WWLLN.root file

Input: A20150323.root to A20150623.root

Output: super_WWLLN.root

Reduce MCAL time and Energy

This software joins MCAL_trigger data to one file, keeps only onboard time and energy (MeV) of photons.

Input: RT040900_3908.root to RT042298_3908.root

Output: MCAL_time_Etot.root

Reduce MCAL

This software reduce MCAL_time_Etot to just keep time each second (int) in MCAL_time_Etot. This gives us a index for each second there is data.

Input: MCAL_time_Etot.root

Output: reduce_RT_MCAL.root

Reduce AGILE position

This software excludes all data in AGILE_position file which is not +- one second around trigger data (MCAL) from AGILE. AGILE_position.root is AGILEs position for every second for about 02.2015 - 11.2015.

Input: reduce_RT_MCAL.root and AGILE_position.root

Output: reduced_AGILE_pos.root

Reduce super WWLLN

Software to find all WWLLN lightning in a radius of 1000 km around the footprint of reduced AGILE trajectory. WWLLN lightning will be stored in one .root file.

Input: reduced_AGILE_pos.root (Position of satellite only at the time MCAL is triggered), super_WWLLN.root (All WWLLN lightning between 23.03-23.06 2015)

Output: reduced_WWLLN.root which is WWLLN lightning inside +- 0.5 second and less than 1000 km away from reduced_AGILE_pos

Create TGF histogram

This software open MCAL_time_Etot.root, reduced_super_WWLLN.root and reduced_AGILE_pos.root. It creates a file called histo_tree.root which is photons inside 0.5 seconds from production point, and a file called photon_WWLLN_match which is photon inside 500 us. These new files will be used later to plot histograms.

Input: MCAL_time_Etot.root, reduced WWLLN.root, reduced_AGILE_pos.root

Output: histo_tree.root, photon_WWLLN_match


The first part of the software excludes all known TGFs from histogram

Input: trg_PAPER_with_simultaneous_WWLLN_TIMING_ANGLES.root, histo_tree.root

Output: histo_tree_without_WWLLN_matches.root

The second part of the software makes plots.

Input: .root you want to plot

Output: The histograms you can see below


The first part includes already known TGFs. The second part is histograms were already known TGFs are taken away.

1. Included known TGFs

Figure 1: Time = 0 is time of lightning. This shows increased counts of photons generated by TGFs, which is created at the time of lightning flashes.

All the lightning data is superimposed with t = 0 at the time of lightning. The increased radiation, detected by AGILE, is clearly visible at the time of lightning. This indicates that the production of TGFs has something to do with lightning.

Figure 2: Energy and time. The color is counts per bin.

There is an increased flux of energetic photons at the time of lightning. In Fig. 2 a hint of the energy spectrum of TGFs are shown at time = 0. There is a significantly increased amount of counts between 0.5 - 12 MeV. However this is not a real spectrum of TGFs. The TGF is believed to have a production height of 15-20 km. The satellite is at 500 km. Therefore, the flux of photons is heavy attenuated when it reaches the detector.

Figure 3: The black line is measurements around +- 500 microseconds around a lightning event, corrected for time of flight of photons. The red line is background radiation.

At the time of lightning/TGF, there are more energetic photons than the background radiation. This gives a hint of the energy spectrum from TGFs.

Figure 4: Background is subtracted from +- 500 usec around lightning.

2. Excluded known TGFs

These plots are generated in the same way as the previous plots but the already known TGFs in this period of time are excluded.

Figure 5: Time = 0 is the time of lightning.

Background radiation is around 200 - 250 counts per bin. Around t = 0 it is a little more than 300 counts per bin. This is perhaps an indication of some missing TGFs in the dataset of known TGFs for this period.

Figure 6: Energy and time. The color is counts per bin.

It is hard to determine if there are more counts around time = 0 than the background.

Figure 7: The black line is measurements around +- 500 microseconds around a lightning event, corrected for time of flight of photons. The red line is background radiation.

Figure 8: Background is subtracted from +- 500 usec around lightning.


The dataset of AGILE from the period 23.03.2015 - 23.06.2015 is analyzed to find a correlation between lightning flashes and TGFs. A correlation is confirmed due to increased counts per bin around lightning events detected by WWLLN.


I would like to thank:

- My supervisor Martino Marisaldi, for guidance and providing the AGILE dataset.

- The World Wide Lightning Location Network.

- Boris Wagner and Ladislav Kocbach, for useful tips and guidance in the computer lab.