-
Notifications
You must be signed in to change notification settings - Fork 14
Run diagnostics
Below we describe a few tools to aid analyzing experimental runs.
The following computes a powder pattern and visualizes the intensity distribution, including spatially to identify regions of the detector with problematic pixels:
from sfx_utils.diagnostics.run import RunDiagnostics
rd = RunDiagnostics(exp='cxip20719', run=34, det_type='jungfrau4M')
rd.compute_run_stats(n_images=1500, powder_only=True)
rd.visualize_powder()
The following can be used to track various event/image statistics over the course of the run:
from sfx_utils.diagnostics.run import RunDiagnostics
rd = RunDiagnostics(exp='mfxp19619', run=19, det_type='epix10k2M')
rd.compute_run_stats(n_images=1500, batch_size=50, max_devs=100)
rd.plot_run_stats(output="run.png") # plots from calibrated images
which produces the plot:
As with the powder calculation, setting n_images
to an absurdly high number will retrieve statistics for all events from the run, and the function will terminate once the end of the run is reached. The statistics are stored in the class variable rd.run_stats
for further analysis. The compute_run_stats
function performs a step of pixel outlier rejection, with the threshold determined by max_devs
. Statistics from the 'clean' run can be plotted as follows:
rd.plot_run_stats(output="run_clean.png", tag='_sel') # plots with additional outlier rejection step
When creating a new page, please add it (in alphabetical order) to the sidebar.