Reproducible LMA research with the IPython notebook and brawl4d

This notebook demonstrates how to display data included in the lmatools repository.

If you haven't yet, process and view sample data included with lmatools

python ~/code/lmatools/testing/test_sklearn.py /path/to/output/files/

Then, edit the data_path in the second cell to include /path/to/output/files/ as defined above. Run all the cells prior to the "Charge Analysis" and try interacting with the plot. You should see some data.


In [1]:
import matplotlib
%matplotlib qt4
# import matplotlib
# matplotlib.use('nbagg')
#import matplotlib.pyplot as plt
from brawl4d.brawl4d import B4D_startup, redraw
import os

In [2]:
data_path = '/data/DC3/flash_sort/'
lma_file = os.path.join(data_path, 'h5_files/2012/Jun/02/LYLOUT_120602_212001_0600.dat.flash.h5')

In the cell below, note that the basedate has been set to match the dataset we specified above.

If you are not using data from the WTLMA, then you'll also need to pass ctr_lon=value and ctr_lat=value to B4D_startup.


In [3]:
from datetime import datetime
panels = B4D_startup(basedate=datetime(2012,6,2), ctr_lat=40.4463980, ctr_lon=-104.6368130)


/Users/ebruning/anaconda/lib/python2.7/site-packages/matplotlib/font_manager.py:1279: UserWarning: findfont: Font family [u'Helvetica'] not found. Falling back to Bitstream Vera Sans
  (prop.get_family(), self.defaultFamily[fontext]))

In [4]:
import matplotlib.pyplot as plt; plt.show()

Below, set a valid path to lma_file. IPython will tab-complete paths, like the shell.


In [5]:
from brawl4d.LMA.controller import LMAController
lma_ctrl = LMAController()
d, post_filter_brancher, scatter_ctrl, charge_lasso = lma_ctrl.load_hdf5_to_panels(panels, lma_file)


found flash data

Zoom to overview of first minute


In [6]:
h,m,s,dt = 21, 20, 0, 60
panels.panels['tz'].axis((h*3600 + m*60 + s, h*3600 + m*60 + s+dt, 1, 18))
panels.panels['xy'].axis((-150, 150, -150, 150))


Out[6]:
(-150, 150, -150, 150)

In [6]:
from brawl4d.LMA.widgets import LMAwidgetController
from IPython.display import display
from brawl4d.LMA.controller import LMAController

lma_tools = LMAwidgetController(panels, lma_ctrl, scatter_ctrl, charge_lasso, d)
display(lma_tools.tools_popup)

Hereford storm


In [7]:
h,m,s,dt = 21, 21, 0, 60*2
panels.panels['tz'].axis((h*3600 + m*60 + s, h*3600 + m*60 + s+dt, 1, 18))
panels.panels['xy'].axis((25, 45, 45, 65))


Out[7]:
(25, 45, 45, 65)

Flashes remain elevated to the east, but there is now a ring of flash activity to the west with a hole. The next two cells advance minute-by-minute, in overlapping two minute windows. Notice that the cell consolidates once again, and a band of very small flashes develops near 10 km. This is consistent with a rising updraft surge, which can be seen in a longer time-height view.


In [16]:
h,m,s,dt = 21, 22, 0, 60*1
panels.panels['tz'].axis((h*3600 + m*60 + s, h*3600 + m*60 + s+dt, 1, 18))
panels.panels['xy'].axis((25, 45, 45, 65))


Out[16]:
(25, 45, 45, 65)

In [17]:
h,m,s,dt = 21, 23, 0, 60*2
panels.panels['tz'].axis((h*3600 + m*60 + s, h*3600 + m*60 + s+dt, 1, 18))
panels.panels['xy'].axis((25, 45, 45, 65))


Out[17]:
(25, 45, 45, 65)

In [14]:
h,m,s,dt = 21, 24, 0, 60*2
panels.panels['tz'].axis((h*3600 + m*60 + s, h*3600 + m*60 + s+dt, 1, 18))
panels.panels['xy'].axis((25, 45, 45, 65))


Out[14]:
(25, 45, 45, 65)

In [20]:
h,m,s,dt = 21, 25, 0, 60*2
panels.panels['tz'].axis((h*3600 + m*60 + s, h*3600 + m*60 + s+dt, 1, 18))
panels.panels['xy'].axis((25, 45, 45, 65))


Out[20]:
(25, 45, 45, 65)

Distribution of flash sizes and charge


In [8]:
h,m,s,dt = 21, 26, 14, 22
panels.panels['tz'].axis((h*3600 + m*60 + s, h*3600 + m*60 + s+dt, 1, 18))
panels.panels['xy'].axis((25, 45, 45, 65))


Out[8]:
(25, 45, 45, 65)

We now see a reasonably mature storm that divides into a forward anvil and trailing preipication region with larger flashes, and smaller flashes in between.

Large flash (one of two simultaneous flashes) at 2126:17.85 - 18.2

  • -IC, but at lower level than eastern, northern extensive -ICs
  • Upward-propagating negative leader toward smaller flahes
  • Retrograde breakdown beginning 8 km and negative leader extension at :18.10
  • Lower-level negative leaders into trailing positive charge are just above melting level. Small flashes at 36,52

-ICs at 32.4 sec

  • Numerous retrograde breakdown events leading to negative channel extension in SE flash
  • Slightly lower altitude on first, northern flash Small flash 2126:26.96 - 27.08: total area 0.6 km$^2$ - very small.
  • Just enough evidence to say this is a -IC.
  • Downward initial activity would be neg ldr
  • points at 10.4 km and 27.02-27.05 s probably retrograde breakdown Many other smaller flashes nearby, with indeterminate charge structure. Probably seeing mostly negative leaders, all at about 10 km.

Summary is that we have almost exclusively positive charging to graupel, which precipitates, while negative ice crystals remain aloft. Not enough cloud above. Away from the updraft and its small flashes, the charge is lower and flashes are larger. RHIs showed a deep precipitation shaft on the western side of this storm; this was associated with large flashes and lower altitudes of the positive storm charge.

Need to look at the updraft region to best gauge the electrification process itself, which is distinct from the charge regions that result from that updraft.

Two flashes: quadrupole or tilted dipole?

These two flashes are both -ICs, but the lower negative leaders of the first flash are about at the same altitude as the upper positive leaders in the second flash. However, the evidence of positive ledaers is displaced by about 3 km, and the negative leader from the first flash come closer in space to the positive charge, suggesting that a tilted -/+ dipole might be more correct than -/+/-/+.

These flashes illustrate the necessity of thinking meteorologically about the location of flashes relative to the updraft and precipitation trajectories associtaed with each storm.

Positive leaders at:

  • 37.0, 53.5, 11.5 (first flash)
  • 34.5, 53.0, 10.2 (second flash)

In [22]:
h,m,s,dt = 21, 27, 29.54, 2
panels.panels['tz'].axis((h*3600 + m*60 + s, h*3600 + m*60 + s+dt, 1, 18))
panels.panels['xy'].axis((33, 38, 51, 57))


Out[22]:
(33, 38, 51, 57)

Last two minutes


In [26]:
h,m,s,dt = 21, 28, 0, 60*2
panels.panels['tz'].axis((h*3600 + m*60 + s, h*3600 + m*60 + s+dt, 1, 18))
panels.panels['xy'].axis((25, 45, 45, 65))


Out[26]:
(25, 45, 45, 65)

Zoom in on 2129:00-2129:20, well-established slope.

Forward flashes from 8-15 seconds.

  • Northern flash, 12.42 seconds - positive retrograde breakdown?
    • neg chg 9 km, pos chg 7.8 km
  • Middle flash, 13.45 s
    • neg chg 10.5 km, pos chg sloping from 9.9 down to 9.3 to north.
    • 6 stations helps on neg end
  • Southern flash 11.65 s
    • neg chg 10.5 km, pos chg 9.5 km.
  • A few small clusters on southern end.
    • northern end is probably evidence of pos chg sloping down and away from updraft.

Back to larger view - look at larger flashes on north end in y-z view

  • 12.42 s, 17 s, 6 s represent east to west descent of positive charge.
  • also seen in slope on x-z view

In [8]:
panels.bounds.limits()


Out[8]:
[('x', (24.936575052854124, 45.063424947145876)),
 ('y', (45.0, 65.0)),
 ('z', (1.0, 18.0)),
 ('time', (76860.0, 76980.0))]

In [ ]: