HLMA Module

Main GUI window for the HLMA application.

Handles plotting, visualization, and analysis of lightning data, including animations and interactive polygon-based selections. Connects user actions to underlying data processing and the FLASH algorithm, serving as the primary entry point for the application.

hlma.settings
Type:

QSettings

Stores application-specific settings.
hlma.state
Type:

State

Application state containing loaded data and plot configuration.
hlma.anim
Type:

Animate

Animation controller for temporal lightning visualizations.
hlma.ui
Type:

SimpleNamespace

Container for all UI widgets.
hlma.polyfilter
Type:

PolygonFilter

Tool for interactive polygon-based selection.
class hlma.HLMA[source]

Bases: QMainWindow

Main GUI window for the HLMA application.

Handles plotting, visualization, and analysis of lightning data, including animations and interactive polygon-based selections. Connects user actions to underlying data processing and the FLASH algorithm, serving as the primary entry point for the application.

settings

Stores application-specific settings.

Type:

QSettings

state

Application state containing loaded data and plot configuration.

Type:

State

anim

Animation controller for temporal lightning visualizations.

Type:

Animate

ui

Container for all UI widgets.

Type:

SimpleNamespace

polyfilter

Tool for interactive polygon-based selection.

Type:

PolygonFilter

animate()[source]

Start animating the currently loaded lightning data.

Initializes animation timing, sets the active flag, and starts the animation timer.

Parameters:

None

Return type:

None

export_dat()[source]

Export selected LYLOUT data to 10-minute interval .dat files.

Groups the currently plotted data into 10-minute bins and writes formatted .dat files to the output folder with relevant metadata.

Parameters:

None

Return type:

None

export_image()[source]

Capture the current view widget and save it as a PDF image.

Grabs the content of the main view widget and writes it to ‘output/image.pdf’.

Parameters:

None

Return type:

None

export_parquet()[source]

Export the currently plotted LYLOUT data to a Parquet file.

Writes the plotted dataset to ‘output/lylout.parquet’ for efficient storage and later use.

Parameters:

None

Return type:

None

export_state()[source]

Save the current application state to ‘state/state.pkl’.

Serializes the state attributes including datasets, plot options, and stations, enabling later restoration.

Parameters:

None

Return type:

None

filter()[source]

Apply user-defined filters to the loaded lightning data.

Reads filter criteria from UI elements, evaluates the query against self.state.all, updates self.state.plot, resets polygon selection mask, and triggers a replot.

Parameters:

None

Return type:

None

flash_dtd()[source]

Run the dot-to-dot (DTD) flash detection algorithm.

Executes the dot_to_dot function on the current state, updating flash detection results while showing a loading dialog.

Parameters:

None

Return type:

None

flash_mccaul()[source]

Run the McCaul flash detection algorithm.

Executes the mc_caul function on the current state, updating flash detection results while showing a loading dialog.

Parameters:

None

Return type:

None

help_about()[source]

Open the HLMA project About webpage.

Launches the HLMA About page in the default web browser.

Parameters:

None

Return type:

None

help_color()[source]

Open the Colorcet colormap user guide.

Launches the Colorcet documentation for linear sequential colormaps.

Parameters:

None

Return type:

None

help_contact()[source]

Open the HLMA contact webpage.

Launches the contact page for Timothy Logan in the default web browser.

Parameters:

None

Return type:

None

import_entln()[source]

Open and load one or more ENTLN files, updating lightning strike data.

Loads ENTLN files selected by the user, updates the ground strike dataset (self.state.gsd), assigns colors and symbols for CG and CC strikes, and refreshes the UI plots.

Parameters:

None

Return type:

None

import_lylout()[source]

Open and load one or more LYLOUT files selected by the user.

Opens files using a file dialog, loads data into the state object, updates time range and station statistics, and applies current filters.

Parameters:

None

Return type:

None

import_state()[source]

Load a previously saved application state from ‘state/state.pkl’.

Reads a pickled state file and updates the internal State object including datasets, plot options, and stations.

Parameters:

None

Return type:

None

options_clear()[source]

Clear all plotted data from plots and histograms.

Resets the scatter plots (s0, s1, s3, s4) and histogram (hist) in the UI to empty arrays, effectively clearing visualizations.

Parameters:

None

Return type:

None

options_reset()[source]

Reset the camera views of all main visualization widgets.

Restores the default orientation and zoom for the cameras of view widgets v0 through v4.

Parameters:

None

Return type:

None

redo()[source]

Reapply an action that was previously undone.

Restores the most recent future state from self.state.future, moves the current state to self.state.history, and updates visualizations by calling self.state.replot().

Parameters:

None

Return type:

None

undo()[source]

Revert the last user action or selection.

If polygon selections exist in self.polyfilter, removes the last polygon. Otherwise, restores the previous application state from self.state.history and updates self.state.future to allow redo. Refreshes visualizations via self.state.replot().

Parameters:

None

Return type:

None

visplot()[source]

Update all visualization plots with the current lightning and map data.

Refreshes scatter plots (s0, s1, s3, s4), histogram (hist), and map layers using the currently selected data (self.state.plot) and map features (self.state.plot_options.map and features). Handles coloring based on the selected variable and adds or removes CG and CC flash visuals depending on data availability.

Parameters:

None

Return type:

None