Loyola Lightning Machine

Multi-instrument GUI for TGF research · Python · tkinter · 2024–2026

Preliminary paper (ESSOAr preprint) →
Raw instrument files (INTF .dat, FA .csv, TASD binary, photometer .dat, LMA .dat, spectrograph TIFF sequences) are each handled by a dedicated Python data handler class. Handlers normalize time references, apply calibrations, and expose a clean API to the GUI. Each analysis tab consumes one or more handlers and renders results into an embedded matplotlib canvas. Outputs flow to publication-ready figures or exportable project files (.tgf JSON).

The Tool

Tab screenshot

Spectroscopy

Spectra animation showing wavelength calibration across frames

From 10–20 minutes per frame to an entire event in the same time

The spectrograph tab processes slitless spectrograph data from the Phantom v711 camera (40,000 fps), which disperses lightning channel light into its component wavelengths across each frame. The core challenge is wavelength calibration: the dispersion axis shifts between frames as the lightning channel moves, so a single static calibration is insufficient. The tab implements a keyframe calibration system where the user manually assigns known emission lines (Hα at 656nm, OI at 777nm) to 3–5 reference frames, and the tool interpolates polynomial calibration coefficients between them for every frame in the sequence.

Keyframe wavelength calibration
Polynomial coefficient interpolation
Known line identification (Hα, OI, NII)
Frame-by-frame export

Notes and Challenges

Developing an Independent INTF Calibration Method

The VHF interferometer measures lightning source direction as direction cosine pairs (cosA, cosB). Converting these to calibrated azimuth and elevation requires two offset constants, cosShiftA and cosShiftB, specific to each deployment season. The standard approach used external values provided by the Utah group (Mark Stanley), derived from NLDN ground-strike positions. While functional, NLDN accuracy is limited to roughly ±0.5° due to network geolocation uncertainty.

To achieve higher precision, an independent LMA cross-matching method was developed. The approach uses the physical constraint that return strokes reach ground level (elevation = 0°) to anchor cosShiftB, then cross-matches INTF sources against LMA detections, which are GPS-timed and independently localized, to solve for cosShiftA. Applied to the 2024 event, this method reproduced Stanley's values to within 0.059° (versus 0.5° for NLDN), validating the approach. For the 2025 season, where Utah values were not yet available, this method became the primary calibration source.

777nm Channel Saturation at IBP

The photometer's 777nm channel (R2228 PMT, bare E678-14C socket) exhibited anomalously large spikes during the initial breakdown pulse stage, roughly 2x the return stroke amplitude, inconsistent with high-speed camera luminosity. The UV channels (R580 PMT, E2183-500 socket) did not show this behavior. The root cause is the absence of bypass capacitors in the 777nm socket: under large signals, the dynode voltage droops, causing PMT saturation and a slow recovery tail that inflates the apparent signal. The UV channels' sockets include bypass capacitors that suppress this effect. This artifact contaminates 337/777 and 391/777 ratios during the IBP stage and is flagged in all downstream spectroscopic analysis.

Tech Stack

Python 3 tkinter matplotlib (TkAgg) numpy + scipy pandas