Full text
Development of a code for the detection of aircraft producing electric discharges when passing through electrified clouds and study of the observed cases Document: Report Author: Eduard Martín Gascón Director/Co-director: Joan Montañà Puig / Jesús Alberto López Trujillo Degree: Bachelor’s degree in Aerospace Vehicle Engineering Examination session: Spring/2024
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Abstract Based on the first evidences that a Lightning Mapping Array (LMA) is able to detect the formation of electrical discharges produced by the electrostatic induction due to the presence of electrified clouds, this study tries to deepen in the detection of aircraft using the data from the Ebro Lightning Mapping Array (eLMA), first LMA in Europe installed on July 2011 and located at the end of the Ebro River, Catalonia, Spain, with a network of 11 very high frequency (VHF) radio stations. Besides, this work attempts to understand and investigate the influence of weather conditions on sparks formation. For this purpose, a methodology for aircraft source detection has been implemented. First, a manual and visual identification in the eLMA’s website product has been done following the straight line patterns of VHF sources. After this, identified data has been processed and downloaded in order to develop the self-written code with real data in Matlab, which is the next step. Once finished, a verification of the results has been conducted using data from FlightRadar24 such as altitude and positioning. Additionally, an statistical study has been carried out to both verify the effectiveness of the code and to understand the main data obtained. At the end, it has also been analysed weather conditions and its influence on aircraft with radar data from the Servei Meteorològic de Catalunya, focusing specially in atmosphere reflectivity. To sum up, results and their respective conclusions are presented in two different ways. Chiefly, in relation with code detection and its effectiveness. An overview of the performance in the applied cases is given. Later, in the influence of water particles in the formation of sparks around aircraft, which are responsible of the sources emitted. Finally, some tips are given in order to keep developing this project. I
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Resumen Partiendo de las primeras evidencias de que el sistema de mapeo de rayos conocido como Lightning Mapping Array (LMA) es capaz de detectar la formación de descargas eléctricas iniciadas por la inducción electrostática debida a la presencia de nubes electrificadas, este estudio trata de profundizar en la detección de aeronaves utilizando los datos del Ebro Lightning Mapping Array (eLMA), primer LMA de Europa instalado en Julio del 2011 y situado en la desembocadura del río Ebro, Cataluña, España, con una red de 11 estaciones LMA. Además, este trabajo pretende comprender e investigar la influencia de las condiciones meteorológicas en la formación de descargas eléctricas. Para ello, se ha implementado una metodología de detección automática de descargas eléctricas provenientes de aviones. Estas descargas son las emisiones de muy alta frecuencia (VHF) producidas típicamente por rayos, y que se conocen como fuentes o sources en inglés. En primer lugar, se ha realizado una identificación manual y visual en la web del eLMA siguiendo los patrones de línea recta de las fuentes. Una vez reconocidos, se han procesado y descargado los datos identificados para desarrollar un código con datos reales en Matlab, que consiste en el siguiente paso. Una vez finalizado, se ha realizado una verificación de los resultados utilizando diferentes datos en tiempo real del FlightRadar24, como son la altitud y el posicionamiento. Adicionalmente, se ha realizado un estudio estadístico tanto para verificar la efectividad del código como para comprender los principales datos obtenidos. Por último, también se han analizado las condiciones meteorológicas y su influencia sobre las aeronaves con datos radar procedentes del Servei Meteorològic de Catalunya, centrándose especialmente en la reflectividad de la atmósfera. Los resultados y sus respectivas conclusiones se presentan de dos formas. Principalmente, en relación con las detecciones en el código y su eficacia. Se ofrece una visión general del rendimiento en los casos aplicados. Posteriormente, en la influencia de las condiciones meteorológicas derivadas de la información de radar en la formación de descargas eléctricas alrededor de las aeronaves, que son las que inician dichas descargas. Por último, algunos consejos para seguir desarrollando este proyecto en el futuro. II
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Contents Contents III List of Figures VI List of Tables XI 1 Introduction 1 1.1 Aimoftheproject .......................................... 1 1.2 Scopeoftheproject ......................................... 1 1.3 Requirements............................................. 2 1.4 Justification.............................................. 3 2 State of the art 4 2.1 History and evolution of the lightning studies . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.2 Phenomenologyandterminology .................................. 5 2.2.1 Lightninginitiation...................................... 6 2.2.2 Lightningpropagation.................................... 9 2.2.3 Lightningeffects ....................................... 11 2.3 Lightning phenomenology on aircraft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 2.3.1 Lightningstrikes ....................................... 12 2.3.2 Aircraft-triggered lightning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.3.3 Lightning effects in aircraft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.4 Lightning and aircraft sparks detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.4.1 The Lightning Mapping Array (LMA) . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.4.2 Ebro Lightning Mapping Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 2.4.3 Aircraftsparkspattern.................................... 19 2.5 Pattern identification - Machine learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 2.5.1 DBSCAN ........................................... 20 3 Data and methodology 22 3.1 Initialdatavisualization....................................... 23 3.2 Manual research in the eLMA database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 3.3 Dataprocessing............................................ 25 III
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis 3.3.1 Decimatedtime........................................ 27 3.4 Aircraft identification using pre-validated data . . . . . . . . . . . . . . . . . . . . . . . . . . 27 3.4.1 Opendocs(AppendixB.1).................................. 28 3.4.2 Limits(AppendixB.2).................................... 28 3.4.3 Division_interval (Appendix B.3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 3.4.4 Celltour_dbscan (Appendix B.4) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 3.4.5 Idxdivision (Appendix B.5) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 3.4.6 Altitude_filter (Appendix B.6) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 3.4.7 Median_matrix (Appendix B.7) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 3.4.8 Time_dist(AppendixB.8) ................................. 30 3.5 Automatic aircraft identification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 3.5.1 Quantile study of the altitude dispersion . . . . . . . . . . . . . . . . . . . . . . . . . . 32 3.6 Analysis of the aircraft encountering events . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 3.6.1 FlightRadar24 data acquisition and processing . . . . . . . . . . . . . . . . . . . . . . 34 3.6.2 Radar data acquisition and processing . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 4 Results 36 4.1 Aircraftidentification ........................................ 36 4.1.1 Codeimplementation .................................... 36 4.1.2 Code validation with sources from FlightRadar24 . . . . . . . . . . . . . . . . . . . . . 39 4.2 Analysis of method performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 4.3 Aircraft source characterisation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 4.3.1 eLMA............................................. 44 4.3.2 eLMA+Radar........................................ 52 4.3.3 Flight information from eLMA and FlightRadar24 observations . . . . . . . . . . . . . 57 5 Conclusions 61 5.1 Generalconclusions.......................................... 61 5.2 Furtherdevelopments ........................................ 62 References 63 A Algorithms i A.1 Initialdatavisualization....................................... i A.2 Manual algorithm for aircraft detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii A.3 Automatic algorithm for aircraft detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii B Functions vii B.1 Opendocs: function to open documents in the manual entry algorithm . . . . . . . . . . . . . vii B.2 Limits: function to limit the range of the data to make it efficient . . . . . . . . . . . . . . . . viii B.3 Division_interal: function for sorting data into 10-minute interval packets . . . . . . . . . . . ix IV
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis B.4 Celltour_dbscan: function to apply the DBSCAN function on the latitude and longitude . . x B.5 Idxdivision: function to divide submatrices (in subsubmatrices) basing on number assigned in thedbscan............................................... x B.6 Altitude_filter: function to make an evaluation in the altitude and generation of the matrix withbestpoints............................................ xi B.7 Median_matrix: function to generate a median matrix in order to unify data and make an analysiswithfewererror....................................... xiii B.8 Time_dist: function to generate a new matrix with time, speed and number of sources . . . . xiii B.9 Readtiff_dist: function to upload the radar data from Servei Meteorològic de Catalunya . . . xv C Plot functions xviii C.1 Comparison: plot function to see the differences between the pre-processing and the postprocessing...............................................xviii C.2 Fr24: plot function to appreciate both eLMA aircraft detections and FlightRadar24 data . . . xx C.3 General_plot: plot function to see the main data from the post-processing data . . . . . . . . xxiii C.4 Createfigure: plot function to visualize both eLMA aircraft detections and radar data . . . . xxvi D Organization of the .dat documents xxix E List of the observed aircrafts xxx F Case studies xxxiii F.1 Comparativeresults .........................................xxxiii F.2 Casestudies.............................................. lvi F.3 FlightRadar24 comparison......................................lxxx F.4 Radarstudies.............................................lxxxv V
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis List of Figures 2.1 Example of a lightning initiation process. Extracted from [7]. .................. 7 2.2 Simple tripole model. Extracted from [45]............................. 7 2.3 Typical thundercloud charge structure. Extracted from [6].................... 7 2.4 Real thundercloud charge structure. Extracted from [16]. .................... 8 2.5 Real example of the bidirectional theory obtained in [33]. .................... 10 2.6 Cloud-to-cloud lightning flashes formation process. Extracted from [15]. ............ 11 2.7 Natural lightning strike distribution. Extracted from [26]. .................... 13 2.8 Aircraft-triggered lightning process. Extracted from [35]...................... 14 2.9 Saint Elmo’s Fire emerging from the plane’s radome. Extracted from [5]. ........... 15 2.10 Graphical representation of the lightning detection system. Extracted from [27]. ....... 16 2.11 A lightning detection representation example. Captured by the Ebro LMA (see subsection 2.4.2) on 15th September, 2023 between 14:00 and 15:00. Extracted from [27].......... 17 2.12 A charged wind turbine detection representation example. Captured by the Ebro LMA on 16th January, 2012 between 11:20 and 11:30. Extracted from [27]. ............... 18 2.13 An airplane flying near electrified clouds representation example. Captured by the Ebro LMA. Extracted from [27]. ......................................... 18 2.14 Ebro Lightning Mapping Array network distribution. . . . . . . . . . . . . . . . . . . . . . . . 19 2.15 Operating principle of the DBSCAN. Extracted from [14]..................... 21 3.1 Methodologyoftheproject...................................... 22 3.2 Main process of data acquisition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 3.3 Summary flowchart of the code for the manual aircraft identification. . . . . . . . . . . . . . . 28 3.4 Summary flowchart of the code for the automatic aircraft identification. . . . . . . . . . . . . 31 3.5 Whiskers diagram to determine the threshold value of the variability in altitude in aircraft. . 33 3.6 Whiskers diagram to determine the threshold value of the variability in altitude in lightning. 33 3.7 Table of intensity and reflectivity levels extracted from [45].................... 35 4.1 First aircraft identification case: Lightning + aircraft. . . . . . . . . . . . . . . . . . . . . . . 37 4.2 Second aircraft identification case: Lightning + 2 aircraft. . . . . . . . . . . . . . . . . . . . . 38 4.3 Third aircraft identification case: aircraft. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 4.4 All automatic aircraft identification cases. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 4.5 First FlightRadar24 studycase.................................... 40 VI
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis 4.6 Second FlightRadar24 studycase................................... 41 4.7 Third FlightRadar24 studycase. .................................. 41 4.8 First aircraft identification study case: Thunderstorm + aircraft from 4.1. . . . . . . . . . . . 45 4.9 Second aircraft identification study case: Thunderstorm + 2 aircraft from 4.2. . . . . . . . . . 46 4.10 Third aircraft identification study case: aircraft from 4.3. . . . . . . . . . . . . . . . . . . . . 46 4.11 All aircraft identification altitude histogram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 4.12 All aircraft identification power histogram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 4.13 All aircraft identification: altitude vs power graph. . . . . . . . . . . . . . . . . . . . . . . . . 49 4.14 All aircraft identification detection histogram. . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 4.15 All aircraft identification number of sources histogram. . . . . . . . . . . . . . . . . . . . . . . 50 4.16 All aircraft identification speed histogram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 4.17Sourcevsminratiodiagram. .................................... 51 4.18 First radar study case from figure 4.2 identification. . . . . . . . . . . . . . . . . . . . . . . . 53 4.19 Second radar study case from figure 4.5 identification. . . . . . . . . . . . . . . . . . . . . . . 53 4.20 Third radar study case from figure 4.6 identification. . . . . . . . . . . . . . . . . . . . . . . . 54 4.21Fourthradarstudycase........................................ 54 4.22 Third radar study case from figure 4.3 identification. . . . . . . . . . . . . . . . . . . . . . . . 55 4.23 Cirrus cloud image example extracted from [13]. ......................... 55 4.24 Third radar study case from 4.7 identification. . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 4.25 All aircraft identification radar data: distance vs reflectivity. . . . . . . . . . . . . . . . . . . . 57 4.26 Aircraft type classification from observed aircraft with a pie diagram. . . . . . . . . . . . . . . 58 4.27 Flight phase classification from observed aircraft with a pie diagram. . . . . . . . . . . . . . . 59 4.28 Monthly classification from observed aircraft with a pie diagram. . . . . . . . . . . . . . . . . 59 4.29 Histogram of aircraft detection hours during the day for all cases. . . . . . . . . . . . . . . . . 60 D.1 Organisation of information on a .dat example. . . . . . . . . . . . . . . . . . . . . . . . . . . xxix F.1 Aircraft identification graphs on 12 July 2023 at 10:50. . . . . . . . . . . . . . . . . . . . . . .xxxiii F.2 Aircraft identification graphs on 02 September 2023 at 15:00. . . . . . . . . . . . . . . . . . .xxxiv F.3 Aircraft identification graphs on 02 September 2023 at 18:50. . . . . . . . . . . . . . . . . . .xxxiv F.4 Aircraft identification graphs on 02 September 2023 at 22:00. . . . . . . . . . . . . . . . . . .xxxv F.5 Aircraft identification graphs on 03 September 2023 at 04:50. . . . . . . . . . . . . . . . . . .xxxv F.6 Aircraft identification graphs on 03 September 2023 at 05:50. . . . . . . . . . . . . . . . . . .xxxvi F.7 Aircraft identification graphs on 03 September 2023 at 06:00. . . . . . . . . . . . . . . . . . .xxxvi F.8 Aircraft identification graphs on 03 September 2023 at 06:20. . . . . . . . . . . . . . . . . . .xxxvii F.9 Aircraft identification graphs on 12 September 2023 at 13:50. . . . . . . . . . . . . . . . . . .xxxvii F.10 Aircraft identification graphs on 15 September 2023 at 14:10. . . . . . . . . . . . . . . . . . .xxxviii F.11 Aircraft identification graphs on 15 September 2023 at 14:20. . . . . . . . . . . . . . . . . . .xxxviii F.12 Aircraft identification graphs on 16 September 2023 at 18:00. . . . . . . . . . . . . . . . . . .xxxix F.13 Aircraft identification graphs on 20 September 2023 at 05:20. . . . . . . . . . . . . . . . . . .xxxix VII
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis an identification of the aircraft and lighting detection patterns are noted in order to know how their behaviour is. After that, different pattern recognition methodologies are established with the purpose of having a wider reliability for the future results. Once this is thought, a specific Matlab code is developed for each methodology, which is then checked, corrected and validated. It should be noted that manual aircraft identification means that the data have been selected. In other words, the input data is entered manually. When the manual aircraft identification is validated, an automatic aircraft identification is done. This implies the analysis of the previous methodologies and the consequent choice of the best option at first. At second, a new Matlab code is made for the selected methodology. Then, the code is checked, corrected and validated as in the manual aircraft identification. In this case, the input data is intended to enter automatically of a directory where all data is stored. After the implementation of the code, next is to study the situations when electric discharges in airplanes occurs. An analysis of data is conducted for each case in order to find a relation between weather conditions, patterns and type of airplanes. The data corresponds to time, position, altitude, velocity and VHF radio power. At the end, some conclusions are obtained to determine which cloud conditions are favourable to aircraft encountering. 1.3 Requirements The basic specifications and constrains set by both the director and the author are: • End the project before the 19th of June, so the final project presentation can be done during the second and the third week of July. • Use the Matlab software to code in order to ease commands and functions. With this software data can be analyzed, algorithm developed and models created. • Extract all data from the eLMA database so the results are based on real events. This data is provided by the director and his department colleagues, the Lightning Research Group (LRG). • Work on the project from within the university, thus fulfilling the hours established by the curriculum. • Make contact with the director at least once per week in order to follow up the project. This establishes better communication and joint progress on the project. On the other hand, the expected results from the project as it is an study are: • The reliability of the code must be high enough to detect at least 80%of the cases where an aircraft is present. •At least two methodologies must be presented and compared in order to find the aircraft patterns. •At least three different aircraft detection cases must be presented. 2
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis 1.4 Justification The necessity of this project relies on the lack of the analysis of data provided by the eLMA network. Nowadays, most of the studies are made considering almost all data detection, removing noise coming from each station but without differing automatically the element that has produced the emission. This element could be either an aircraft or a lightning event, and both have different patterns and behaviours. In a visual way, it is really simple to distinguish them, but there is not an official implemented code. This is the main reason why this project may be necessary. Besides, aircraft detection is at an early stage in terms of studies, so further research may help to understand deeply why, specially for the Lightning Research Group (LRG) [28]. To end with this section, some advantatges and disadvantatges of the approach may have are presented. In the first place, this project could be very useful in case the required code works. This could provide a tool to differ between aircraft or lightning detection, of which the LRG needs. On the other hand, there could appear code complications, specially in identification commands, like the Machine Learning and Statistic Toolbox from Matlab. At second, although the database has an immense amount of data, the right selection could cause some trouble in order to make an efficient code. The more data that can be analysed at the same time, the greater the accuracy. All of this could make small variations on the original approach. 3
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Chapter 2 State of the art Lightning remains as one of the most mysterious physical phenomena today, especially with regard to its formation and propagation. Many scientists have tried to understand the way a lightning discharge occurs, but none of them have come up with a theoretical model that fully corresponds to reality. However, some hypotheses have been proposed, approaching reality due to their physical experiments. In section 2.1 an overview from the very first experiment is exposed. This enables the understanding of the reason why there is not a definitive and a clear theory today. Nevertheless, section 2.2 presents the most accurate current model and is divided in two subsections. Subsection 2.2.1 corresponds to the lightning initiation, which takes into account the thunderclouds formation that leads to the initial lightning discharge, while subsection 2.2.2 exposes the main different types of lightning propagation: cloud-to-ground and cloud-to-cloud. On the other hand, as the project focuses on aircraft detection producing electric discharges as mentioned in 1.1, section 2.3 introduces the lightning phenomenology on aircraft. First, presenting the lightning strikes in subsection 2.3.1 and then unveiling in subsection 2.3.2 one of the main pillars of the project, the electrical discharges generated by aircraft. At last, subsection 2.3.3 shows some negative effects in order to visualize the impact of lightning. Once presented the lightning phenomena, next section, 2.4, treats the way it is detected and the operation of the radar network called Lightning Mapping Array (LMA). Thus, subsection 2.4.1 presents the LMA itself while subsection 2.1 explores its history, from its beginnings with the Lightning Detection and Ranging (LDAR) from the Kenedy Space Center (KSC) [43] to the present day. At the end of this section, in subsection 2.4.3, aircraft patterns obtained from the LMA data are introduced and commented in order to present the possible drawings (detections) that the developed code (see Appendix A.3) has to cope with. Finally, some important machine learning concepts are given in section 2.5 for a better understanding of the aircraft pattern recognition code, as for instance the Density-Based Spatial Clustering of Applications with Noise (DBSCAN) in subsection 2.5.1. 4
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis 2.1 History and evolution of the lightning studies Although lightning is a phenomena that has happened from the very beginning of the Earth, it was not until 1746 that began to be investigated. First was Benjamin Franklin with his experiments in his electricity laboratory. He started because of the assumed relationship between lightning and the charge separation effect caused by friction between two dissimilar materials. He also took as a reference the creation of the earliest capacitor, called the Leyden jar [12]. This enabled him to create an experiment proving that lightning is electric in 1750 and demonstrated in 1751, allowing him to describe the similarities between lightning and the sparks he was able to see in the experiment. After that, he also proved due to his experiments that the lowest part of a thundercloud is electrically negative. After Franklin’s investigations, nothing emerged until the development of the photography and spectroscopy in the late 1800s. At this time, different photographic techniques were used to capture lightning striking the ground, called strokes. It was also used to detect previous leaders, which consist in low current rails traveling from cloud-to-cloud or cloud-to-ground and precede the lightning events [32]. This observations and experiments were significantly improved in the 1930s with the creation of the double-lens streak camera in 1900. The first to measure an electrical characteristic was Agnes Pockels in 1897 in Germany. She took a a basaltic rock near a lightning strike in order to estimate the current of the lightning by analyzing the residual magnetic field induced. However, Charles Wilson is considered to be the father of the modern era in lightning studies due to its cloud chamber to track high-energy particles [22] in 1911, letting him to have both charge structure in thunderstorm and the individual charge involved in the lightning discharge estimations, according to [16]. From 1911 to 1970, most notable experiments concentrated in the high-speed photographic and current from lightning strikes in instrumented towers measurements. After this time until now, the improvements in sensors, cameras, processing and analysis techniques has reactivated lightning studies in a very noticeable way. Another motivation has been the necessity to protect aircraft, spacecraft and ground installations such as transmission lines. For instance, Transient Luminous Events (TLEs), which are lightning-like phenomena that occur above the storm clouds and in an upward direction taking different colours and shapes [41], were discovered only 20 years ago. Another discovery happened 10 years ago, when both thunderclouds and lightning produce high-energy runaway electrons, X-rays and gamma rays. Both cases according to [16]. 2.2 Phenomenology and terminology In this section an introduction of the lightning phenomenology is made. To do so, it is necessary to divide it into lightning initiation, which focuses on the beginnings of lightning and its formation such as the thunderclouds and the lightning discharge, and lightning propagation, showing how the lightning travel from the starting point to the end one. It should be remembered that although many studies have been carried, the accepted theory is not fully completed as is one of the biggest mysteries in the atmospheric sciences [16]. 5
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis 2.2.1 Lightning initiation In the last years many studies have been carried out in order to find the strength of the electric field inside thunderclouds. However, the main problem occurs when the results are not successful since the measured strength does not fit under any circumstances with the one to make sparks, even with a lower air density and with the presence of water and ice particles which favours the lightning initiation. Thus, the most widely accepted approach is the one explained below. First, lightning initiation corresponds to the process that creates a propagating hot leader channel, which is usually named as initial breakdown or preliminary breakdown. This leader has not the same properties as the one formed in lightning propagation under the cloud, hence their distinction as ’initial’ or ’preliminary’. While studying the lightning initiation, two main concepts need to be understood: the processes carried inside the thundercloud in order to large electric fields so the lightning is started and the processes in an electrical discharges. Another problem with lightning initiation lies in the altitude, which leads to an even greater lack of knowledge of the required electric field, which is supposed to involve the heating of the air caused by the formation of streamers although this statement is not completely valid nowadays. Streamers are responsible of creating leader channels, but it is not always guaranteed that a leader channel form because streamers do not often emit enough temperature to heat the air. In addition, the speed of streamers varies according to the electric fields. For instance, streamers become weaker and slower while the electric field minimally exceeds the critical electric field Es , which is the minimum electric field for a continuous propagation. When the electric field is stronger, streamers become faster and more charge generator at their tips so the channel behind is more conductive and larger. This also causes the branch of the streamers due to the increase in charge at the tips, with the result that heat rises. According to [16], the equivalent electric field at sea level at which branching is enough to heat a leader channel should move between 300-500 kV/m and 3000 kV/m. If this number is enough so that the transition from streamer to leader (both electron density and temperature increase [4]) happen, lightning is also supposed to succeed. An example of this process can be appreciated in figure 2.1, since it could also be given cloud-to-cloud and other combination mentioned later. However, since the problem resides in the small electric field within a cloud that could stop the process, three related hypothesis are raised: •The electric field is much larger in a point within the thundercloud, but has not measured properly. •Lightning begins with hydrometeors, which consist of liquid or ice particles. •The free electrons with enough energy produce lightning initiation. 6
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure 2.1: Example of a lightning initiation process. Extracted from [7]. Thundercloud charge structure A thundercloud, which is responsible for the processes of lightning and thunder, is a type of cloud structured in a tripole model in its simple way. The tripole model has an upper positive, a main negative and a lower positive charge (see figure 2.2). However, the clean air surrounding and contacting the cloud, which has higher conductivity, causes a fourth negatively charged layer to be generated at the top, called the upper screening layer (see figure 2.3). Figure 2.2: Simple tripole model. Extracted from [45] Figure 2.3: Typical thundercloud charge structure. Extracted from [6] 7
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Each layer has its own physical properties. The main negative charge center remains almost always at same temperatures, between -10 and -25ºC, independently of the height of the thundercloud. At this stage, the thundercloud consists of both ice and super-cooled water. The upper positive charge varies according to the season of the year. This region can achieve heights from 8 to 15 Km in summer while only a few in winter. The lower positive charge has its position at the low part of the thundercloud, with temperatures around 0ºC. On the other hand, since the variation of temperatures leads to the motion of the inside particles, there are two more regions: the updraft and the outside updraft. The first one corresponds to the rising hot air which in turn lifts the positive charges while the second is the opposite case. This can be seen in figure 2.4. Figure 2.4: Real thundercloud charge structure. Extracted from [16]. In 1998, Maribeth Stolzenburg conducted an experiment to determine the structure of the storm cloud charges. She used different balloon soundings specialised in mesoscale convection systems (MSCs), which consist of storm clouds bigger than thunderclouds. This kind of clouds usually last large amount of hours and can have two different patterns: round or linear [19]. She found that within the updraft region the typical thundercloud charge structure seen in figure 2.4 (four layer structure) was followed. In addition, she also saw heights matched quite well with the heights mentioned later in the updraft region. However, outside the updraft region the structure was not equally distributed, obtaining up to six different structure changes or or even an inverted structure. This indicates that although the theory holds true, there are situations and cases in which storm clouds can evolve and vary their charge structure. It depends basically on time, location and type of storm, according to [16]. 8
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Lightning initiation locations and discharge As the structure of each thundercloud is not known, it is almost impossible to determine the exact location of the lightning initiation. However, the behaviour of it keeps similar patterns in accordance with Proctor [37], who studied 773 flashes in 13 thunderstorms in South Africa in 1991. [16] From this study, it was concluded that lightning would begin at the edge of the charge region due to the electric fields, which would tend to be larger, or even maximum. This means the same as saying that lightning does not start in the central regions of charge. In addition, it was also discovered that lightning initiation between the two lowest regions, the main negative charge and the lowest positive charge, tend to propagate downward (forming the cloud-to-ground or the cloud-to-cloud flashes commented hereunder in subsection 2.2.2). The upward propagation happens when lightning initiation starts between the upper positive charge and the main negative charge o between the upper negative charge and the upper positive charge. This type of lightning does not usually leave the clouds. [16] On the other hand, the preliminary breakdown is a phenomena related with lightning initiation. This phenomena consists of the initial signals of radio frequency pulses or electric field deflections observed in connection with a lightning flash, according to [38]. In other words, preliminary breakdown shows, as a large bipolar pulses having currents around kA range, the detection of the start of the leader or pre-leader channel in clouds. Once the leader exists, the preliminary breakdown will come to a second stage where the pulses are fewer and smaller. Another type of preliminary breakdown is the one that have narrow bipolar pulses (NBEs). The difference from the first commented lies in the sudden and very fast appearance, being quite mysterious due to the fact that come up from nowhere. Finally, it should be mentioned that many breakdowns can occur, but only one within the clouds leads to lightning. [16] 2.2.2 Lightning propagation Once the lightning initiation has finished, next step corresponds to its propagation. As happened with the initiation, propagation is not physically proven, but a number of theories have been given on the basis of experiments. Then, Schonland and Kasemir theories are currently given as valid although both differ in the way the leader is propagated although the Kasemir’s one is treated as the most correct. [45] The Schonland theory (1938) consisted of the unidirectional or charged leader theory. This theory is based on the charge transportation by the leader from the negative to the positive layer of the thundercloud. This involves a cloud or ground discharge, depending on the layer is produced (see again subsection 2.2.1). However, the Kasemir theory appeared a few years later, in 1950. This theory affirms that the net charge of the leader is zero, since the leader begins in a region of high electric field between opposite charge layers and expands in both directions. This theory is nowadays called as the bidirectional leader theory. [45] This has been proved in many experiments such as the one carried by Joan Montanyà in [33]. Some of the results appear in figure 2.5, where it can be clearly seen that in the first shot the lightning starts and in the following moments it is distributed to opposite sides. Additionally, the negative leader side correspond to the one with the branches while the positive leader side to the unique branch. However, this is not always 9
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis like that since there are different types of flash classified as: cloud-to-ground, cloud-to-cloud, anvil crawlers, cloud-to-air and sprites and jets [45]. Next, both the cloud-to-ground and the cloud-to-cloud are presented because of how common they are. Figure 2.5: Real example of the bidirectional theory obtained in [33]. Cloud-to-ground flashes Cloud-to-ground flashes (CG) correspond to the electrical event in which electricity flows between a thundercloud and the ground surface through a leader channel. They can be classified in different groups depending on the charge and the direction of the flow, so four different scenarios could happen: a negative or positive descending or ground flash. The typical one corresponds to the negative ground flash, which is the one seen before in figure 2.1. First, the stepped leader, which can branch out because of its energy, travels pointing the ground in a stepped manner. When the stepped leader is a few hundred meters above the ground, the electric field in the ground increases, giving an electrical discharge the opportunity to appear due to the sufficiently high electric field of the structures on the ground. In this moment, the streamers (leaders born in the ground with opposite direction than the stepped leader) will try to join the stepped leader. If this is achieved, a returning stroke takes place, meaning that both the thundercloud and the ground are connected by a conducting channel and the positive charge is carried up to the cloud. At this moment, the brilliant blue-white luminous event that everyone knows about occurs. The colour is related to the radiation emitted by the lightning due to the 28.000ºC that can be reached. Hereafter, some CG flashes end although the most common effect that occurs is the repetition of multiple strokes. This begins with a dart leader, which is a type of leader that does not travel in a stepwise manner, moving along the same conductive channel as the previous stepped leader. Then, 10
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis same happens: once the dart leader approaches the ground, a returning stroke could happen multiple times if the conditions are favourable. On the other hand, CG positive flashes are equivalent to less than 5% of the GC events, although their duration and electric field is longer than the CG negative flashes, thus becoming harmful (see section 2.3.3). Cloud-to-cloud flashes Cloud-to-cloud (IC) flashes correspond to the electrical event in which electricity flows between same or different thunderclouds, specially between the upper positive charge and the main negative charge region. According to Proctor and Krehibel in The Lightning Flash [15], there are different stages during the IC process. From figure 2.6, steps ’a’ and ’b’ show the movement of the charges from the main negative charge to the upper positive region. Then, steps ’c’ and ’d’ exhibit an horizontal development in the top of the thundercloud. This happens due to the preliminary breakdown generated at the main negative charge region. After that, step ’e’ and ’e’ display the end part of the process, when the lower part of the thundercloud evolve and a discharge is produced through the conducting channel formed between both the upper and the lower region. Figure 2.6: Cloud-to-cloud lightning flashes formation process. Extracted from [15]. 2.2.3 Lightning effects Lightning is known for being a powerful event in which a lot of energy is implied so it can cause a lot of damage or negative effects. This effects can be divided into two groups: direct and indirect effects. Direct effects correspond to those when lightning directly impacts on living beings or objects. On the other hand, indirect effects are related to those that emerge after a lightning impact in a nearby region. [23] From the direct effects, the most important aspects to be highlighted are: • Visual effect: both sensors and human sight can be affected if close enough to the extremely high brightness from the strike. In the case of sensors, these can be burned out or significantly damaged. In 11
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Apart from lightning, the LMA is also capable of detecting electrostatically charged wind turbines and airplanes flying near electrified clouds (see section 2.3 again). Figures 2.12 and 2.13 represents an example of both cases, respectively. Figure 2.12: A charged wind turbine detection representation example. Captured by the Ebro LMA on 16th January, 2012 between 11:20 and 11:30. Extracted from [27]. Figure 2.13: An airplane flying near electrified clouds representation example. Captured by the Ebro LMA. Extracted from [27]. 18
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis 2.4.2 Ebro Lightning Mapping Array The Ebro Lightning Mapping Array is a LMA network located around the mouth of the Ebro River, or also known as Ebro Delta. It was installed on July 2011 by the UPC Lightning Research Group (LRG), which is a research group specialized in atmospheric electricity from the UPC (Universitat Politècnica de Catalunya) [28]. The eLMA began with only six stations and it was the first LMA network outside the USA, although it currently consists of thirteen stations located at Alfés, Bujaraloz, Raimat, Amposta, Illa de Buda, Els Ports, Els Valentins, Canal Vell, Torres de Alcanadre, Mont Roig, Alguaire, Montsec and Benissanet [27]. Figure 2.14 shows the corresponding locations. Figure 2.14: Ebro Lightning Mapping Array network distribution. 2.4.3 Aircraft sparks pattern In many cases, aircraft does not generate lightning such as in subsection 2.3.2. Instead, the process is not fully realised because of the atmospheric conditions, in particular the insufficient electric field generated. This means that, even if the full lightning strike does not occur, small sparks may appear. This appearance is mostly detected by the LMA, like a flash of lightning. Figure 2.13 shows clearly this event, where the patterns observed do not correspond to those of a typical thunderstorm case such as the one in figure 2.11. The main difference lies in the latitude-longitude and the altitude-time graphs. From the first graph, a continuous and well-defined line is visible during a period of time. Noise can sometimes appear on the sides of the line without changing the pattern, but this can be common due to interference from aircraft and detection systems. From the second graph, a straight line is still visible but with many more alterations in altitude. This is caused by the vertical displacement of the 19
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis sparks and the quasi-formation of the lightning. In both cases, changes in direction and altitude can happen because of the aircraft trajectory. For instance, it is typical to find airplanes descending in the Ebro region due to its upcoming landing at Barcelona airport. Apart from that, it is also important the difference in the time-distance graph comparison between a normal lightning and the aircraft detection, which will be analyzed in this work. 2.5 Pattern identification - Machine learning As this work basically focuses on aircraft identification following a specific pattern with big amount of data, machine learning and statistical techniques must be applied. Machine learning consists on giving computers the capacity to identify patterns and elaborate predictions from algorithms. It is mainly based on statistical distributions and models, and is tightly related with artificial intelligence. However, its effectiveness depends on its training because it is not completely automatic. In other words, the algorithms need to be applied and modified as many times as necessary in order to make it automatic. [42] Machine learning includes the following subcategories: linear regression and logistics, decision trees and random forests, support vector machines, k-means and clustering, neural networks and deep learning, Bayesian and Naive Bayes, ensemble methods, non supervised learning and reinforcement learning. All of them follow similar characteristics but designed for different applications [42]. In this project, k-means and clustering group is used. K-means and clustering group data according to similarity. However, inside this block different methodologies are applied in order to obtain the wanted result, which are the K-means clustering, the hierarchical clustering, the DBSCAN (Density-Based Spatial Clustering of Applications with Noise), the mean shift clustering, the Gaussian mixture model and the agglomerative clustering [42]. All of them could give an accepted answer, but the DBSCAN is the most accurate for the type of data that is taken into account. This methodology is detailed in the following subsection (2.5.1). 2.5.1 DBSCAN The DBSCAN works by differentiating grouped data from noise (isolated points). As the name suggests, is a density-based methodology, which means that groups are made according to proximity and quantity parameters. This two input parameters are called ’epsilon’ and ’minpts’, respectively. So, to form a cluster, a minimum number of points (minpts) must be within a certain range (epsilon) of each other. On the other hand, the DBSCAN returns cluster indices an a vector with all the core points (points inside clusters). Image 3.2 depicts the operating principle. To perform this function, the Statistical and Machine Learning Toolbox from Matlab is used. This function works as it follows: 1. From the input data, the first non labeled observation is chosen as a current point, and then initialized as a cluster ’C’ in 1. 20
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis 2. From epsilon, all points inside the epsilon range (the epsilon neighborhood) are found. (a) In case that the ’minpts’ is not achieved, the current point is labeled as a noisy point. As this happens, next step is number 4. (b) If the previous step does not occur, the current point is labeled as a core point of the cluster ’C’. 3. Once here, the function jumps to the next neighboring point (a new current point) and step 2 is repeated. This until there are no points to include in cluster ’C’. 4. Once the labeling ends, a new unlabeled point is found and taken as the current point. The cluster count increases by 1. 5. Steps 2-4 are repeated until all point are labeled. Figure 2.15: Operating principle of the DBSCAN. Extracted from [14]. 21
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Chapter 3 Data and methodology Following the scope of the project in 1.2 to obtain the aim of the project in 1.1, the methodology corresponds to the one in figure 3.1. Figure 3.1: Methodology of the project. In the first place, an intense study in lightning events and aircraft encountering has been carried out. Same applies to the lightning initiation and propagation. Besides, a deep analysis of the Lightning Mapping Array 22
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis and Machine Learning methodologies has also took place. All this things correspond to the chapter 2, but enables to start section 3.1, which consists on the very initial data visualization and the study of simple cases. The section 3.2 presents a list of all those cases seen in the eLMA website registry. It also shows the dates of study and the reasons. In relation to this section, the one in 3.3 explains the obtaining process of these data, from processing to downloading. In addition, the operational system is detailed from the moment the data arrive until it appears on the eLMA website or in this study. Sections 3.4 and 3.5 consist of the main objective of the work, which is the development of the code to complete the objective. In the first of these, a simple solution is proposed based on entering the data manually and without passing any filter or condition. In the second, an automatic code is implemented in such a way that it only has to be executed, and it works. The details and explanations are presented in these sections. Finally, section 3.6 completes the second goal of this project, which was the study of the weather conditions and the aircraft flight characteristics of each case. To do so, some radar data and flight information given by the the FlightRadar24 (global flight tracking service in real time) and theServei Meteorològic de Catalunya, respectively, are analysed with additional code. 3.1 Initial data visualization The first step taken when starting the project was to verify its feasibility. As one of the requirements was to make all the code with Matlab, it was necessary to check that the data provided by the eLMA was correctly readable. Thus, the code visible in Appendix A.1 was developed. This code starts by manually reading the folder and taking a list of all the .dat files in the folder, which is the storage format. These files are organized in periods of 10 minutes. That is, every 10 minutes a .dat document is generated with fixed and variable information depending on the events detected. The fixed information is located at the header of the document, which contains the main information of the eLMA network, such as the positioning of each radar stations and the detection periods (dates and intervals). Besides, it should be mentioned that the organization is almost equal for each of the .dat documents. On the other hand, the variable information, below the fixed one, corresponds to the main data of each detection. These data are organised in columns, being, respectively: time (UTC seconds per day), latitude (in degrees), longitude (in degrees), altitude (in meters), reduced chi2 (statistical parameter), power (in dBW) and the mask (reference name of each case). So, the number of these data may vary, with 0 in the case where there is no detection. Figure D.1 in Appendix D shows the organisation of the information on a sample .dat file. As this was a first test, this folder corresponded to a case with practically all the events: electrical activity and detection of both one and two aircraft. Specifically, from 15 September 2023 (see figure 2.11). In this way, it could be seen whether the data readout covered all these events. Then, a loop was implemented to go through each of the documents, being 144 as the number of documents to be analyzed. Remember that a day has 144 periods of 10 minutes. From here, all the information of each document was imported, eliminating by means of a new loop all the lines corresponding to the header. The 23
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis importation was done in order that all necessary data from the 144 documents was in a matrix with ’n’ rows and 7 columns (mentioned before). In this subsection, different types of graphs have also been proven in order to plot the information as in subsection 2.4.1. The main ones have been the scatter plot, which is ideal for depicting coordinates, and the geoscatter plot, which is the same as the scatter plot but works with geographic coordinates. In practical terms both plots are the same, only the geoscatter plot gives better information on the positioning of the events. 3.2 Manual research in the eLMA database Once the project was presumably feasible, next step consisted on finding the maximum possible cases in which an electrified aircraft would be detected by the eLMA system. As there was too much data to look at the eLMA database, at this point the only way was to look at the new network of stations. In other words, from the date when the number of stations was increased and, therefore, the system became much more accurate and stable. This corresponded to 15 May 2023. On the other hand, the last day on which the eLMA database would be looked at was 15 February 2024, coinciding with the start of the study. Thus, records are kept for both the warm and cold seasons. The finding carried a lot of time, since the only way to know whether or not the data correspond to those of an aircraft is to look at the graphs on the eLMA website. This process consisted of searching the aircraft pattern (see section 2.4.3) interval by interval from the start date to the last one. This analysis has not only been performed from the longitude-latitude plane, but also those involving altitude and time (see figure 2.11). At the end, go through all the dates and note down the corresponding cases, which have been as follows: Date Time interval 18/06/2023 08:30-08:40 08:40-08:50 12/07/2023 10:50-11:00 02/09/2023 15:00-15:10 18:50-19:00 20:30-20:40 20:40-20:50 22:00-22:10 03/09/2023 04:50-05:00 05:00-05:10 05:50-06:00 06:00-06:10 06:20-06:30 Date Time interval 07:00-07:10 12/09/2023 07:10-07:20 13:50-14:00 15/09/2023 14:10-14:20 14:20-14:30 16/09/2023 18:00-18:10 19/09/2023 18:50-19:00 20/09/2023 05:20-05:30 21/09/2023 19:10-19:20 19:50-20:00 20:50-21:00 16/10/2023 05:40-05:50 06:00-06:10 24
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Date Time interval 06:30-06:40 06:40-06:50 19/10/2023 13:40-13:50 14:10-14:20 14:40-14:50 18:30-18:40 20:10-20:20 22:50-23:00 23/10/2023 22:30-22:40 26/10/2023 10:20-10:30 10:30-10:40 10:40-10:50 29/10/2023 11:10-11:20 31/10/2023 15:00-15:10 15:10-15:20 01/11/2023 12:50-13:00 23:30-23:40 02/11/2023 02:30-02:40 10:50-11:00 16/11/2023 11:20-11:30 27/11/2023 10:20-10:30 Date Time interval 28/11/2023 09:20-09:30 30/11/2023 14:50-15:00 15:00-15:10 01/12/2023 06:20-06:30 08:20-08:30 08:30-08:40 04/12/2023 05:30-05:40 06:20-06:30 17/01/2024 07:40-07:50 07:50-08:00 19/01/2024 14:50-15:00 15:00-15:10 09/02/2024 05:20-05:30 07:00-07:10 07:10-07:20 17:20-17:30 17:30-17:40 19:50-20:00 21:00-21:10 21:10-21:20 15/02/2024 11:10-11:20 Table 3.1: List of the observed cases in the eLMA archive. Apparently, this cases should be the official ones as they come from the eLMA network. However, the eLMA website depicts only those cases in which an enough amount of data is detected in an area. In other words, low density regions could be deleted as they have not enough influence. It seems a way to avoid noisy data. Bearing this in mind, it is possible that some new cases appear in the future solutions of the algorithms. 3.3 Data processing After completing the list with all the visible aircraft detection, the next step was to download all files with processed information related to these events. At first, the process looked simple, since all to do was access the directory where the Lightning Research Group keeps all the data on the records, and then download each of the cases. However, there was no directory with the processed information. Thus, a new task of processing appeared. The eLMA data processing system is visually depicted in figure 3.2. The main elements are the eLMA 25
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis network of stations, the CPD (Data Processing Centre), located in the FIB (Faculty of Computer Science of Barcelona) and belonging to the UPC (Polytechnic University of Catalonia), and the Work Station, which in this case is located in office 0.56 of the TR1 of the ESEIAAT (Terrasa School of Industrial, Aerospace and Audiovisual Engineering ) of the UPC. Both servers are hosted in the CPD but they cannot communicate with each other due to firewall restrictions. Figure 3.2: Main process of data acquisition. Figure 3.2 also shows the flowchart in relation to the transport and use of information, which is described below: 1. The eLMA stations send the data directly to the Data Server. 2. Both the Work Station and the Data Server connect via SSH (Secure Shell), which is a network protocol that allows remote access over encrypted connection. This protocol provides security due to its robustness. 26
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis 3. Both the Work Station and the Data Solver connect via SSH, too. 4. Using the Work Station, the data is copied from the Data Server to the Data Solver via scp-SSH (Secure Copy Protocol - Secure Shell), which is a protocol that ensures the copying of data between two remote computers (in this case the Data Server and the Data Solver). 5. Once the data is copied, next step consists of applying a main solver to obtain the processed data. The main input parameters include date, day and time, seasons, decimated time (see subsection 3.3.1), among others. 6. The solutions are copied to the Work Station. 7. The solutions from the Work Stations are transferred to the Personal Laptop. 3.3.1 Decimated time The decimated time or the decimation in time is the process of breaking a signal into smaller signals for better handling. In case of the eLMA, the signal is captured every 80us, although it can be stored in packs of 160us or 400us. From this packs, the value of the maximum value of the signal is taken. Thus, if the time interval is larger, the efficiency of the signal is reduced as more data is lost. The opposite happens if this time interval is smaller. To test which of the time intervals would best apply to the study, four different cases were firstly downloaded with both the 160us and the 400us format from the list 3.1. These cases were: Date Time interval 15/09/2023 14:10-14:20 14:20-14:30 Date Time interval 17/01/2024 07:40-07:50 07:50-08:00 These cases were then tested in the code described in section 3.1 to check the effectiveness of each decimated time. Thus, logic dictates that for a larger decimated time, the number of data must be smaller. Conversely, for a smaller time interval, the number of data must increase. The question at this stage of the project was to decide which would be the best option. While it is true that the 400us would make the work easier due to the noise reduction and the number of points, the 160us would be the most suitable due to its closer approximation to reality, even knowing the difficulties it could cause. 3.4 Aircraft identification using pre-validated data In this part the code for the aircraft identification using pre-validated has been developed, being the most complex and extensive part of the study. This code is available in the Appendix A.2 and consists of 8 functions that follow a linear structure, which means that any function is cross-linked with another. Each function can be seen in the Appendix B and have been created for a specific task in the code, as well as to 27
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis The results show a clear difference between aircraft and lightning. In figure 3.5 the vertical axis shows values below 100 for most quantiles, while those numbers in figure 3.6 are significantly higher. So, in order to prevent aircraft events from staying in the filter, or lightning events from passing, the condition determined is: for an event to be considered an aircraft, it must have at least two results below 160. This can be seen in line 111 of the input_auto code in the Appendix A.3. 3.6 Analysis of the aircraft encountering events As a complement of the main goal of the project appears the analysis of the aircraft encountering events, which is divided into two parts: the FlightRadar24 and the radar data analysis in subsections 3.6.1 and 3.6.2, respectively. In both cases, the methodology of data collection and processing for subsequent comparison with eLMA data is detailed. 3.6.1 FlightRadar24 data acquisition and processing Taking data from FlightRadar24 has been a rather tedious and manual process. First, the cases where a comparative study between the eLMA and FlightRadar24 data would yield the best conclusions were identified. The criteria for the selection were the number of sources and their distribution (position and altitude). Then, these cases corresponded to the following dates: Date Time interval 16/09/2023 18:00-18:10 21/09/2023 19:10-19:20 21/09/2023 19:50-20:00 16/10/2023 05:40-05:50 06:20-06:30 Date Time interval 19/10/2023 13:40-14:00 14:10-14:20 14:40-14:50 31/10/2023 15:00-15:20 From these, all aircraft were searched in the FlightRadar24 according to their position and direction. Therefore, great care and attention had to be taken not to choose the wrong aircraft. When the selected aircraft seemed to be the right one, the next step was to download the .csv document with all the information of that flight. From here, only the time interval of study was taken for each of the aircraft, including latitude, longitude and altitude. Finally, to observe the data, the fr24 function (see the Appendix C.2) was designed, which basically consists of searching for the FlightRadar24 data in the corresponding folder, loading it and plotting it. To this graph, the eLMA aircraft identification data was also added in order to be able to make the corresponding comparison. 3.6.2 Radar data acquisition and processing The radar data was obtained directly from the Servei Meteorològic de Catalunya, with the following dates being accessible. 34
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Date Time interval 15/09/2023 14:00-15:00 16/09/2023 18:00-19:00 19/09/2023 10:00-11:00 20/09/2023 05:00-06:00 21/09/2023 19:00-21:00 16/10/2023 05:00-07:00 22:00-23:00 19/10/2023 13:00-15:00 Date Time interval 19/10/2023 18:00-19:00 22:00-23:00 23/10/2023 04:00-05:00 22:00-23:00 26/10/2023 10:00-11:00 29/10/2023 11:00-12:00 31/10/2023 15:00-16:00 At each one-hour interval, there are 10 .tiff products, which means that there is a data file every 6 minutes. These .tiff files contain information at 10 different atmospheric levels, starting from 1km to 10km altitude. This is due to the measurement system of the weather radars, where do not take a total initial volume, but rather emits signals at different angles and layers the reflectivity values. Reflectivity measures, in dBZ, the amount of signal reflected from a cloud to the radar after its emission. Therefore, a large amount of water particles act as a barrier and a large part of the signal is returned (high reflectivity). Figure 3.7 shows a table of intensity and reflectivity levels. Figure 3.7: Table of intensity and reflectivity levels extracted from [45]. To process all this data, the read_tiff function (see the Appendix B.9) has been programmed. This function is in charge of opening the .tiff files and assigning to each pixel a coordinate with the reflectivity information in each layer. However, to visualise the total reflectivity range, the maximum value of all the layers in the same pixel is taken. Thus, the position of convective nuclei was obtained independently of altitude, which serve as an analysis to determine the influence of clouds and thunderstorms on aircraft. The next step was to display all this information together with the aircraft identification data from the eLMA. The createfigure function of Appendix C.4 was used for this purpose. Finally, as a complement to the subsequent study, a function was inserted within this function in charge of calculating distances between points. This is used to calculate the distance between the aircraft and the maximum connective core at the shortest distance. In other words, the one that can have the greatest influence on the aircraft. 35
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Chapter 4 Results In this chapter the most relevant results of the project are presented due to the amount of cases that can be studied. These results are divided into three blocks: the verification of the identification of the code, the study of the effectiveness of the code and the detailed analysis of the case studies, which correspond to sections 4.1, 4.2 and 4.3, respectively. Most of the other cases not shown can be found in Appendix F. 4.1 Aircraft identification As detailed in the project’s aim, the main goal was to create an algorithm capable of differentiating between lightning and aircraft detection. This block, therefore, tries to show the results obtained from the work carried out in relation to this main objective. In particular, it presents the validation of the code in subsection 4.1.1, showing first the comparison between pre-processing and post-processing of the most obvious cases, while the second part in subsection 4.1.2 shows the validation with FlightRadar24. 4.1.1 Code implementation In order to see the correct implementation of the code, the next results are presented in such a way that a clear distinction between all the lightning and aircraft detections and the subsequent unique identification of the aircraft can be seen. Thus, on the left side of the next figures the pre-processed data are shown while on the right side the post-processed data are displayed. Within each side, two graphs are shown: one on the top corresponding to the altitude-time graph, and one on the bottom showing the plane made up of latitude and longitude. The first of the cases presented in figure 4.1, corresponding to 3 September 2023 at 06.00am, has always been the clear reference example throughout the project. That is, a case where there is a straight line pattern corresponding to an aircraft, and a core with electrical activity. It is clear how the code is able to eliminate all lightning sources and keep only those that refer to the aircraft. 36
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis In numerical terms, the number of sources goes from 15316 to only 94, all of them corresponding to the aircraft. Despite the proximity of the aircraft to the storm, there are practically no sources out of place on the right side. On the other hand, it can also be seen how it eliminates those sources of noise, i.e. those that are shown as loose dots on the left map. In relation to the aircraft, it can be seen that the start of the descent phase occurs at the exact moment when the aircraft crosses the centre of the eLMA station network, going from 10km altitude to almost 8km. It is here that the usefulness of the quantile study in the subsection 3.5.1 can be appreciated, i.e., how for a large core of electrical activity, where many of the emissions can be mistaken for aircraft, they are filtered out as lightning due to differences in altitude. As a result, only those sources corresponding to aircraft are presented. Figure 4.1: First aircraft identification case: Lightning + aircraft. The second case for 15 September 2023 at 14.10, visible in figure 4.2, shows a similar case to the previous one, except that now two aircraft are visible instead of one. This means that the code also applies well to cases where there is more than one aircraft. The source filtering is correct and, likewise, leaves virtually no source out of place. In this case, the initial 14180 sources are reduced to 1861 aircraft sources. In relation to the airplanes, both are in a clear descent, and there is even a moment when they cross paths. These detection also occur in the central area of the eLMA network of stations. On the other hand, it can be seen that this time the lightning is more distant in time, making it easier to distinguish one from the other, which facilitates the filtering of the sources. It should be noted that these cases are the least frequent of the three types being presented, with only three cases detected out of all those filtered. However, the results of these three are favourable and the aircraft can 37
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis be clearly visible. Figure 4.2: Second aircraft identification case: Lightning + 2 aircraft. The last case encountered, figure 4.3 on 23 October 2023 at 22:30, but one of the most repeated is where there is only one aircraft with some, or no, noise sources. In this case it can be seen that in both sides the result is the same, differing only in the noise sources: in the original case there are some, while after filtering they are eliminated. This time the number of sources has been reduced significantly less than in the two previous cases, from 302 to 277. Furthermore, the same applies to the positioning of sources and the consequent detection. Figure 4.3: Third aircraft identification case: aircraft. 38
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Finally, figure 4.4 shows all the cases obtained plotted one on top of the other. From it, the following aspects can be determined: • First of all, it can be said that the code, at first glance, filters quite efficiently. This is affirmed by the fact that there are hardly any scattered or out-of-place dots, and straight line patterns corresponding to aircraft are clearly visible. • Subsequently, the location of almost all detection is in the same area. An area in the middle of the eLMA network of stations. This indicates the effectiveness of the set of stations in the south-west of Catalonia, very close to the Ebro Delta. • Another aspect that stands out is the parity in many of the detection. Many aircraft follow exactly the same trajectory, thus overlapping each other. This makes a lot of sense, as many of the aircraft detected follow the Spanish airways. • Finally, it should be noted that visually, trajectories that follow a completely straight pattern tend to have longer detection times, and consequently longer distances detected. Figure 4.4: All automatic aircraft identification cases. 4.1.2 Code validation with sources from FlightRadar24 This subsection tries to verify that the data obtained by the eLMA and subsequently filtered by the code are valid. For this purpose, both the post-processed data and the FlightRadar24 data are plotted at the same time. As an important fact, it should be noted that the FlightRadar24 data shows trajectories for the full 10-minute interval. In this way it can be seen how different the data are. For this reason, two figures per case are used, showing a total of 3 reference cases. These figures correspond to the altitude-longitude graph at the 39
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis top and the longitude-latitude map at the bottom, in the same way as in the previous section (see subsection 4.1.1). The first reference case corresponds to 16 October 2023 at 06:20 and is shown in figure 4.5. What can be seen is a great similarity in the trajectories on the longitude-latitude map. The eLMA and FR24 points are superimposed in such a way that no difference is visible to the naked eye. It only exists if the image is zoomed in significantly. On the other hand, there is a difference in altitude between the two, with the eLMA data being on average about 500 metres higher than the FR24 data. To know the direction of the plane, it should also be noted that the dark blue colour of the font corresponds to the first instant while the yellow colour corresponds to the last instant. As an observation, this case has both a descend and a turn, so that in relation to the previous subsection (see subsection 4.1.1) there is not a large number of sources. Figure 4.5: First FlightRadar24 study case. The next figure, 4.6, corresponding to 19 October 2023 at 13:40 is the second example case. Unlike figure 4.5, in this one, the instant of detection of the aircraft by the eLMA occurs when the trajectory is straight and the altitude is constant, hence a higher source density is observed. However, it is true that the same pattern is maintained: in relation to the trajectory between the eLMA and the FR24 is minimal while for the altitude there continues being a difference of about 500 metres. As for the flight, it is a take-off from Barcelona airport but has already reached cruising altitude and is heading for Madrid. 40
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure 4.6: Second FlightRadar24 study case. The last case presented to validate whether the main objective of the code is achieved is the one in figure 4.7, on 31 October 2023 at 15:00. This is the example with the largest number of sources, although it does not follow the same logic as the previous ones. While it is true that the number increases when the trajectory is straight, there is no decrease when the plane is descending. On the other hand, it can be seen that in the longitude-latitude map the difference between the sources with respect to the trajectory of the FR24 is minimal and in the altitude the difference is still around 500 metres. Figure 4.7: Third FlightRadar24 study case. 41
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis From the three cases observed, the most relevant aspects of this section are: • It is not possible to determine an exact pattern in relation to the trajectory and number of sources. However, the detections seen in these cases coincide in position with those in subsection 4.1.1, always located in the central area of the eLMA station network. • The differences between the eLMA and FR24 trajectories are only noticeable in altitude, with a jump of about 500 metres. This is not the case for longitude-latitude, where the difference is minimal. This can have two different explanations: – The first one is that both the eLMA and FR24 have different reference altitudes at 0 metres or the accuracy is different at altitude. So the error comes from the measurement systems directly. – The second one has to do with the Saint Elmo’s Fire phenomenon seen in the subsection 2.3.2. Remember that the corona discharge causes a small, diffuse-ended, vertically upward-pointing lightning flash, as seen in image 2.9. This could explain why the detection is a few hundred metres above the actual trajectory of the aircraft. 4.2 Analysis of method performance When code is developed for a specific purpose, an evaluation is necessary to determine its efficiency. This determines whether the code can be implemented or if, on the contrary, needs new versions and modifications. This is why the evaluation model that has been established is the binary dichotomous model. As the name suggests, it is based on whether the main goal of the code has been carried out correctly (YES) or not (NO). [3] In particular, the contingency table of the predictive method in figure 4.1 is followed. This table relates the first observations to the final predictions that the code has made, or in other words, to the results that the latter has obtained [3]. This relationship determines the evaluation parameters of the predictive methodology, which are: • EA - Effective Alarm: the predicted cases correspond to the observed cases. Both the predictions and the observations are affirmative. • FA - False Alarm: event is predicted even though it was not previously observed. Affirmative prediction, negative observation. • FTW - Failure to Warn: the event is observed although it was not subsequently predicted. Affirmative observation, negative prediction. Observations Yes No Predictions Yes EA FA No FTW - Table 4.1: Reference contingency table of the predictive method. 42
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis From this table, 4.1, the probability of detection and the false alarm rate are obtained, which constitute the two most commonly used statistical parameters for the analysis of the code’s effectiveness. The probability of detection, or POD, shows the ratio of EAs to total events. The false alarm rate, or FAR, relates the predictions that are not taken as true (or which cannot be verified as having happened or not) [3]. Both are described, respectively, in equations 4.1 and 4.2. P OD =EA EA +FTW (4.1) F AR =F A F A +EA (4.2) In this project, the events observed correspond to those identified visually, as shown in table 3.1. Below, two contingency tables of the predictive method are presented, one for the results of the original code (figure 4.2) and the other for the results of the same modified code (figure 4.3). This modification has been made to the conditionals, making them a little more tolerable. That is, by letting more data through than the code would initially do. For example, in the case of the first analysis, the minimum number of VHF sources from the DBSCAN application was established in 20. Then, this value was reduced to 10. First compilation Observations Yes No Predictions Yes 55 11 No 13 - Table 4.2: Contingency table of the predictive method for the first compilation. Second compilation Observations Yes No Predictions Yes 58 17 No 10 - Table 4.3: Contingency table of the predictive method for the second compilation. Thus, it can be seen that for the first compilation the total predicted cases (EA + FA) have been 66, while for the second compilation this value rises to 75. For both, it should be noted that all predictions are aircraft, so that no lightning has been filtered out (all have been filtered correctly). On the other hand, the observations (EA + FTW) in both remain the same with the result of 68. Finally, from tables 4.2 and 4.3 as well as equations 4.1 and 4.2, the statistical table summarising the effectiveness of the code is shown below (figure 4.4). 43
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis In relation to the number of cases, it is important to analyze the number of sources emitted by an aircraft. Figure 4.15 again presents a histogram with this information. The X-axis shows the number of sources, while the Y-axis shows the number of cases. What is analyzed here is that most of the detections present a relatively low number of sources. As a fact, there are 58 cases out of 66 in the first compilation that emit less than 500 sources. Moreover, of these 58 cases, 39 are below 150. This suggests that this could be related to the power and the detection region. That is, if the eLMA had a higher sensitivity to detect lower powers, probably for the same cases the number of sources would be higher. Figure 4.15: All aircraft identification number of sources histogram. Another parameter that best distinguishes an aircraft from lightning is the speed at which it travels. Figure 4.16 shows a histogram of the speeds for the whole set of aircraft. It can be seen that most of the sources correspond to speeds between 180 m/s and 240 m/s, although there is a peak between 260 m/s and 280 m/s. This could indicate that the detections have occurred in conditions of reduced speed, such as a descent, or a cruise about to descend. It could also be related to aircraft type, especially speeds and airframe type. This issue is presented in subsection 4.3.3. Even the reduced speed may have to do with the aircraft’s manoeuvring margins. In other words, if an aircraft has to avoid an electric core in a short space of time, it will be easier if the speed is lower. If it were at a higher speed, the reaction would require more space. However, it is true that at higher speeds, electrical discharges tend to be more likely due to friction between the aircraft body and the air. 50
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure 4.16: All aircraft identification speed histogram. Finally, one of the most remarkable characteristics of the study is the source/min ratio. This ratio gives the number of sources that the aircraft emits/the eLMA receives in a 1-minute interval. Thus, figure 4.17 shows its distribution and evolution for all detections. Below, a few comments are provided. Figure 4.17: Source vs min ratio diagram. 51
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Before commenting on the results, it is important to note that the data have been shown using a logarithmic distribution in order to facilitate the visualisation of the results and to highlight the variations in the source/min ratio. The results predict a behaviour that would not occur to anyone at first, since one tends to think that the pattern will be similar to that of a normal distribution. This is not the case, and the explanation for starting with a very high and decreasing record of sources lies in the fact that the first detections are likely to occur at times of greater proximity to the convective zone. In fact, it could be the case that the Sant Elmo’s Fire occurs at these times, and that is why pilots decide to turn away or change their route. On the other hand, it is true that the pattern becomes irregular from minute 5 onwards. This could have two explanations: the first is the detection of another aircraft, producing an increase in the mean; and the other lies in the approach to a convective zone either intentionally (on an approach, for example) or unintentionally. Here the behaviour is more similar to that of a normal one. In numerical terms, the first two intervals stand out with a ratio of 105 sources/min and 55 sources/min, being the highest of the whole distribution. In the opposite case, it is important to take into account interval 8, with a rate of sources/min that is practically null. Finally, it is worth mentioning that the 4th, 5th and 9th intervals have a similar value, close to 16 sources/min. For more details on the individual cases, although not exactly the source/1min ratio, the first figures in section 4.3.1 show relevant information on the number of sources detected and their distribution. 4.3.2 eLMA + Radar This section presents the most influential radar maps for aircraft detection. This maps are then made up of the reflectivity values on a colour scale and the sources corresponding to the aircraft. The minimum reflectivity value is 12dBZ. This is because below this value, both water droplets and the consequent generation of electric discharges are practically null. Besides, the table showing the value of reflectivity with intensity was figure 3.7. Then, as a reminder, the horizontal axis corresponds to the longitude and the vertical axis to the latitude. The first case study is the same as in figures 4.2 and 4.9. This case shows in figure 4.18 how the two aircraft pass at a small distance with respect to the water particles that are likely to form a storm-core cloud. In fact, the plane on the right crosses for a few moments the area with a detectable reflectivity value. In this case, it is likely that the aircraft and the outer part of the cloud interact in such a way that due to friction, the aircraft become electrically charged. Hence, detection occurs at these times. Another aspect to take into account is the distance from the convective core, which is the area of the cloud where most electrical changes occur. In this case, although there seems to be no great convection, it is true that the cloud is very wide. Therefore, it may be generating an electric field large enough to charge the aircraft. 52
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure 4.18: First radar study case from figure 4.2 identification. The second case is the most curious of all. It corresponds to the case of figure 4.5, where a turn in the aircraft’s trajectory was visible. It turns out that this turn did not occur because the route demanded it, but because of the presence of a convective nucleus with a fairly high reflectivity (around 50dBZ). So, what the pilots of the plane were doing was avoiding this nucleus. Clearly there is no argument here, the detection occurs because the aircraft is electrically charged due to friction with the air and the influence of this nucleus. Figure 4.19: Second radar study case from figure 4.5 identification. 53
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis The third and fourth cases, both on 19 October 2023 but at 13.40 and 22.50 (figures 4.20 and 4.21) respectively, are very similar. In each case, the plane crosses the cloud directly in the middle without modifying its trajectory, reason why both are clearly detected. The one at 13.40 because its destination was Barcelona airport, and the one at 22.50 because the reflectivity values were not high enough to cause damage to the aircraft. However, it is true that the first one is very close to an area of high convectivity (close to 50). Figure 4.20: Third radar study case from figure 4.6 identification. Figure 4.21: Fourth radar study case. 54
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis The case corresponding to the one in figure 4.22 shows the same as the one in figure 4.19. It shows how the pilots take advantage of the space between the clouds to pass. The aircraft makes a turn so that the water spots do not have to be crossed directly, thus avoiding problems of electric discharges. However, it is true that the nucleus of greatest convection is located at a considerable distance from the aircraft, but it could affect the electric field due to its large spatial dimensions. Figure 4.22: Third radar study case from figure 4.3 identification. The last case presented in figure 4.24, on 31 October 2023 at 15:00, is one of the least frequent cases in the radar study. Only the trajectory of the aircraft path is visible, with very few reflectivity spots, being also of very low value. This suggests that not only clouds with high reflectivity and large convective nuclei are electrically charging the aircraft. The hypothesis is therefore the presence of high, thin clouds, known as cirrus clouds. This type of cloud is made up of very fine ice particles due to their high altitude, which can perform the same function as water droplets rubbing against the aircraft. This would explain why there are virtually no radar signals. Below is an image (figure 4.23) of this type of cloud. Figure 4.23: Cirrus cloud image example extracted from [13]. 55
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis In addition, cirrus clouds form from an altitude of 6km up to 12km. In this case, the aircraft flies between 8km and 9km during its detection, so the influence of cirrus clouds could be confirmed. Figure 4.24: Third radar study case from 4.7 identification. In view of the influence of convective nuclei and water particles on aircraft trajectories and their level of detection, a study of all the radar cases examined has been carried out. This consists of the evaluation of the distance from the aircraft to the nearest maximum reflectivity value. Thus, the distances and reflectivity values that induce the detection of the sources coming from the aircraft are shown. The results are presented in figure 4.25. These allow to see how aircraft are often far away from the highest reflectivities, especially those with heavy or extreme intensity levels. However, the most important cases are not those where the reflectivity is high, as the distance is usually also high enough not to influence the aircraft. The most important cases are those where there is considerable reflectivity at a fairly small distance, which causes a change in trajectory or altitude. These cases are quite effective for eLMA detection. As particular cases to highlight, we can appreciate a reflectivity of 36dbZ at only 3km. There are also two cases where the reflectivity is 44dBZ below 20km. And finally, a last case where almost 55dBZ is measured at only 15Km. Respectively, these cases correspond to 23 October 2023 at 22:30, 19 October 2023 at 13:40 and 14:40, and 16 October 2023 at 06:20. In all of them, the radar study showed the aircraft passing through an area with detectable reflectivity values. 56
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure 4.25: All aircraft identification radar data: distance vs reflectivity. 4.3.3 Flight information from eLMA and FlightRadar24 observations When the FlightRadar24 data acquisition process was performed in section 3.6.1, the type and route of the observed aircraft were also noted. All of these are presented in table E.1 in Appendix E. From this, another table (table 4.5) has been created with the most relevant information distributed in columns as follows: type of aircraft, number of times detected (represented by a D), the percentage with respect to the total number of detections, the type of fuselage (represented by FT and divided by Narrow or Wide), and the percentage of the type of fuselage with respect to its division. D % D FT % FT Airbus A319 3 3,85 Narrow 6,12 Airbus A320 16 20,51 Narrow 32,65 Airbus A321 9 11,54 Narrow 18,37 Airbus A350 1 1,28 Wide 3,45 Boeing 737 20 25,64 Narrow 40,82 Boeing 747 3 3,85 Wide 10,34 Boeing 777 1 1,28 Wide 3,45 Boeing 787 24 30,77 Wide 82,76 Embraer 190 1 1,28 Narrow 2,04 78 100 49 29 100 100 Table 4.5: Statistical table with detected aircraft type. 57
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis On the one hand the two (individual) aircraft types that have suffered the most detections are the Boeing 737 and the Boeing 737, which are both of different airframe types. However, both are from the company, Boeing, with the most detections with a total of 48. Another aircraft with a high number of detections is the Airbus A320, closely followed by the A321. It should be noted that both these two and the A319 belong to the same family, so all three have the same narrow fuselage but of different lengths. Therefore, if these three are taken together, they are the group with the most detections with a total of 28. A better visual representation of the data can be seen in figure 4.26. Figure 4.26: Aircraft type classification from observed aircraft with a pie diagram. In terms of direct comparison with the type of fuselage, clearly those with narrow fuselage are more likely to be detected. This group consists of the A320 family aircraft, the Boeing 737 and the Embraer 190, the only aircraft that does not belong to either Airbus or Boeing. Finally, the distribution of wide-body aircraft is interesting, with almost 83% belonging to the Boeing 787. However, of all this group, this is the one with the narrowest fuselage. In fact, the order of fuselage size, from small to large, is as follows: Embraer 190 (3.01m) [17], Boeing 737 (3.76m) [8], A320 family (3.95m) [1], Boeing 787 (5.49m) [11], A350 and B777 (5.96m) [2] [10] and Boeing 747 (6.1m) [9]. This suggests that with this distribution, the fuselages with the highest detections are neither the smallest nor the largest, but those of standard size. Table E.1 in Appendix E and the figure 4.27 also show the different phases of flight for each of the aircraft: climb, cruise and descent. Of these three, the most detected phase was at steady flight level, with a total of 37 detections, while the number for descent was 34. On the other hand, the climb phase was by far the one with the fewest detections, with a total of 7. In percentage terms, detections in cruise mode account for 47%, 58
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis followed by descending with 44% and finally ascending with only 9%. Figure 4.27: Flight phase classification from observed aircraft with a pie diagram. Finally, it is also worth mentioning at which moments the eLMA detections have occurred. Taking into account the seasons of the year, autumn was the month with the highest number of cases with a total of 35, followed closely by summer with 28, and ending with winter and spring, with 13 and 2, respectively. However, this data is not entirely complete since the observations began on 18 June 2023 until 15 February 2024, and in the spring there were hardly any records. The same would be the case if the months of the year were taken as a reference, i.e. from mid-February to mid-June there have been no records. Even so, the monthly percentage of observed cases can be seen in figure 4.28. Figure 4.28: Monthly classification from observed aircraft with a pie diagram. 59
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis [43] Ronald J. Thomas et al. “Accuracy of the Lightning Mapping Array”. In: Journal of Geophysical Research 109 (D14 2004), p. D14207. doi: 10.1029/2004JD004549 .url: https://doi.org/10.1029/ 2004JD004549. [44] M. Urbani. “Development of a VHF broadband interferometer to investigate unsolved lightning phenomena: high-energy radiation from lightning strikes and multi-stroke positive cloud-to-ground flashes”. PhD thesis. UPC, Departament d’Enginyeria Elèctrica, 2022. doi: 10.5821/dissertation-2117-380366 . url:http://hdl.handle.net/2117/380366. [45] Elisabeth Valera Fidalgo. “Study of the conditions of lightning initiation by aircraft”. Access restricted by author’s decision. Trabajo final de grado. Terrassa, Spain: Universitat Politècnica de Catalunya, June 2017. url:http://hdl.handle.net/2117/331508. [46] Emily Wescott et al. “The optical spectrum of aircraft St. Elmo’s fire”. In: Geophysical Research Letters - GEOPHYS RES LETT 23 (Dec. 1996), pp. 3687–3690. doi:10.1029/96GL03621. [47] Charlie Wood. What Is St. Elmo’s Fire? Planet Earth. Reference Article: Facts about St. Elmo’s fire. Nov. 2019. url:https://www.space.com/what-is-st-elmos-fire. [48] Ta-Kang Yeh et al. “Determination of global positioning system (GPS) receiver clock errors: Impact on positioning accuracy”. In: Measurement Science and Technology 20.7 (2009), p. 075105. doi: 10.1088/ 0957-0233/20/7/075105. 66
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Appendix A Algorithms A.1 Initial data visualization 1clc 2clear all 3close all 4 5% Define the path to the directory containing the .dat files 6file = '/Users/edu/Documents/TFG/230915'; 7 8% Get a list of all .dat files in the directory 9arch = dir(fullfile(file,'*.dat')); 10 11 % Initialize variable 12 sz_in = 0; % Initial index for storing data in TotEbroLMA 13 14 % Loop through each .dat file in the directory 15 for i = 1:numel(arch) 16 % Get the full path of the current .dat file 17 filename = fullfile(file, arch(i).name); 18 19 % Import data from the current .dat file 20 EbroLMA = importfile(filename); 21 22 % Initialize an index for the current file's data 23 z = 1; 24 25 % Loop to copy data from EbroLMA to TotEbroLMA 26 for j = sz_in + 1 : sz_in + size(EbroLMA, 1) 27 % Store the current row of EbroLMA into TotEbroLMA 28 TotEbroLMA(j, :) = EbroLMA(z, :); 29 i
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis 30 % Increment the index for EbroLMA 31 z=z+1; 32 33 % Break the loop if we've copied all rows from EbroLMA 34 if z>size(EbroLMA, 1) 35 break 36 end 37 end 38 39 % Update the starting index for the next file's data 40 sz_in = sz_in + size(EbroLMA, 1); 41 end A.2 Manual algorithm for aircraft detection 1clc 2clear all 3close all 4 5%% Input data 6%X means a number from 1 to 9 7day = %%; %0X, 1X, 2X or 3X format 8month = %; %X or 1X format 9year = %%; %2X format 10 hour = %%; %0X, 1X or 2X format 11 min =%%; %Multiples of 10 from 00 to 50 12 min_cappi = %%; %M ltiples of 6 from 00 to 54, to take the one closest to the ... previous one 13 14 % DBSCAN main parameters: determined manually 15 epsilon = 0.1; %Distance between neighbors (detections) 16 minPts = 6; %Number of neighbors inside the epsilon radius 17 18 % Interval time decided in seconds for data partitioning and detailed analysis 19 interval = 10; 20 21 %% Aircraft detection 22 23 %Opening files and sorting in a general matrix 24 [defdata,deffile] = opendocs(day,month,year,hour,min); 25 26 % Data quality control according to the number of sources 27 if length(defdata(:,1))≤20 28 error('Not enough data'); 29 end 30 ii
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis 31 %Discard of the points out of range 32 [defdata] = limits(defdata); 33 34 %Generation of submatrices from time interval 35 submatrices = division_interval(defdata,interval); 36 37 %Tour of each submatrix and dbscan application 38 [celldata,IDX] = celltour_dbscan(submatrices, epsilon, minPts); 39 40 %Division of submatrices (subsubmatrices) based on number assigned in dbscan 41 best_dbscan_data = idxdivision(celldata, IDX); 42 43 %Evaluation based on dispersion in altitude and generation of the matrix with best points 44 [aircraft,all_dispersions,best_alt_disp,all_matrix_order] = altitude_filter(... best_dbscan_data); 45 46 %% Data unification and time distance data generation 47 % Median matrix generation in order to unify data and make fewer errors 48 aircraft_median = median_matrix(all_matrix_order); 49 50 % Time distance data generation 51 [instants] = time_dist(aircraft_median,all_matrix_order); 52 53 % Storage and sorting of detected cases in new cells 54 aircraft_data{cnt} = aircraft; 55 timedistance_data{cnt} = instants; A.3 Automatic algorithm for aircraft detection 1clc 2clear all 3close all 4 5% Saving of the names of the folders 6namefolder_general = fullfile('/Users/edu/Dropbox/Definitive_TFG_Data/Data_eLMA'); 7namefolder = dir(fullfile(namefolder_general)); 8 9% Filtering of the folders and exclusion of . , ... and . D S _ S t o r e 10 isDir = [namefolder.isdir]; 11 namefolder = namefolder(isDir); 12 namefolder = namefolder(¬ismember({namefolder.name}, {'.','..','.DS_Store'})); 13 14 % Initialisation of the detected cases counter 15 cnt = 1; 16 17 % Tour through each of the folders iii
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis 18 for i = 1:length(namefolder) 19 20 % Filtering of the files and exclusion of . , ... and . D S _ S t o r e 21 actual_folder = namefolder(i).name; 22 namedocs = dir(fullfile(namefolder_general, actual_folder)); 23 namedocs = namedocs(¬ismember({namedocs.name}, {'.','..','.DS_Store'})); 24 namedocs = {namedocs.name}; 25 26 %Tour through each of the files 27 for j = 1:length(namedocs) 28 29 % Openning file process to obtain the global matrix with all data 30 % from each file 31 route_docs = fullfile(fullfile(namefolder_general, actual_folder), namedocs{j}); 32 read_data = false; 33 34 fid = fopen(route_docs, 'r'); 35 if fid == −1 36 warning(['Document not available: ', route_docs]); 37 continue; 38 end 39 40 linesheader = 0; %Header elimination process 41 42 while true 43 lines = fgetl(fid); 44 if lines == −1 45 fclose(fid); 46 break; 47 end 48 if ischar(lines) 49 lines = strtrim(lines); 50 end 51 if isempty(lines) || ¬isstrprop(lines(1), 'digit') 52 linesheader = linesheader + 1; 53 else 54 fseek(fid, −length(lines)−1, 'cof'); 55 break; 56 end 57 end 58 59 if lines == −1 60 continue; 61 else 62 data = fscanf(fid, '%f', [7, Inf]); 63 fclose(fid); 64 defdata = transpose(data); 65 end 66 iv
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis 67 % Data quality control according to the number of sources 68 if length(defdata(:,1))≤20 69 disp('Not enough data'); 70 continue; 71 end 72 73 % Data quality control according to position and range 74 [defdata] = limits(defdata); 75 76 % Interval time decided in seconds for data partitioning and detailed analysis 77 interval = 10; 78 79 %Generation of submatrices from time interval 80 submatrices = division_interval(defdata,interval); 81 82 % DBSCAN main parameters: determined manually 83 epsilon = 0.1; % Distance between neighbors (detections) 84 minPts = 6; % Number of neighbors inside the epsilon radius 85 86 % Tour of each submatrix and dbscan application 87 [celldata,IDX] = celltour_dbscan(submatrices, epsilon, minPts); 88 89 % Division of submatrices (subsubmatrices) based on number assigned in dbscan 90 best_dbscan_data = idxdivision(celldata, IDX); 91 92 % Evaluation based on dispersion in altitude and generation of the matrix with best... points 93 [aircraft,all_dispersions,best_alt_disp,all_matrix_order] = altitude_filter(... best_dbscan_data); 94 95 % Data quality control according to the number of sources 96 if length(aircraft(:,1))≥20 97 98 % Quantil study of the altitude to discart unwanted data 99 % comming from lightning. Based on the altitude difference and 100 % the remoteness of the mean 101 Q2 = quantile(aircraft(:,5),[0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.99]); 102 subst = Q2(2:end)−Q2(1:end−1); 103 half_subst = (length(subst)−1)/2; 104 105 for z=1:half_subst 106 A = [subst(z),subst(z+half_subst)]; 107 prom(z) = mean(A); 108 end 109 110 % Filtered according to studies in quartiles 111 if sum(prom < 160) ≥2 112 113 % Median matrix generation in order to unify data and make fewer errors v
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis 114 aircraft_median = median_matrix(all_matrix_order); 115 116 % Data quality control according to the number of sources 117 if length(aircraft_median(:,1))≥4 118 119 % Time distance data generation 120 [instants] = time_dist(aircraft_median,all_matrix_order); 121 122 % Data quality control according to the number of sources 123 if (sum(¬isnan(instants(:,2)))≥3) 124 125 % Storage and sorting of detected cases in new cells 126 aircraft_data{cnt} = aircraft; 127 route_data{cnt} = route_docs; 128 timedistance_data{cnt} = instants; 129 130 % Increasing the counter by 1 for each new case 131 cnt = cnt+1; 132 133 % For all other cases where there is no detection, skip straight to the... next case. 134 else 135 disp('Unidentified aircraft'); 136 end 137 else 138 disp('Unidentified aircraft'); 139 end 140 else 141 disp('Unidentified aircraft'); 142 end 143 end 144 end 145 end vi
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Appendix B Functions B.1 Opendocs: function to open documents in the manual entry algorithm 1function [defdata,deffile] = opendocs(day,month,year,hour,min) 2 3% Transformation of the numbers into strings 4day_str = sprintf('%02d', day); 5month_str = sprintf('%02d', month); 6year_str = sprintf('%02d', year); 7hour_str = sprintf('%02d', hour); 8min_str = sprintf('%02d',min); 9 10 % Saving of the names of the folders and files 11 namefolder = fullfile('/Users/edu/Dropbox/Definitive_TFG_Data/Data_eLMA', [year_str ... month_str day_str]); 12 namefiles = dir(fullfile(namefolder,'*.dat')); 13 14 % Openning file process to obtain the global matrix with all data 15 % from each file 16 for i=1:numel(namefiles) 17 if namefiles(i).name == ['EbroLMA_' year_str month_str day_str '_' hour_str min_str... '00_0600.dat'] 18 deffile = fullfile(namefolder,namefiles(i).name); 19 else 20 continue; 21 end 22 end 23 24 fid = fopen(deffile,'r'); 25 linesheader = 0; %Header elimination process vii
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis 26 while true 27 lines = fgetl(fid); 28 if isempty(lines) || ¬isstrprop(lines(1), 'digit') 29 linesheader = linesheader + 1; 30 else 31 fseek(fid, −length(lines)−1, 'cof'); 32 break; 33 end 34 end 35 data = fscanf(fid,'%f',[7,Inf]); 36 fclose(fid); 37 defdata = transpose(data); 38 39 end B.2 Limits: function to limit the range of the data to make it efficient 1function [defdata] = limits(defdata) 2% Get the number of rows and columns in defdata 3[n_rows, n_cols] = size(defdata); 4 5% Create a new column with row indices 6new_col = (1:n_rows)'; 7 8% Insert the new column at the beginning of defdata and remove the last column 9defdata = [new_col, defdata(:, 1:n_cols−1)]; 10 11 % Initialize an empty array to store indices of rows to be deleted 12 index_del = []; 13 14 % Iterate over each row in defdata 15 for i=1:length(defdata(:,1)) 16 17 % Positioning limits according to latitude, longitude and altitude 18 % Latitude: Accepted values from 40.30 to 42 deg 19 % Longitude: Accepted values from −0.5 to 2.5 deg 20 % Altitude: Accepted values from 0 to 13.5Km 21 if defdata(i,3)≤40.30 || defdata(i,3)≥42 || defdata(i,4)≤−0.5 || defdata(i,4)≥2.5 ... || defdata(i,5)≥13500 22 23 % Add the index of the row to the list of indices to delete 24 index_del = [index_del,i]; 25 else 26 continue % Continue to the next iteration if conditions are not met viii
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis 27 end 28 end 29 30 % Delete the rows from defdata that meet the deletion criteria 31 defdata(index_del, :) = []; 32 end B.3 Division_interal: function for sorting data into 10-minute interval packets 1function cells = division_interval(aircraft, interval) 2 3% Initialize variables to track the number of rows, processed rows, and the cell array ... for groups. 4num_rows = size(aircraft, 1); 5cells = {}; 6processed_rows = false(1, num_rows); 7 8% Iterate through each row of the aircraft matrix to form groups. 9for i = 1:num_rows 10 % Skip rows that have already been processed. 11 if processed_rows(i) 12 continue; 13 end 14 15 % Start a new group with the current row and mark it as processed. 16 pack = aircraft(i,:); 17 processed_rows(i) = true; 18 19 % Compare the current row with subsequent rows to form a group based on the time ... interval. 20 for j = i+1:num_rows 21 % Skip rows that have already been processed. 22 if processed_rows(j) 23 continue; 24 end 25 26 % Calculate the time difference between the current row and the subsequent row. 27 difference = abs(aircraft(j,2) − aircraft(i,2)); 28 29 % If the time difference exceeds the interval, save the current group and break... the loop. 30 if difference > interval 31 cells{end+1,1} = pack'; 32 processed_rows(i:j−1) = true; ix
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis 19 else 20 continue; 21 end 22 end 23 24 % Read the GeoTIFF file 25 [A, REFMAT, BBOX] = geotiffread(cappi_file); 26 27 % Flip the matrix vertically 28 A = flipdim(A, 1); 29 30 % Get the GeoTIFF file information 31 info = geotiffinfo(cappi_file); 32 info.RefMatrix; 33 [x, y] = pix2map(info.RefMatrix, 1, 1); 34 35 % Convert bounding box coordinates to latitude and longitude 36 [lat1, lon1] = projinv(info, BBOX(1, 1), BBOX(1, 2)); 37 [lat2, lon2] = projinv(info, BBOX(2, 1), BBOX(2, 2)); 38 39 % Get the dimensions of the matrix A 40 dims = size(A); 41 M = dims(1); 42 N = dims(2); 43 44 % Calculate the increment in longitude and latitude 45 ∆_x = (lon2 − lon1) / N; 46 ∆_y = (lat2 − lat1) / M; 47 48 % Create coordinate arrays for x and y 49 coords_x = lon1:∆_x:lon2; 50 coords_y = lat1:∆_y:lat2; 51 52 % Create a meshgrid for the coordinates 53 [X, Y] = meshgrid(lon1:∆_x:lon2−∆_x, lat1:∆_y:lat2−∆_y); 54 55 % Adjust the coordinates to the center of the pixels 56 coords_x = coords_x(1:end−1) + ∆_x / 2; 57 coords_y = coords_y(1:end−1) + ∆_y / 2; 58 59 % Initialize a matrix B with NaN values 60 f=size(A, 1); 61 c=size(A, 2); 62 B(1:f, 1:c) = NaN; 63 64 % Find the maximum value along the third dimension of A 65 for i = 1:1:f 66 for j = 1:1:c 67 B(i, j) = max(A(i, j, :)); xvi
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis 68 end 69 end 70 71 % Replace −9999 values with NaN 72 B(B == −9999) = NaN; 73 74 % Create the figure 75 createfigure(B, month, day, year, hour, min, aircraft); 76 77 % Draw a line and add a listener for when the line is moved 78 h = drawline; 79 addlistener(h, 'ROIMoved', @(src, evt) continueExecution(src)); 80 81 % Function to continue execution after the line is moved 82 function continueExecution(h) 83 % Get the position of the line 84 pos = h.Position; 85 % Calculate the distance between the two points of the line 86 dist_air_thc = deg2km(distance(pos(1, 2), pos(1, 1), pos(2, 2), pos(2, 1))); 87 % Display the calculated distance 88 disp(['Distance: ',num2str(dist_air_thc), ' km']); 89 end 90 91 end xvii
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Appendix C Plot functions C.1 Comparison: plot function to see the differences between the pre-processing and the post-processing 1function comparison(defdata, aircraft, month, day, year, hour, min) 2 3% Define LMA station data (latitude and longitude) 4LMA_stations = [ 541.510581970 0.623155296; % Alfes 641.500152588 −0.158101395; % Bujaraloz 741.68321694 0.44873444; % Raimat 840.707912445 0.632003069; % IRTAAmposta 940.698284149 0.841338038; % Buda 10 40.797130585 0.318209440; % ElsPorts 11 40.626560211 0.371187210; % Valentins 12 40.744808197 0.787701964; % Est_Biologica 13 41.96558222 −0.115210560; % TorresAlcanadre 14 41.020683289 0.934592485; % MontRoig 15 41.74287250 0.53582139; % Alguaire 16 42.052017212 0.729779422; % ObsMontsec 17 41.06309194 0.63550944 % Benissanet 18 ]; 19 20 % Create figure 21 figure1 = figure('WindowState','fullscreen'); 22 23 % Create axes for the first scatter plot 24 axes1 = axes('Parent', figure1, 'Position', [0.13 0.726737338044758 0.334659090909091 ... 0.131919905771496]); 25 scatter(defdata(:, 2), defdata(:, 5) / 1000, 25, defdata(:, 2), 'filled'); 26 grid(axes1, 'on'); xviii
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis 27 box(axes1, 'on'); 28 ylabel('Altitude [m]'); 29 ylim([0 13]); 30 yticks(0:2:12); 31 32 % Convert hour and minute to seconds 33 start_seconds = hour *3600 + min *60; 34 end_seconds = start_seconds + 10 *60; 35 36 % Create ticks and labels for x−axis 37 ticks_x = linspace(start_seconds, end_seconds, 7); 38 label_x = datestr(ticks_x / (24 *60 *60), 'HH:MM'); 39 40 % Configure x−axis 41 xticks(ticks_x); 42 xticklabels(label_x); 43 xlim([start_seconds, end_seconds]); 44 axes1.FontSize = 17; 45 46 % Create axes for the second scatter plot 47 axes2 = axes('Parent', figure1, 'Position', [0.570340909090909 0.726737338044758 ... 0.334659090909091 0.131919905771496]); 48 scatter(aircraft(:, 2), aircraft(:, 5) / 1000, 25, aircraft(:, 2), 'filled'); 49 grid(axes2, 'on'); 50 box(axes2, 'on'); 51 ylabel('Altitude [m]'); 52 ylim([0 13]); 53 yticks(0:2:12); 54 55 % Configure x−axis for the second plot 56 xticks(ticks_x); 57 xticklabels(label_x); 58 xlim([start_seconds, end_seconds]); 59 axes2.FontSize = 17; 60 61 % Create axes for the first geo scatter plot 62 axes3 = axes('Parent', figure1, 'Position', [0.13 0.11 0.334659090909091 ... 0.514263839811543]); 63 hold(axes3, 'off'); 64 geoscatter(LMA_stations(:, 1), LMA_stations(:, 2), 45, 'filled','^','MarkerFaceColor'... ,'black'); 65 hold on; 66 geoscatter(defdata(:, 3), defdata(:, 4), 25, defdata(:, 2), 'filled'); 67 geolimits([40, 42], [−2, 3]); 68 legend('eLMA Network','All detections'); 69 axes3.FontSize = 17; 70 71 % Create axes for the second geo scatter plot xix
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis 72 axes4 = axes('Parent', figure1, 'Position', [0.570340909090909 0.11 0.334659090909091 ... 0.514263839811543]); 73 hold(axes4, 'off'); 74 geoscatter(LMA_stations(:, 1), LMA_stations(:, 2), 45, 'filled','^','MarkerFaceColor'... ,'black'); 75 hold on; 76 geoscatter(aircraft(:, 3), aircraft(:, 4), 25, aircraft(:, 2), 'filled'); 77 geolimits([40, 42], [−2, 3]); 78 legend('eLMA Network','Aircraft'); 79 axes4.FontSize = 17; 80 81 % Construct the title string 82 titleStr = sprintf('Aircraft detection on %02d−%02d−%02d at %02d:%02d', month, day, ... year, hour, min); 83 84 % Add title to the figure 85 sgtitle(titleStr, 'FontSize', 22, 'FontWeight','bold','Interpreter','none','... FontName','Arial','Margin', 30); 86 87 % Save the figure 88 fileName = fullfile('/Users/edu/Dropbox/Definitive_TFG_Data/Results/Plots/All_cases',... sprintf('%02d%02d%02d_%02d.%02d_comparison.jpg', year, month, day, hour, min)); 89 saveas(figure1, fileName); 90 91 end C.2 Fr24: plot function to appreciate both eLMA aircraft detections and FlightRadar24 data 1function defdata_fr24 = fr24(aircraft,instants,month, day, year, hour, min) 2 3day_str = sprintf('%02d', day); 4month_str = sprintf('%02d', month); 5year_str = sprintf('%02d', year); 6hour_str = sprintf('%02d', hour); 7min_str = sprintf('%02d',min); 8 9 10 estaciones_LMA = [ 11 41.510581970 0.623155296; % Alfes 12 41.500152588 −0.158101395; % Bujaraloz 13 41.68321694 0.44873444; % Raimat 14 40.707912445 0.632003069; % IRTAAmposta 15 40.698284149 0.841338038; % Buda 16 40.797130585 0.318209440; % ElsPorts xx
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis 17 40.626560211 0.371187210; % Valentins 18 40.744808197 0.787701964; % Est_Biologica 19 41.96558222 −0.115210560; % TorresAlcanadre 20 41.020683289 0.934592485; % MontRoig 21 41.74287250 0.53582139; % Alguaire 22 42.052017212 0.729779422; % ObsMontsec 23 41.06309194 0.63550944 % Benissanet 24 ]; 25 26 namefolder = fullfile('/Users/edu/Dropbox/Definitive_TFG_Data/Data_FR24/Main_cases'); 27 namefiles = dir(fullfile(namefolder,'*.txt')); 28 29 for i=1:numel(namefiles) 30 if namefiles(i).name == [year_str month_str day_str hour_str min_str '.txt'] 31 deffile_fr24 = fullfile(namefolder,namefiles(i).name); 32 else 33 continue; 34 end 35 end 36 fid = fopen(deffile_fr24,'r'); 37 data = fscanf(fid,'%f',[4,Inf]); 38 fclose(fid); 39 defdata_fr24 = transpose(data); 40 41 figure1 = figure('WindowState','fullscreen'); 42 axes1 = axes('Parent',figure1,'Position',[0.13 0.11 0.775 0.554310954063604]); 43 S = shaperead('/Users/edu/Dropbox/Definitive_TFG_Data/Cat_Shape/es.shp'); 44 plot([S.X],[S.Y],'k'); 45 hold (axes1,'on') 46 plot([defdata_fr24(:,2)], [defdata_fr24(:,1)],'LineWidth',1) 47 hold (axes1,'on') 48 scatter(aircraft(:,4), aircraft(:,3),20,aircraft(:,2),'filled') 49 hold (axes1,'on') 50 scatter(estaciones_LMA(:,2), estaciones_LMA(:,1), 45, 'filled','^','MarkerFaceColor',... 'black'); 51 xlim([−2,3]); 52 ylim([40,42]); 53 xlabel('Longitude [ ]','FontSize',17); 54 ylabel('Latitude [ ]','FontSize',17); 55 %zlim([0,13500]); 56 %defdata_fr24(:,3)*0.3048 57 axes1 = gca; 58 axes1.FontSize = 17; 59 legend('','FlightRadar24 aicraft data','eLMA aircraft data','eLMA network') 60 61 62 axes2 = axes('Parent',figure1,... 63 'Position',[0.13 0.750294464075383 0.775 0.174705535924623]); 64 scatter(aircraft(:,4), aircraft(:,5)/1000,20,aircraft(:,2),'filled') xxi
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis 65 xlim([−2,3]); 66 ylim([5,13.5]); 67 hold on 68 plot(defdata_fr24(:,2), (defdata_fr24(:,3)*0.3048)/1000,'LineWidth',1) 69 xlim([−2,3]); 70 ylim([5,13.500]); 71 legend('eLMA aircraft data','FlightRadar24 aicraft data') 72 xlabel('Longitude [ ]','FontSize',16); 73 ylabel('Altitude [Km]','FontSize',16); 74 axes2 = gca; 75 axes2.FontSize = 17; 76 grid (axes2,'on') 77 box (axes2,'on') 78 titleStr = sprintf('FlightRadar24 study on latitude−longitude on %02d−%02d−%02d at %02d... :%02d', month, day, year, hour, min); 79 80 % Add title to the figure 81 sgtitle(titleStr, 'FontSize', 22, 'FontWeight','bold','Interpreter','none','... FontName','Arial','Margin', 30); 82 83 fileName = fullfile('/Users/edu/Dropbox/Definitive_TFG_Data/Results/Plots/All_cases',... sprintf('%02d%02d%02d_%02d.%02d_FR24study.jpg', year, month, day,hour,min)); 84 saveas(figure1, fileName); 85 86 %{ 87 figure; 88 %subplot(2,2,1) 89 scatter(aircraft(:,4), aircraft(:,5),10,aircraft(:,2),'filled') 90 %xlim([−2,3]); 91 ylim([5000,13500]); 92 hold on 93 plot(defdata_fr24(:,2), defdata_fr24(:,3)*0.3048,'LineWidth',2) 94 %xlim([−2,3]); 95 ylim([5000,13500]); 96 97 98 figure; 99 %subplot(2,2,3) 100 scatter(aircraft(:,3), aircraft(:,5),10,aircraft(:,2),'filled') 101 %xlim([40,42]); 102 ylim([5000,13500]); 103 hold on 104 plot(defdata_fr24(:,1), defdata_fr24(:,3)*0.3048,'LineWidth',2) 105 %xlim([40,42]); 106 ylim([5000,13500]); 107 108 109 %{ 110 figure; xxii
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis 111 plot(defdata_fr24(:,4)*0.5144) 112 ylim([175 300]); 113 ylabel('Speed [m/s]') 114 grid on; 115 box on; 116 117 figure; 118 plot(instants(:,2)) 119 ylim([175 300]); 120 ylabel('Speed [m/s]') 121 122 ylabel('Speed [m/s]'); 123 grid on; 124 box on; 125 126 %} 127 %} 128 end C.3 General_plot: plot function to see the main data from the post-processing data 1function general_plot(aircraft, instants, month, day, year, hour, min) 2 3% Define LMA station data (latitude and longitude) 4LMA_stations = [ 541.510581970 0.623155296; % Alfes 641.500152588 −0.158101395; % Bujaraloz 741.68321694 0.44873444; % Raimat 840.707912445 0.632003069; % IRTAAmposta 940.698284149 0.841338038; % Buda 10 40.797130585 0.318209440; % ElsPorts 11 40.626560211 0.371187210; % Valentins 12 40.744808197 0.787701964; % Est_Biologica 13 41.96558222 −0.115210560; % TorresAlcanadre 14 41.020683289 0.934592485; % MontRoig 15 41.74287250 0.53582139; % Alguaire 16 42.052017212 0.729779422; % ObsMontsec 17 41.06309194 0.63550944 % Benissanet 18 ]; 19 20 % Create figure 21 figure1 = figure('WindowState','fullscreen'); 22 23 % Upper rectangle xxiii
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis 24 axes1 = axes('Parent', figure1, 'Position', [0.13 0.8 0.782 0.127]); 25 hold on 26 scatter(aircraft(:, 2), aircraft(:, 5) / 1000, 25, aircraft(:, 2), 'filled'); 27 grid(axes1, 'on'); 28 box(axes1, 'on'); 29 xlabel('UTC Time [HH:MM]'); 30 ylabel('Altitude [m]'); 31 ylim([0 13]); 32 yticks(0:2:12); 33 34 % Convert hour and minute to seconds 35 start_seconds = hour *3600 + min *60; 36 end_seconds = start_seconds + 10 *60; 37 38 % Create ticks and labels for x−axis 39 ticks_x = linspace(start_seconds, end_seconds, 7); 40 label_x = datestr(ticks_x / (24 *60 *60), 'HH:MM'); 41 42 % Configure x−axis 43 xticks(ticks_x); 44 xticklabels(label_x); 45 xlim([start_seconds, end_seconds]); 46 47 axes1 = gca; 48 axes1.FontSize = 17; 49 50 % Small square 51 axes2 = axes('Parent', figure1, 'Position', [0.633333333333333 0.342756183745583 ... 0.279666666666667 0.16489988221437]); 52 hold on 53 [count, alt] = hist(aircraft(:, 5) / 1000, 20); 54 barh(alt, count); 55 ylim([0 13]); 56 yticks(0:2:12); 57 ylabel('Altitude [m]'); 58 xlabel('Sources'); 59 grid(axes2, 'on'); 60 box(axes2, 'on'); 61 62 axes2 = gca; 63 axes2.FontSize = 17; 64 65 % Lower rectangle 66 axes3 = axes('Parent', figure1, 'Position', [0.634722222222222 0.57243816254417 ... 0.277777777777778 0.153121319199057]); 67 hold on 68 histogram(aircraft(:, 2), 60, 'FaceColor','red'); 69 xlabel('UTC Time [HH:MM]'); 70 ylabel('Sources'); xxiv
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis 71 grid(axes3, 'on'); 72 box(axes3, 'on'); 73 74 % Configure x−axis for the lower rectangle 75 xticks(ticks_x); 76 xticklabels(label_x); 77 xlim([start_seconds, end_seconds]); 78 79 axes3 = gca; 80 axes3.FontSize = 17; 81 82 % Right rectangle 83 axes4 = axes('Parent', figure1, 'Position', [0.634722222222222 0.11 0.278277777777779 ... 0.169151943462898]); 84 hold on 85 scatter(instants(:, 1) / 60, instants(:, 2), 25, instants(:, 1) / 60, 'filled'); 86 yticks(175:25:300); 87 ylim([175 300]); 88 xlabel('Measurement time interval [min]'); 89 ylabel('Speed [m/s]'); 90 grid(axes4, 'on'); 91 box(axes4, 'on'); 92 93 axes4 = gca; 94 axes4.FontSize = 17; 95 96 % Big square 97 axes5 = axes('Parent', figure1, 'Position', [0.13 0.11 0.454722222222222 ... 0.616737338044758]); 98 hold off 99 geoscatter(LMA_stations(:, 1), LMA_stations(:, 2), 45, 'filled','^','MarkerFaceColor'... ,'black'); 100 hold on 101 geoscatter(aircraft(:, 3), aircraft(:, 4), 25, aircraft(:, 2), 'filled'); 102 geolimits([40, 42], [−2, 3]); 103 legend('eLMA Network','Aircraft'); 104 105 axes5 = gca; 106 axes5.FontSize = 17; 107 108 % Construct the title string 109 titleStr = sprintf('Aircraft detection study on %02d−%02d−%02d at %02d:%02d', month, ... day, year, hour, min); 110 111 % Add title to the figure 112 sgtitle(titleStr, 'FontSize', 22, 'FontWeight','bold','Interpreter','none','... FontName','Arial','Margin', 30); 113 114 % Save the figure xxv
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Detect date Detect hour Aircraft type Take-off Landing Flight Phase 19/1/2024 14:50 Boeing 787-8 Dreamliner Madrid Barcelona Descend 15:00 Boeing 787-8 Dreamliner Madrid Barcelona Descend 09/2/2024 05:20 Boeing 787-8 Dreamliner Bogotá Barcelona Descend 07:00 Boeing 737-8D6 Algiers Paris Cruise 07:10 Boeing 787-8 Dreamliner Madrid Barcelona Descend 07:20 Boeing 787-8 Dreamliner Madrid Barcelona Descend 19:50 Boeing 787-8 Dreamliner Barcelona Madrid Cruise 19:50 Boeing 737 MAX 8-200 Barcelona Lisbon Ascend 21:00 Airbus A320-214 Lisbon Barcelona Descend 21:10 Airbus A320-214 Lisbon Barcelona Descend 15/2/2024 11:10 Boeing 787-9 Dreamliner Barcelona Madrid Ascend Table E.1: Flight information of observed aircraft. xxxii
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Appendix F Case studies F.1 Comparative results This appendix presents all those downloaded results from the comparison between the pre-processed data and the post-processed data. It should be noted that not all aircraft detections are included here, although the present ones show more than enough results to validate the effectiveness and performance of the code. Besides, in the same way as in the memory, both the altitude-time and longitude-latitude graphs are presented. Figure F.1: Aircraft identification graphs on 12 July 2023 at 10:50. xxxiii
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure F.2: Aircraft identification graphs on 02 September 2023 at 15:00. Figure F.3: Aircraft identification graphs on 02 September 2023 at 18:50. xxxiv
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure F.4: Aircraft identification graphs on 02 September 2023 at 22:00. Figure F.5: Aircraft identification graphs on 03 September 2023 at 04:50. xxxv
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure F.6: Aircraft identification graphs on 03 September 2023 at 05:50. Figure F.7: Aircraft identification graphs on 03 September 2023 at 06:00. xxxvi
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure F.8: Aircraft identification graphs on 03 September 2023 at 06:20. Figure F.9: Aircraft identification graphs on 12 September 2023 at 13:50. xxxvii
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure F.10: Aircraft identification graphs on 15 September 2023 at 14:10. Figure F.11: Aircraft identification graphs on 15 September 2023 at 14:20. xxxviii
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure F.12: Aircraft identification graphs on 16 September 2023 at 18:00. Figure F.13: Aircraft identification graphs on 20 September 2023 at 05:20. xxxix
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure F.14: Aircraft identification graphs on 21 September 2023 at 19:10. Figure F.15: Aircraft identification graphs on 21 September 2023 at 19:50. xl
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure F.16: Aircraft identification graphs on 16 October 2023 at 05:40. Figure F.17: Aircraft identification graphs on 19 October 2023 at 13:40. xli
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure F.30: Aircraft identification graphs on 01 November 2023 at 23:30. Figure F.31: Aircraft identification graphs on 02 November 2023 at 10:50. xlviii
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure F.32: Aircraft identification graphs on 16 November 2023 at 11:20. Figure F.33: Aircraft identification graphs on 27 November 2023 at 10:20. xlix
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure F.34: Aircraft identification graphs on 28 November 2023 at 09:20. Figure F.35: Aircraft identification graphs on 30 November 2023 at 14:50. l
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure F.36: Aircraft identification graphs on 30 November 2023 at 15:00. Figure F.37: Aircraft identification graphs on 01 December 2023 at 06:20. li
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure F.38: Aircraft identification graphs on 01 December 2023 at 08:20. Figure F.39: Aircraft identification graphs on 01 December 2023 at 08:30. lii
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure F.40: Aircraft identification graphs on 04 December 2023 at 06:20. Figure F.41: Aircraft identification graphs on 17 January 2024 at 07:40. liii
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure F.42: Aircraft identification graphs on 17 January 2024 at 07:50. Figure F.43: Aircraft identification graphs on 09 February 2024 at 05:20. liv
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure F.44: Aircraft identification graphs on 09 February 2024 at 07:00. Figure F.45: Aircraft identification graphs on 09 February 2024 at 07:10. lv
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure F.46: Aircraft identification graphs on 09 February 2024 at 19:50. F.2 Case studies This appendix provides a detailed study of all the cases discussed in Appendix F.1. In the same way as in the report, the altitude-time, longitude-latitude and speed-detection time graphs are shown. In addition, histograms are shown in relation to altitude and number of sources per time. lvi
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure F.47: Source characterization of the aircraft detection on 07 July 2023 at 10:50. Figure F.48: Source characterization of the aircraft detection on 02 September 2023 at 15:00. lvii
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure F.61: Source characterization of the aircraft detection on 21 September 2023 at 19:50. Figure F.62: Source characterization of the aircraft detection on 16 October 2023 at 05:40. lxiv
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure F.63: Source characterization of the aircraft detection on 19 October 2023 at 13:40. Figure F.64: Source characterization of the aircraft detection on 19 October 2023 at 14:10. lxv
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure F.65: Source characterization of the aircraft detection on 19 October 2023 at 14:40. Figure F.66: Source characterization of the aircraft detection on 19 October 2023 at 18:30. lxvi
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure F.67: Source characterization of the aircraft detection on 19 October 2023 at 20:10. Figure F.68: Source characterization of the aircraft detection on 19 October 2023 at 22:50. lxvii
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure F.69: Source characterization of the aircraft detection on 23 October 2023 at 22:30. Figure F.70: Source characterization of the aircraft detection on 26 October 2023 at 10:30. lxviii
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure F.71: Source characterization of the aircraft detection on 26 October 2023 at 10:40. Figure F.72: Source characterization of the aircraft detection on 29 October 2023 at 11:10. lxix
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure F.73: Source characterization of the aircraft detection on 31 October 2023 at 15:00. Figure F.74: Source characterization of the aircraft detection on 31 October 2023 at 15:10. lxx
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure F.75: Source characterization of the aircraft detection on 01 November 2023 at 12:50. Figure F.76: Source characterization of the aircraft detection on 01 November 2023 at 23:30. lxxi
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure F.77: Source characterization of the aircraft detection on 02 November 2023 at 10:50. Figure F.78: Source characterization of the aircraft detection on 16 November 2023 at 11:20. lxxii
Bachelor’s degree in Aerospace Vehicle Engineering Final thesis Figure F.79: Source characterization of the aircraft detection on 27 November 2023 at 10:20. Figure F.80: Source characterization of the aircraft detection on 28 November 2023 at 09:20. lxxiii