## 3 The Software of TLE Observation System  
### TLE Detection Algorithm  
In order to observe a TLE during the VisionCube mission, the onboard observation system first detects possible UV radiations originated from a TLE. The detection algorithm was designed to distinguish the TLE from other light sources by detecting short flashes around the ultraviolet band at 391.4 nm where the spectral intensity of blue jet is centered. Furthermore, it should differentiate TLEs from flash lighting using a similar method presented in [21]. In addition, the detection process involves localizing the TLE location in the image plane, as this information will be utilized to capture specific areas of the digital images from the onboard CMOS camera. This detection scheme ensures robust and reliable operation in obtaining potential images of TLE, which is an essential requirement when considering the limited onboard image processing time, onboard storage capacity for acquired images, etc. Accordingly, three discriminators are incorporated in the detection algorithm being implemented on low-level hardware logic: the temporal, energy, and spatial discriminators. As the TLE has rather short duration, the first temporal discriminator distinguishes a pulse-type signal from DC signals that are generated by background light sources such as auroras and city  
Figure 6: Design of lens housing for TLE observation system. (**a**) Side view with cover; (**b**) Side view without cover; (**c**) Front view with cover. lights. If the light intensity changes abruptly in a short time scale, for instance 0.3 ms, the temporal discriminator recognizes the existence of pulsed light that could be originated from a TLE source. At the same time, the energy discriminator determines the signals that only exceed the pre-specified threshold. The differential energy in a specific time span can be regarded as the radiation energy input by TLE occurrence, thus the combination of the temporal and energy discriminators can confirm whether a TLE has occurred within the field of view of the MaPMT sensor. It should be noted that the combination of these two discriminators can also distinguish the TLE from flash lighting, because the TLE has much more energy than flash lighting. Figure 7 illustrates the operation of these discriminators, as the radiant power is assumed to be injected on the 54 th cell out of 8 \(\times\) 8 cells of the MaPMT. The current output of the MaPMT is sampled by the DDC264 at every fixed period of 166 \(\upmu\)s. Each MaPMT frame is constructed by averaging two successive samples of the MaPMT to mitigate noisy measurements. Subsequently, two consecutive MaPMT frames at \(t_{k}\) and \(t_{k+1}\) are continuously compared by the temporal discriminator to discover a change over time. It follows that the energy discriminator checks the energy differential exceeds the predetermined threshold. The spatial discriminator extracts the information regarding the location of the TLE in the image plane. For this purpose, recall that the MaPMT is a spatial detector that yields 64 intensity signals of incoming UV radiations at the sensing elements as shown in Figure 3b. Because the sensing elements are arranged by 8 \(\times\) 8 configuration on its sensing plane, the MaPMT can provide the relative location of the TLE with respect to the sensing axis that is perpendicular to the image plane. With the 35\({}^{\circ}\) FOV of the pin-hole lens which is purposely chosen to be same as that of the image sensor, the MaPMT can provide the roughly estimated location of the TLE in the image plane. Also the difference of intensity values between adjacent cells will provide additional information of the TLE occurrence. This gradient values along the horizontal and vertical direction in the image plane are also compared with the predetermined threshold to confirm the location of the TLE. Finally, the estimated location  
Figure 7: Three discriminators for TLE detection algorithm. **(a)** Potential radiant power by a TLE is assumed to be injected on the 54 th cell of the MaPMT.