deeplycloudy / xlma-python

A future, Python-based version of xlma?
MIT License
6 stars 6 forks source link

xlma-python

A future, Python-based version of xlma?

XLMA is a venerable IDL GUI program that diplays VHF Lightning Mapping Array data. It was originally written by New Mexico Tech in the late 1990s. The purpose of this repository is to collect ideas, sketches of code, and a community that could facilitate rewriting xlma in Python.

Please use the issues tracker to discuss ideas and pull requests to contribute examples.

Installation

Clone this repostiory install with pip.

git clone https://github.com/deeplycloudy/xlma-python.git
cd xlma-python
pip install -e .

Then, copy the XLMA_plots.ipynb notebook to wherever you'd like and start changing files, dates and times to show data from your case of interest. There also a notebook showing how to do flash sorting and save a new NetCDF file with those data.

Dependencies

Required:

Flash clustering:

Plotting:

Interactive:

Building:

Technical architecture

We envision a two-part package that keeps a clean separation between the core data model, analysis, and display. XLMA utilized a large, global state structure that stored all data, as well as the current data selection corresponding to the view in the GUI. Analysis then operated on whatever data was in the current selection.

Data model and subsetting

xarray is the obvious choice for the core data structure, because it supports multidimensional data with metadata for each variable, subsetting of all varaibles sharing a dimension, and fast indexing. Data can be easily saved and read from the NetCDF format, and converted from ASCII to Dataset using standard tools.

Analysis

Some core features of LMA data analysis will be built in, TBD after surveying capabilities in XLMA.

Display

Keeping the core data structure and selection operations separate from dislpay is good programming practice. It is doubly important in Python, where there is not one obvious solution for high performance and publication-quality graphics as in IDL.

Plotting library

There are many options, so we want a design that:

  1. Permits a GUI to provide the bounds of the current view (or a polygon lasso) to the data model, changing the subset
  2. Allows many GUIs to read from the data model so that we maintain loose coupling as the GUI and plotting landscape evolves.

GUI

There is no obvious choice here, either.

Prior art