In [1]:
%pylab
from brawl4d.brawl4d import B4D_startup
In [2]:
from datetime import datetime
panels = B4D_startup(basedate=datetime(2013,6,6))
In [3]:
# redraw
def redraw():
from stormdrain.pubsub import get_exchange
get_exchange('SD_bounds_updated').send(panels.bounds)
In [4]:
from brawl4d.LMA.controller import LMAController
lma_ctrl = LMAController()
d, post_filter_brancher, scatter_ctrl, charge_lasso = lma_ctrl.load_hdf5_to_panels(panels, '/data/20130606/LMA/LYLOUT_130606_030000_0600.dat.flash.bk.h5')
In [5]:
#panels.panels['tz'].axis((3*3600, 3*3600 + 0.5*60, 0, 20))
panels.panels['tz'].axis((10805.7, 10806.3, 0, 15))
panels.panels['xy'].axis((-105, -85, -10, 10))
Out[5]:
After adjusting the lower bound on station count below, it's necessary to trigger a reflow of the data down the pipeline. You can do this by dragging the plot to adjust the view bounds. Instead, you can also hook into the event machinery to notify that something changed.
In [26]:
lma_ctrl.bounds.stations=(6,99)
redraw()
In [8]:
charge_lasso.charge=1
panels.lasso()
In [6]:
chg = d.data['charge']
wh = np.where(chg > 0)
print d.data[wh]['time']
In [21]:
scatter_ctrl.color_field = 'chi2'
redraw()
In [22]:
current_data = charge_lasso.cache_segment.cache[-1]
scatter_ctrl.default_color_bounds.flash_id =(current_data['flash_id'].min(), current_data['flash_id'].max())
scatter_ctrl.color_field = 'flash_id'
redraw()
In [7]:
scatter_ctrl.color_field = 'time'
redraw()
In [6]:
anim=scatter_ctrl.animate(5, repeat=False)
In [9]:
anim.repeat = False # stops the animation if repeat=True above
If the LMA controller found flash data, then it's possible to get a live update of flashes in the current view
In [6]:
current_events_flashes = lma_ctrl.flash_stats_for_dataset(d, scatter_ctrl.branchpoint)
In [6]:
In [ ]: