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)
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)
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]:
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)
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]:
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]:
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]:
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]:
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]:
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]:
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
-ICs at 32.4 sec
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.
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:
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]:
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]:
Zoom in on 2129:00-2129:20, well-established slope.
Forward flashes from 8-15 seconds.
Back to larger view - look at larger flashes on north end in y-z view
In [8]:
panels.bounds.limits()
Out[8]:
In [ ]: