How to work with real data

Computing files

Before running the below commands make sure you have correctly installed and setup your environment.

Download the dataset to tmp directory (create it first). From the base folder run

laueotx realdata singlegrain 0 --conf tmp/config_realdata_fega10_v10_demo.yaml -o results/realdata_fega10_v10_demo/ --n-grid 1000
laueotx realdata singlegrain 1 --conf tmp/config_realdata_fega10_v10_demo.yaml -o results/realdata_fega10_v10_demo/ --n-grid 1000
laueotx realdata multigrain 0 1 --conf tmp/config_realdata_fega10_v10_demo.yaml -o results/realdata_fega10_v10_demo/ --n-grid 1000

We will be analysing the merged output of the previous commands

fname = '../../results/realdata_fega10_v10_demo/analyze_sample__fega10_v10__merged.h5'
spot_loss, s_obs, s_mod, inds_mod, inds_obs, p_lam, s2g_mod_assign, s2g_obs_assign, s2s_mod_assign, s2s_obs_assign = plotting.load_sample(fname)
Code
a_est, x_est = plotting.load_grain_params(fname)
plotting.plotly_scatter3d_sample(a_est, x_est)
Code
omegas = range(0,360,4)

Plot grain statistics

Code
plotting.print_nspots_per_det(inds_obs[1], s2g_obs_assign, tag='detected ')
plotting.print_nspots_per_det(inds_mod[1], s2g_mod_assign, tag='model    ')
spots=detected  total      n_spots=269181 assigned  15698 [5.83%]
spots=detected  detector=0 n_spots=197047 assigned  12959 [6.58%]
spots=detected  detector=1 n_spots= 72134 assigned   2739 [3.80%]
spots=model     total      n_spots= 18889 assigned  15698 [83.11%]
spots=model     detector=0 n_spots= 15363 assigned  12959 [84.35%]
spots=model     detector=1 n_spots=  3526 assigned   2739 [77.68%]
Code
plotting.plotly_grain_stats(s2s_mod_assign, s2s_obs_assign, s2g_mod_assign, s2g_obs_assign, s_obs, s_mod, inds_mod, inds_obs)
n_grains=17

Plot prototype loss

Code
plotting.plotly_spot_loss(fname, n_max=None, xscale='linear', yscale='linear')

Plot spots for a given rotation angle

Code
plotting.plotly_scatter_spots_assignment_per_angle(s_obs=s_obs, inds_obs=inds_obs, s_mod=s_mod, inds_mod=inds_mod, spot_mod_assign=s2g_mod_assign, p_lam=p_lam, omegas=omegas, 
                                                   ind_angle=1, 
                                                   color_obs='darkgrey', 
                                                   lw=0.5, 
                                                   cmap='tab10')

Plot spots for a given grain

Code
plotting.plotly_scatter_spots_assignment_per_grain(s_obs=s_obs, inds_obs=inds_obs, s_mod=s_mod, inds_mod=inds_mod, spot_mod_assign=s2g_mod_assign, spot_obs_assign=s2g_obs_assign, p_lam=p_lam, omegas=omegas, 
                                                   ind_grain=1, 
                                                   color_obs='darkgrey', 
                                                   lw=0.5, 
                                                   cmap='tab10')