Risø Conference Proceedings 2026 - grazing-incidence case#
This notebook contains the accompanying processing code for the grazing-indidence case to support the Risø Conference Proceedings 2026 paper:
Ball, J. A. D., Andreasen, J. W., Angelis, S. D., Wright, J. P., & Detlefs, C. (2026, July 9). Multi-Beam 3DXRD. IOP Conference Series: Materials Science and Engineering. 46th Risø International Symposium on Materials Science: Characterization of evolving microstructures in metals, DTU Risø Campus, Roskilde, Denmark. Accepted for publication.
[1]:
import os
# don't hog GPU memory (if you have one)
os.environ["XLA_PYTHON_CLIENT_PREALLOCATE"] = "0"
import jax
jax.config.update("jax_enable_x64", True) # required for accuracy, especially strains
import jax.numpy as jnp
import optax
import time
from functools import partial
import scipy
from scipy.spatial.transform import Rotation
from matplotlib import pyplot as plt
import ImageD11.grain
import ImageD11.unitcell
import ImageD11.indexing
from xfab.symmetry import ROTATIONS, Umis
from ImageD11.nbGui.nb_utils import plot_grain_positions, plot_all_ipfs
import anri.crystal, anri.diffract, anri.geom, anri.fwd
start = time.time()
[2]:
### BEAM
# Energies in eV
beam_ev = 12_000
def eV_to_wavelength_A(energy_eV):
# L = hc/E
# Must convert eV to Joules first
wavelength_A = (scipy.constants.h * scipy.constants.c)/(scipy.constants.e*energy_eV)*1e10
return wavelength_A
wavelength = eV_to_wavelength_A(beam_ev)
wavelength
[2]:
1.0332016536100022
Crystallography#
We’ll use cubic Si here
[3]:
struc = anri.crystal.Structure.from_cif("../../../tests/data/cif/Si.cif")
struc.lattice_parameters
[3]:
(5.44370237, 5.44370237, 5.44370237, 90.0, 90.0, 90.0)
We generate some HKLs.
[4]:
struc.make_hkls(dsmax=1.0, wavelength=wavelength)
struc.rings_table
[4]:
| h | k | l | tth | ds | intensity | ring_id |
|---|---|---|---|---|---|---|
| i64 | i64 | i64 | f64 | f64 | f64 | u32 |
| 1 | -1 | 1 | 18.921224 | 0.318175 | 3558.221882 | 0 |
| 1 | 1 | -1 | 18.921224 | 0.318175 | 3558.221882 | 0 |
| 1 | -1 | -1 | 18.921224 | 0.318175 | 3558.221882 | 0 |
| -1 | 1 | -1 | 18.921224 | 0.318175 | 3558.221882 | 0 |
| -1 | 1 | 1 | 18.921224 | 0.318175 | 3558.221882 | 0 |
| … | … | … | … | … | … | … |
| 3 | -3 | 3 | 59.090217 | 0.954525 | 1334.166136 | 6 |
| 3 | 3 | -3 | 59.090217 | 0.954525 | 1334.166136 | 6 |
| 3 | 3 | 3 | 59.090217 | 0.954525 | 1334.166136 | 6 |
| 3 | -3 | -3 | 59.090217 | 0.954525 | 1334.166136 | 6 |
| -3 | -3 | -3 | 59.090217 | 0.954525 | 1334.166136 | 6 |
Phantom sample#
[5]:
rng = 54 # chosen by fair dice roll, guaranteed to be random
key = jax.random.key(rng)
n_grains = 100
### Positions
sample_width = 1000.0
sample_height = 10.0
translations_sample_xy = jax.random.uniform(key, shape=(n_grains,2,), minval=-sample_width/2, maxval=sample_width/2)
translations_sample_z = jax.random.uniform(key, shape=(n_grains,), minval=-sample_height/2, maxval=sample_height/2)
translations_sample = jnp.column_stack((translations_sample_xy, translations_sample_z))
### Orientations
U_matrices = Rotation.random(n_grains, rng=rng).as_matrix()
UB_matrices = U_matrices @ struc.B
UBI_matrices = jnp.linalg.inv(UB_matrices)
### Volumes - just for visualisation purposes!
radii_sigma = 0.2
radii_mean = 50.0
radii = jax.random.lognormal(key, shape=(n_grains,), sigma=radii_sigma) * radii_mean
volumes = (4./3)*jnp.pi*(radii**3)
We can use ImageD11 to plot this phantom.
[6]:
ref_unitcell = ImageD11.unitcell.unitcell(struc.lattice_parameters, symmetry=struc.sgno)
grains = [ImageD11.grain.grain(UBI_matrices[i], translation=translations_sample[i]) for i in range(n_grains)]
for i, g in enumerate(grains):
g.ref_unitcell = ref_unitcell
g.intensity_info = f"mean = {volumes[i]}"
plot_grain_positions(grains, 'z', size_scaling=0.1)
plot_all_ipfs(grains)
Forward projection#
[slow, fast, omega] which represent the centre-of-mass positions of the peaks on the detector surface.[7]:
### Goniometer
wedge = -0.5 # anri now right-handed!
chi = 0.0
y0 = 0.0
### Detector
y_center = 1024.0
z_center = -1024.0
y_size = 50.0
z_size = 50.0
tilt_x = 0.0
tilt_y = jnp.radians(-60.0)
tilt_z = 0.0
distance = 180e3
o11 = 1
o12 = 0
o21 = 0
o22 = 1
# not official parameters but useful for plotting later
det_size_s = 2048
det_size_f = 2048
# Get change-of-basis parameters to go from lab to detector space:
det_trans, beam_cen_shift, x_distance_shift = anri.geom.detector_transforms(
y_center,
y_size,
tilt_y,
z_center,
z_size,
tilt_z,
tilt_x,
distance,
o11,
o12,
o21,
o22
)
# Get detector unit vectors (slow, fast directions) in lab frame:
sc_lab, fc_lab, norm_lab = anri.geom.detector_basis_vectors_lab(det_trans, beam_cen_shift, x_distance_shift)
[8]:
# we get plus/minus Friedel pairs
# we also get boolean masks for validity - sometimes no solution exists for the Ewald condition, so we never see the peak.
k_in_direct = jnp.array([1., 0, 0]) # direct beam wavevector
k_in_refl = anri.geom.rot_y(2*wedge) @ k_in_direct # reflected beam wavevector
centroid_dir_p, valid_dir_p = anri.fwd.get_centroid_box_all(UBI_matrices, translations_sample,
struc.ringhkls_arr,
1.0, wavelength, k_in_direct, 0, 0,
wedge, chi,
sc_lab, fc_lab, norm_lab)
centroid_dir_m, valid_dir_m = anri.fwd.get_centroid_box_all(UBI_matrices, translations_sample,
struc.ringhkls_arr,
-1.0, wavelength, k_in_direct, 0, 0,
wedge, chi,
sc_lab, fc_lab, norm_lab)
centroid_refl_p, valid_refl_p = anri.fwd.get_centroid_box_all(UBI_matrices, translations_sample,
struc.ringhkls_arr,
1.0, wavelength, k_in_refl, 0, 0,
wedge, chi,
sc_lab, fc_lab, norm_lab)
centroid_refl_m, valid_refl_m = anri.fwd.get_centroid_box_all(UBI_matrices, translations_sample,
struc.ringhkls_arr,
-1.0, wavelength, k_in_refl, 0, 0,
wedge, chi,
sc_lab, fc_lab, norm_lab)
# join Friedel pairs into single datasets:
centroid_dir = jnp.concatenate([centroid_dir_p[valid_dir_p], centroid_dir_m[valid_dir_m]])
centroid_refl = jnp.concatenate([centroid_refl_p[valid_refl_p], centroid_refl_m[valid_refl_m]])
# flatten into (N, 3)
centroid_dir = centroid_dir.reshape(-1, 3)
centroid_refl = centroid_refl.reshape(-1, 3)
# mask to detector pixel range
m_dir = (centroid_dir[:, 0] > 0) & (centroid_dir[:, 0] < det_size_f) & (centroid_dir[:, 1] > 0) & (centroid_dir[:, 1] < det_size_s)
m_refl = (centroid_refl[:, 0] > 0) & (centroid_refl[:, 0] < det_size_f) & (centroid_refl[:, 1] > 0) & (centroid_refl[:, 1] < det_size_s)
centroid_dir = centroid_dir[m_dir]
centroid_refl = centroid_refl[m_refl]
[9]:
fig, axs = plt.subplots(1, 2, figsize=(12,20), constrained_layout=True)
axs[0].scatter(centroid_dir[:, 1], centroid_dir[:, 0], label=r'Direct peaks', s=2)
axs[0].scatter(centroid_refl[:, 1], centroid_refl[:, 0], label=r'Reflected peaks', s=2)
axs[0].set_aspect(1)
axs[0].set(xlabel='Detector fast', ylabel='Detector slow', title='Whole detector view', xlim=(0, det_size_f), ylim=(0, det_size_s))
axs[0].legend(loc='upper right')
axs[1].scatter(centroid_dir[:, 1], centroid_dir[:, 0], label=r'Direct peaks')
axs[1].scatter(centroid_refl[:, 1], centroid_refl[:, 0], label=r'Reflected peaks')
axs[1].set_aspect(1)
axs[1].set(xlabel='Detector fast', ylabel='Detector slow', xlim=(300, 450), ylim=(850, 1000), title='Detail view')
axs[1].legend(loc='upper right')
plt.show()
Scattering vector identification#
[10]:
centroid = jnp.concatenate([centroid_dir, centroid_refl])
Simulating experimental error#
[11]:
def spoil_centroids(centroids, width_px, width_omega):
npks = centroids.shape[0]
px_error_vector = jax.random.uniform(key, shape=(npks,2), minval=-width_px/2, maxval=width_px/2)
omega_error_vector = jax.random.uniform(key, shape=(npks,), minval=-width_omega/2, maxval=width_omega/2)
error_vector = jnp.column_stack((px_error_vector, omega_error_vector))
centroids = centroids + error_vector
return centroids
ostep = 0.1 # realistic omega step
centroid_with_error = spoil_centroids(centroid, 1.0, ostep)
[12]:
fig, axs = plt.subplots(1, 2, figsize=(12,20), constrained_layout=True)
axs[0].scatter(centroid[:, 1], centroid[:, 0], label=r'Peaks without error')
axs[0].scatter(centroid_with_error[:, 1], centroid_with_error[:, 0], s=10, label=r'Peaks with error')
axs[0].set_aspect(1)
axs[0].set(xlabel='Detector fast', ylabel='Detector slow', title='Whole detector view')
axs[0].legend(loc='upper right')
axs[1].scatter(centroid[:, 1], centroid[:, 0], label=r'Peaks without error')
axs[1].scatter(centroid_with_error[:, 1], centroid_with_error[:, 0], s=10, label=r'Peaks with error')
axs[1].set_aspect(1)
axs[1].set(xlabel='Detector fast', ylabel='Detector slow', xlim=(300, 450), ylim=(850, 1000), title='Detail view')
axs[1].legend(loc='upper right')
plt.show()
[13]:
# All these primitive functions are written for single vectors
# We write the overall function for a single vector, then vmap it over many vectors for speed:
@jax.jit
def detector_to_q(slow, fast, omega, wavelength, k_in_lab_hat, origin_sample):
# peak vector in lab frame
peak_lab = anri.geom.det_to_lab(slow, fast, det_trans, beam_cen_shift, x_distance_shift)
# rotate origin into sample frame
origin_lab = anri.geom.sample_to_lab(origin_sample, omega, wedge, chi, 0.0, 0.0)
# convert peak vector to k_out, subtracts off the origin
k_out_lab_norm = anri.diffract.peak_lab_to_k_out(peak_lab, origin_lab, wavelength)
# normalise k_in by wavelength
k_in_lab_norm = anri.diffract.scale_norm_k(k_in_lab_hat, wavelength)
# simply q = k_out - k_in
q_lab = anri.diffract.k_to_q_lab(k_in_lab_norm, k_out_lab_norm)
# rotate into sample frame
q_sample = anri.geom.lab_to_sample(q_lab, omega, wedge, chi, 0.0, 0.0)
return q_sample
# the vmap operation
detector_to_q_vec = jax.vmap(detector_to_q, in_axes=(0, 0, 0, 0, 0, None))
[14]:
# Compute scattering vectors for all peaks assuming each beam direction
kvecs_direct = jnp.broadcast_to(k_in_direct, centroid_with_error.shape)
kvecs_refl = jnp.broadcast_to(k_in_refl, centroid_with_error.shape)
wavelengths = jnp.full(centroid_with_error.shape[0], wavelength)
q_sample_direct = detector_to_q_vec(centroid_with_error[:, 0], centroid_with_error[:, 1], centroid_with_error[:, 2], wavelengths, kvecs_direct, jnp.array([0., 0., 0.]))
q_sample_refl = detector_to_q_vec(centroid_with_error[:, 0], centroid_with_error[:, 1], centroid_with_error[:, 2], wavelengths, kvecs_refl, jnp.array([0., 0., 0.]))
k-d tree search#
[15]:
kd_refl = scipy.spatial.cKDTree(q_sample_refl)
# Find the pairs
distances, indices = kd_refl.query(q_sample_direct, k=1, distance_upper_bound=0.01)
valid_mask = jnp.isfinite(distances)
valid_distances = distances[valid_mask]
fig, ax = plt.subplots()
ax.hist(valid_distances, bins=100)
ax.set(xlabel='Distance in g-vector space', ylabel='Count', title='Histogram of g-vector neighbour distances')
plt.show()
We can perhaps discern that a sensible cutoff would be 0.0015 to get the first spike
[16]:
# Find the pairs
distances, indices = kd_refl.query(q_sample_direct, k=1, distance_upper_bound=0.0015)
valid_mask = jnp.isfinite(distances)
valid_distances = distances[valid_mask]
fig, ax = plt.subplots()
ax.hist(valid_distances, bins=50)
ax.set(xlabel='Distance in g-vector space', ylabel='Count', title='Histogram of g-vector neighbour distances')
plt.show()
Now we need to average or combine our observations of the g-vectors.
We have three sources of g-vectors we can possibly index:
G-vectors only from \(K_{\alpha_{1}}\)
G-vectors only from \(K_{\alpha_{2}}\)
Averaged/combined observations of both
[17]:
mask_dir = valid_mask
mask_refl = indices[mask_dir]
q_sample_direct_paired = q_sample_direct[mask_dir]
q_sample_refl_paired = q_sample_refl[mask_refl]
# concatenate
q_sample_cat = jnp.concatenate((q_sample_direct_paired, q_sample_refl_paired))
We can confirm that the deduplication succeeded by masking the centroids array in the same way:
[18]:
fig, axs = plt.subplots(1, 2, figsize=(12,20), constrained_layout=True)
axs[0].scatter(centroid_with_error[:, 1], centroid_with_error[:, 0], s=50, label=r'Direct and reflected beam peaks')
axs[0].scatter(centroid_with_error[:, 1][mask_dir], centroid_with_error[:, 0][mask_dir], s=10, label=r'Deduplicated peaks')
axs[0].set_aspect(1)
axs[0].set(xlabel='Detector fast', ylabel='Detector slow', title='Whole detector view', xlim=(0, det_size_f), ylim=(0, det_size_s))
axs[0].legend(loc='upper right')
axs[1].scatter(centroid_with_error[:, 1], centroid_with_error[:, 0], s=50, label=r'Direct and reflected beam peaks')
axs[1].scatter(centroid_with_error[:, 1][mask_dir], centroid_with_error[:, 0][mask_dir], s=10, label=r'Deduplicated peaks')
axs[1].set_aspect(1)
axs[1].set(xlabel='Detector fast', ylabel='Detector slow', xlim=(300, 450), ylim=(850, 1000), title='Detail view')
axs[1].legend(loc='upper right')
plt.show()
Indexing the recovered scattering vectors#
Just direct beam#
[19]:
# make an indexer
idx_dir = ImageD11.indexing.indexer(unitcell=ref_unitcell, gv=q_sample_direct_paired, minpks=15)
idx_dir.ds_tol = 0.005
idx_dir.assigntorings()
idx_dir.hkl_tol = 0.025
idx_dir.cosine_tol = 0.002
idx_dir.score_all_pairs()
idx_dir.saveubis('grains_found_direct.ubi')
info: gv: [[ 0.10700901 0.2296791 0.19076552]
[-0.03791894 -0.12150881 0.29387471]
[ 0.14969174 -0.19784589 0.2012963 ]
...
[ 0.64378416 0.13183891 0.68684429]
[-0.19340348 0.54675306 0.75445868]
[ 0.42327655 -0.37170832 0.77311619]] (2764, 3) float64
info: Assign to rings, maximum d-spacing considered: 0.959149
info: Ring assignment array shape (2764,)
info: Ring ( h, k, l) Mult total indexed to_index ubis peaks_per_ubi tth
info: Ring 7 ( -1, -5, -1) 32 283 0 283 N/A N/A -57.01
info: Ring 6 ( -2, -4, -2) 24 390 0 390 N/A N/A -53.48
info: Ring 5 ( -3, -1, -3) 24 493 0 493 N/A N/A -47.20
info: Ring 4 ( 0, 0, -4) 6 119 0 119 N/A N/A -43.11
info: Ring 3 ( -2, -2, -2) 8 0 0 0 N/A N/A -37.11
info: Ring 2 ( -1, -1, -3) 24 681 0 681 N/A N/A -35.47
info: Ring 1 ( 0, -2, -2) 12 458 0 458 N/A N/A -30.12
info: Ring 0 ( -1, -1, -1) 8 336 0 336 N/A N/A -18.31
info: Using only those peaks which are assigned to rings for scoring trial matrices
info: Shape of scoring matrix (2760, 3)
info: Assign to rings, maximum d-spacing considered: 0.959149
info: Ring assignment array shape (2764,)
info: Ring ( h, k, l) Mult total indexed to_index ubis peaks_per_ubi tth
info: Ring 7 ( -1, -5, -1) 32 283 0 283 N/A N/A -57.01
info: Ring 6 ( -2, -4, -2) 24 390 0 390 N/A N/A -53.48
info: Ring 5 ( -3, -1, -3) 24 493 0 493 N/A N/A -47.20
info: Ring 4 ( 0, 0, -4) 6 119 0 119 N/A N/A -43.11
info: Ring 3 ( -2, -2, -2) 8 0 0 0 N/A N/A -37.11
info: Ring 2 ( -1, -1, -3) 24 681 0 681 N/A N/A -35.47
info: Ring 1 ( 0, -2, -2) 12 458 0 458 N/A N/A -30.12
info: Ring 0 ( -1, -1, -1) 8 336 0 336 N/A N/A -18.31
info: Using only those peaks which are assigned to rings for scoring trial matrices
info: Shape of scoring matrix (2760, 3)
info: hkls of rings being used for indexing
info: Ring 1: [(0, 0, -4), (0, -4, 0), (-4, 0, 0), (4, 0, 0), (0, 4, 0), (0, 0, 4)]
info: Ring 2: [(0, 0, -4), (0, -4, 0), (-4, 0, 0), (4, 0, 0), (0, 4, 0), (0, 0, 4)]
info: Possible angles and cosines between peaks in rings:
info: 90.000000 0.000000
info: Number of peaks in ring 1: 119
info: Number of peaks in ring 2: 119
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 0
info: Time taken 0.000151 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -1, -1), (-1, 1, -1), (1, -1, -1), (1, 1, -1), (-1, -1, 1), (-1, 1, 1), (1, -1, 1), (1, 1, 1)]
info: Ring 2: [(0, 0, -4), (0, -4, 0), (-4, 0, 0), (4, 0, 0), (0, 4, 0), (0, 0, 4)]
info: Possible angles and cosines between peaks in rings:
info: 54.735610 0.577350
info: 125.264390 -0.577350
info: Number of peaks in ring 1: 336
info: Number of peaks in ring 2: 119
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 221
info: Time taken 0.000448 /s
info: Scoring 221 potential orientations
info: new grain 30 pks, i 1544 j 777 UBI 2.099028 1.765837 -4.710038 -3.628086 -2.993023 -2.729555 -3.470964 4.194636 0.048097
info: new grain 30 pks, i 1543 j 775 UBI 1.282700 2.005436 -4.880591 -2.119185 4.812139 1.421909 4.847585 1.577395 1.945457
info: new grain 27 pks, i 1537 j 754 UBI -3.274711 1.134691 -4.208250 -2.775337 -4.589549 0.941754 -3.342044 2.699586 3.325559
info: new grain 16 pks, i 1533 j 2131 UBI 2.815743 0.804676 -4.598598 -0.877437 5.358219 0.431163 4.574197 0.536493 2.892836
info: new grain 27 pks, i 1526 j 768 UBI 1.740322 -3.390496 -3.889785 -3.062955 2.620351 -3.649905 4.150520 3.359273 -1.087996
info: new grain 29 pks, i 1525 j 2177 UBI -3.017558 -1.864987 -4.148065 4.467814 -2.046317 -2.340419 -0.744876 -4.700232 2.634628
info: new grain 25 pks, i 1519 j 793 UBI 1.500152 -2.427165 -4.642583 -0.810671 4.663274 -2.673643 5.170044 1.435272 0.954163
info: new grain 28 pks, i 1518 j 2124 UBI -1.618694 2.476034 -4.580326 4.363869 -1.955076 -2.587979 -2.828023 -4.435981 -1.398132
info: new grain 20 pks, i 1514 j 2171 UBI -1.155044 2.229609 -4.814577 -3.480225 -4.052107 -1.032956 -4.020637 2.875223 2.317895
info: new grain 21 pks, i 1510 j 762 UBI -2.164036 0.933200 -4.917491 4.993480 0.336628 -2.112726 -0.064916 -5.355297 -1.004681
info: new grain 32 pks, i 1503 j 2139 UBI 1.977313 -1.448388 -4.851277 -5.068081 -0.280173 -1.992030 0.265749 5.241126 -1.459984
info: new grain 27 pks, i 1502 j 2164 UBI 1.594934 1.882545 -4.863301 -0.585634 -4.977656 -2.107177 -5.171381 1.148203 -1.237916
info: new grain 26 pks, i 1501 j 759 UBI -2.789581 1.763024 -4.323204 2.701003 -3.514683 -3.180515 -3.820254 -3.766258 0.905162
info: new grain 24 pks, i 1500 j 2125 UBI -3.647035 -0.472095 -4.006823 3.240525 -3.575005 -2.511903 -2.422155 -4.073414 2.697420
info: new grain 36 pks, i 1491 j 742 UBI 1.028963 -3.658271 -3.887279 -3.012629 2.881299 -3.505353 4.415705 2.818034 -1.495232
info: new grain 30 pks, i 1489 j 2134 UBI 3.235593 0.087695 -4.367545 -3.883453 -2.459542 -2.921644 -2.023789 4.854377 -1.422941
info: new grain 34 pks, i 1486 j 748 UBI 3.190061 -1.873067 -3.983031 4.054937 3.184586 1.749628 1.734431 -4.001443 3.271753
info: new grain 22 pks, i 1482 j 737 UBI -2.763027 -1.580865 -4.433517 0.755812 -5.207905 1.379389 -4.625449 0.100130 2.839858
info: new grain 28 pks, i 1477 j 2162 UBI -2.450164 0.658916 -4.818543 -2.811600 -4.592075 0.793235 -3.965038 2.848542 2.408075
info: new grain 38 pks, i 1476 j 780 UBI 2.984985 -1.997627 -4.077454 -4.381753 0.066418 -3.237473 1.238863 5.065315 -1.587027
info: new grain 30 pks, i 1469 j 763 UBI -2.805661 1.878848 -4.267318 4.575850 0.132573 -2.956769 -0.911789 -5.106677 -1.635387
info: new grain 23 pks, i 1458 j 782 UBI -0.082551 2.633637 -4.773254 0.409946 -4.751138 -2.610830 -5.428354 -0.405689 -0.138442
info: new grain 27 pks, i 1453 j 766 UBI 2.699488 0.763383 -4.654551 -3.485044 -3.316420 -2.557627 -3.199471 4.246782 -1.185600
info: new grain 32 pks, i 1450 j 774 UBI -0.534225 -2.176345 -4.963973 3.350931 -4.053237 1.401331 -4.256955 -2.912422 1.739061
info: new grain 30 pks, i 1444 j 2160 UBI -3.206484 -1.816364 -3.988332 0.442361 -5.065804 1.968546 -4.378078 0.822466 3.141383
info: new grain 26 pks, i 1440 j 769 UBI 0.133021 2.856916 -4.637969 -4.171991 3.031751 1.715096 3.502948 3.503956 2.270064
info: new grain 28 pks, i 1439 j 2176 UBI 2.426852 0.464980 -4.861909 -1.673717 5.167252 -0.355491 4.580472 1.647886 2.422669
info: new grain 26 pks, i 1438 j 2141 UBI 0.596795 3.515997 -4.123382 -5.412858 0.233204 -0.596723 -0.195881 4.147765 3.504174
info: new grain 30 pks, i 1436 j 776 UBI -2.720694 -1.826421 -4.347439 4.516948 0.432378 -3.010852 1.352680 -5.110003 1.292968
info: new grain 29 pks, i 1435 j 2173 UBI -1.881652 2.588595 -4.403665 -4.688976 -2.734791 0.412428 -2.023323 3.933504 3.174804
info: new grain 28 pks, i 1432 j 789 UBI 2.148141 1.635641 -4.735170 -3.297882 -3.407053 -2.660870 -3.762319 3.917357 -0.361942
info: new grain 22 pks, i 1428 j 2132 UBI -1.842253 2.119684 -4.667656 -0.500622 -5.002959 -2.093261 -5.097894 -0.272661 1.859260
info: new grain 24 pks, i 1424 j 749 UBI 2.522428 1.217365 -4.661741 -4.018494 -2.383291 -2.804950 -2.658953 4.739453 -0.188234
info: new grain 30 pks, i 1422 j 784 UBI 2.330902 2.521876 -4.223429 -4.236400 -1.342947 -3.133510 -2.499500 4.633264 1.405668
info: new grain 35 pks, i 1408 j 791 UBI -0.785965 3.209832 -4.309144 -4.976344 1.242315 1.826483 2.059364 4.211097 2.786700
info: new grain 22 pks, i 1406 j 2154 UBI 1.054583 2.015590 -4.948308 0.777845 -5.046035 -1.868365 -5.281398 -0.337429 -1.293847
info: new grain 30 pks, i 1402 j 787 UBI 2.419900 1.014265 -4.784480 0.439786 5.257659 1.328718 4.857312 -0.986331 2.231952
info: new grain 27 pks, i 1399 j 770 UBI 1.967589 1.258893 -4.923158 -0.203046 5.288258 1.266260 5.069101 -0.279701 1.949010
info: new grain 23 pks, i 1388 j 741 UBI 2.100249 -2.640359 -4.283361 -3.152745 2.915738 -3.338411 3.911630 3.765401 -0.379159
info: new grain 26 pks, i 1384 j 2167 UBI 3.372425 1.413093 -4.023016 -4.230720 1.792902 -2.908910 0.568315 4.944601 2.237923
info: new grain 30 pks, i 161 j 756 UBI -2.984093 1.411167 -4.330471 0.365820 -5.085244 -1.927472 -4.541493 -1.335483 2.677671
info: new grain 29 pks, i 153 j 2133 UBI -2.015767 2.560719 -4.360685 -2.515217 -4.578645 -1.554285 -4.386005 1.456415 2.862436
info: new grain 28 pks, i 140 j 2148 UBI -3.782822 -0.531443 -3.852690 -0.848283 -5.156567 1.569783 -3.817327 1.675998 3.510779
info: new grain 18 pks, i 130 j 2121 UBI -2.338214 2.965110 -3.952350 -0.701479 -4.510750 -2.959124 -4.871812 -0.780549 2.292567
info: new grain 24 pks, i 124 j 2166 UBI -1.726429 -2.832030 -4.327376 5.056715 -0.030910 -1.976818 1.025518 -4.653812 2.647728
info: new grain 29 pks, i 123 j 2142 UBI -3.140749 -1.141683 -4.278262 4.268624 0.700062 -3.326049 1.248561 -5.276917 0.506632
info: new grain 18 pks, i 115 j 755 UBI 0.357126 3.656324 -4.027091 0.400155 -4.025809 -3.631796 -5.410953 -0.062239 -0.565299
info: new grain 30 pks, i 106 j 2120 UBI 2.747480 1.922591 -4.282130 -4.622806 1.998582 -2.088501 0.850379 4.682475 2.634829
info: new grain 28 pks, i 40 j 746 UBI -2.115192 -2.375908 -4.418826 5.015286 -0.907646 -1.901758 0.102249 -4.813159 2.549512
info: Number of orientations with more than 15 peaks is 49
info: Time taken 0.008/s
info: UBI for best fitting
[[ 2.98498521 -1.99762695 -4.07745438]
[-4.3817533 0.06641813 -3.23747296]
[ 1.2388625 5.0653148 -1.58702706]]
info: Unit cell: (5.433809378508551, 5.448431378945361, 5.450765932101124, 89.91126104288118, 89.90248876000827, 90.02225411981081)
info: Indexes 38 peaks, with <drlv2>=0.006450
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 1323
info: Tried r1=0 r2=4 attempt 1 of 49, got 49 grains
info: hkls of rings being used for indexing
info: Ring 1: [(0, 0, -4), (0, -4, 0), (-4, 0, 0), (4, 0, 0), (0, 4, 0), (0, 0, 4)]
info: Ring 2: [(-1, -1, -1), (-1, 1, -1), (1, -1, -1), (1, 1, -1), (-1, -1, 1), (-1, 1, 1), (1, -1, 1), (1, 1, 1)]
info: Possible angles and cosines between peaks in rings:
info: 54.735610 0.577350
info: 125.264390 -0.577350
info: Number of peaks in ring 1: 21
info: Number of peaks in ring 2: 148
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 14
info: Time taken 0.000043 /s
info: Scoring 14 potential orientations
info: new grain 24 pks, i 2152 j 146 UBI -2.984863 -0.610360 4.516902 4.325159 1.305611 3.028972 -1.423445 5.250183 -0.258644
info: new grain 30 pks, i 2145 j 1410 UBI -1.522721 -2.454602 4.621759 -0.379335 4.846069 2.444976 -5.210198 0.367298 -1.514628
info: new grain 17 pks, i 2128 j 104 UBI 0.813536 3.209505 4.305607 -2.841996 -3.448430 3.110741 4.569347 -2.714654 1.206907
info: new grain 27 pks, i 765 j 1517 UBI 1.782109 -1.215608 5.005012 -5.095884 -1.156434 1.504897 0.718596 -5.182350 -1.517007
info: Number of orientations with more than 15 peaks is 53
info: Time taken 0.003/s
info: UBI for best fitting
[[ 2.98498521 -1.99762695 -4.07745438]
[-4.3817533 0.06641813 -3.23747296]
[ 1.2388625 5.0653148 -1.58702706]]
info: Unit cell: (5.433809378508551, 5.448431378945361, 5.450765932101124, 89.91126104288118, 89.90248876000827, 90.02225411981081)
info: Indexes 38 peaks, with <drlv2>=0.006450
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 1219
info: Tried r1=4 r2=0 attempt 2 of 49, got 53 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -1, -1), (-1, 1, -1), (1, -1, -1), (1, 1, -1), (-1, -1, 1), (-1, 1, 1), (1, -1, 1), (1, 1, 1)]
info: Ring 2: [(-1, -1, -1), (-1, 1, -1), (1, -1, -1), (1, 1, -1), (-1, -1, 1), (-1, 1, 1), (1, -1, 1), (1, 1, 1)]
info: Possible angles and cosines between peaks in rings:
info: 70.528779 0.333333
info: 109.471221 -0.333333
info: Number of peaks in ring 1: 136
info: Number of peaks in ring 2: 136
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 86
info: Time taken 0.000197 /s
info: Scoring 86 potential orientations
info: new grain 35 pks, i 1545 j 99 UBI -1.638018 -5.177781 -0.441141 -5.169887 1.584702 0.603600 -0.460425 0.576356 -5.389249
info: new grain 30 pks, i 1540 j 1475 UBI -1.746662 -5.086806 -0.844467 -5.117296 1.603272 0.913190 -0.629289 1.082501 -5.299537
info: new grain 28 pks, i 1536 j 52 UBI -0.264274 5.269497 1.343316 0.738682 -1.289628 5.238062 5.387433 0.441270 -0.638520
info: new grain 28 pks, i 1535 j 49 UBI 0.875722 -1.097042 5.259050 -1.406449 5.097891 1.304129 -5.184896 -1.566536 0.530205
info: new grain 34 pks, i 1520 j 11 UBI 0.440242 -0.371816 5.413298 -5.207229 1.496598 0.524463 -1.524098 -5.219420 -0.225921
info: new grain 24 pks, i 1516 j 93 UBI 1.315228 0.834766 5.215945 -3.055750 -4.264991 1.454526 4.308605 -3.279395 -0.559817
info: new grain 22 pks, i 1513 j 6 UBI 1.729398 0.671686 5.123419 -3.237101 -4.066685 1.627926 4.018495 -3.559827 -0.860900
info: new grain 16 pks, i 1507 j 1400 UBI 1.399005 -1.229161 5.125334 -2.366159 4.581052 1.740028 -4.691918 -2.668468 0.606492
info: new grain 22 pks, i 1483 j 81 UBI 1.209665 3.708442 3.796865 1.261310 -3.985188 3.469703 5.158029 0.105763 -1.777364
info: new grain 25 pks, i 1473 j 111 UBI 4.260201 -3.134410 1.270680 -0.699479 1.208076 5.265054 -3.313620 -4.284317 0.525012
info: new grain 26 pks, i 1431 j 24 UBI 4.967050 -1.097792 1.951061 -1.909603 0.320258 5.082811 -1.141173 -5.322498 -0.101461
info: new grain 21 pks, i 1425 j 151 UBI -2.000788 -0.402711 5.039346 3.999231 3.196062 1.841766 -3.102089 4.387479 -0.908514
info: new grain 18 pks, i 1404 j 1427 UBI 2.673870 -4.337513 1.937470 -1.704715 1.184331 5.025843 -4.425758 -3.075820 -0.794563
info: new grain 36 pks, i 1401 j 60 UBI -2.860736 4.613208 0.369679 0.158450 -0.359627 5.430733 4.628892 2.869714 0.072900
info: new grain 30 pks, i 167 j 79 UBI -3.751457 1.763063 3.537192 3.872627 0.761972 3.722382 0.725844 5.091698 -1.806107
info: new grain 24 pks, i 131 j 89 UBI 5.393146 0.407748 0.683785 -0.689751 0.240170 5.387899 0.363856 -5.428194 0.319553
info: new grain 16 pks, i 98 j 1522 UBI 1.257266 -4.921176 1.967696 -1.226893 1.689666 5.030051 -5.150984 -1.602742 -0.684918
info: Number of orientations with more than 15 peaks is 70
info: Time taken 0.004/s
info: UBI for best fitting
[[ 2.98498521 -1.99762695 -4.07745438]
[-4.3817533 0.06641813 -3.23747296]
[ 1.2388625 5.0653148 -1.58702706]]
info: Unit cell: (5.433809378508551, 5.448431378945361, 5.450765932101124, 89.91126104288118, 89.90248876000827, 90.02225411981081)
info: Indexes 38 peaks, with <drlv2>=0.006450
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 739
info: Tried r1=0 r2=0 attempt 3 of 49, got 70 grains
info: hkls of rings being used for indexing
info: Ring 1: [(0, -2, -2), (-2, -2, 0), (2, -2, 0), (-2, 0, -2), (2, 0, -2), (0, -2, 2), (0, 2, -2), (-2, 0, 2), (2, 0, 2), (-2, 2, 0), (2, 2, 0), (0, 2, 2)]
info: Ring 2: [(0, 0, -4), (0, -4, 0), (-4, 0, 0), (4, 0, 0), (0, 4, 0), (0, 0, 4)]
info: Possible angles and cosines between peaks in rings:
info: 45.000000 0.707107
info: 90.000000 0.000000
info: 135.000000 -0.707107
info: Number of peaks in ring 1: 161
info: Number of peaks in ring 2: 12
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 26
info: Time taken 0.000171 /s
info: Scoring 26 potential orientations
info: new grain 24 pks, i 1772 j 2175 UBI -4.782108 -0.801071 2.493357 -1.869720 -2.510020 -4.434780 1.792789 -4.765150 1.941269
info: new grain 24 pks, i 1761 j 788 UBI -3.210660 -3.517878 -2.629767 3.668844 -0.330919 -3.995731 2.427288 -4.135225 2.600770
info: new grain 18 pks, i 1742 j 778 UBI 0.945937 -5.017139 1.862869 2.069964 -1.433666 -4.843635 4.948034 1.563157 1.645773
info: new grain 31 pks, i 1726 j 772 UBI -4.191025 -3.036937 1.672234 -0.357860 -2.245034 -4.956487 3.458760 -3.915378 1.506052
info: new grain 22 pks, i 1676 j 757 UBI -3.753204 3.185985 2.330643 -2.959182 -0.169344 -4.571265 -2.594501 -4.411460 1.824152
info: new grain 28 pks, i 1603 j 745 UBI -2.470465 4.332707 -2.199072 -0.688571 -2.744465 -4.636739 -4.803340 -1.834832 1.816736
info: Number of orientations with more than 15 peaks is 76
info: Time taken 0.003/s
info: UBI for best fitting
[[ 2.98498521 -1.99762695 -4.07745438]
[-4.3817533 0.06641813 -3.23747296]
[ 1.2388625 5.0653148 -1.58702706]]
info: Unit cell: (5.433809378508551, 5.448431378945361, 5.450765932101124, 89.91126104288118, 89.90248876000827, 90.02225411981081)
info: Indexes 38 peaks, with <drlv2>=0.006450
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 577
info: Tried r1=1 r2=4 attempt 4 of 49, got 76 grains
info: no peaks left for those rings
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -1, -1), (-1, 1, -1), (1, -1, -1), (1, 1, -1), (-1, -1, 1), (-1, 1, 1), (1, -1, 1), (1, 1, 1)]
info: Ring 2: [(0, -2, -2), (-2, -2, 0), (2, -2, 0), (-2, 0, -2), (2, 0, -2), (0, -2, 2), (0, 2, -2), (-2, 0, 2), (2, 0, 2), (-2, 2, 0), (2, 2, 0), (0, 2, 2)]
info: Possible angles and cosines between peaks in rings:
info: 35.264390 0.816497
info: 90.000000 0.000000
info: 144.735610 -0.816497
info: Number of peaks in ring 1: 52
info: Number of peaks in ring 2: 136
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 51
info: Time taken 0.000089 /s
info: Scoring 51 potential orientations
info: new grain 24 pks, i 1541 j 314 UBI -1.064261 1.527523 -5.116550 -0.476956 5.168004 1.665918 5.313901 0.780919 -0.850119
info: new grain 16 pks, i 1524 j 1581 UBI -1.282921 -1.372315 -5.117133 -4.519053 3.005712 0.310520 2.743353 4.322291 -1.834541
info: new grain 27 pks, i 1506 j 1585 UBI 0.523612 -5.400894 -0.430930 -1.245902 -0.556459 5.267025 -5.272675 -0.401814 -1.313033
info: new grain 17 pks, i 1495 j 1716 UBI 5.014802 -2.103664 0.055289 -0.629335 -1.402034 5.216586 -2.013590 -4.824655 -1.566282
info: new grain 26 pks, i 1493 j 333 UBI -3.074754 -3.938799 -2.152689 -3.834724 0.934214 3.743396 -2.342568 3.638789 -3.313912
info: new grain 28 pks, i 1481 j 1640 UBI -3.868935 0.583816 -3.771896 -3.029074 2.837223 3.551207 2.347256 4.609842 -1.665503
info: new grain 26 pks, i 1471 j 1746 UBI 4.672649 -2.535021 -1.213469 1.251755 -0.175266 5.289226 -2.504809 -4.817112 0.437616
info: new grain 21 pks, i 1468 j 328 UBI 1.609870 -0.947916 -5.109418 5.088413 1.385459 1.361311 1.077196 -5.180674 1.314052
info: new grain 17 pks, i 1466 j 362 UBI -1.495571 -1.310418 -5.067698 -4.908949 -1.514763 1.867282 -1.851708 5.049452 -0.727756
info: new grain 32 pks, i 1455 j 1733 UBI -5.000663 2.069334 -0.619616 -0.527215 0.270272 5.411437 2.090060 5.025492 -0.028606
info: new grain 30 pks, i 1445 j 1725 UBI 2.083445 -4.974375 -0.780794 0.100621 -0.787826 5.384393 -5.026308 -2.074010 -0.198211
info: new grain 19 pks, i 113 j 270 UBI 3.373556 2.316936 -3.602647 4.119937 -2.975599 1.961009 -1.114419 -3.934081 -3.579813
info: new grain 21 pks, i 13 j 1619 UBI -3.054985 3.888646 -2.302816 1.941420 3.615029 3.560983 4.072574 1.202541 -3.415418
info: Number of orientations with more than 15 peaks is 89
info: Time taken 0.005/s
info: UBI for best fitting
[[ 2.98498521 -1.99762695 -4.07745438]
[-4.3817533 0.06641813 -3.23747296]
[ 1.2388625 5.0653148 -1.58702706]]
info: Unit cell: (5.433809378508551, 5.448431378945361, 5.450765932101124, 89.91126104288118, 89.90248876000827, 90.02225411981081)
info: Indexes 38 peaks, with <drlv2>=0.006450
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 225
info: Tried r1=0 r2=1 attempt 5 of 49, got 89 grains
info: hkls of rings being used for indexing
info: Ring 1: [(0, -2, -2), (-2, -2, 0), (2, -2, 0), (-2, 0, -2), (2, 0, -2), (0, -2, 2), (0, 2, -2), (-2, 0, 2), (2, 0, 2), (-2, 2, 0), (2, 2, 0), (0, 2, 2)]
info: Ring 2: [(-1, -1, -1), (-1, 1, -1), (1, -1, -1), (1, 1, -1), (-1, -1, 1), (-1, 1, 1), (1, -1, 1), (1, 1, 1)]
info: Possible angles and cosines between peaks in rings:
info: 35.264390 0.816497
info: 90.000000 0.000000
info: 144.735610 -0.816497
info: Number of peaks in ring 1: 62
info: Number of peaks in ring 2: 6
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 6
info: Time taken 0.000071 /s
info: Scoring 6 potential orientations
info: new grain 23 pks, i 395 j 1418 UBI -3.015624 -4.427305 0.977197 1.021497 -1.789942 -5.027844 4.411463 -2.602664 1.847940
info: new grain 18 pks, i 185 j 1484 UBI -0.642584 -3.940714 3.723316 4.518447 -2.436842 -1.766930 2.966254 2.856706 3.560140
info: Number of orientations with more than 15 peaks is 91
info: Time taken 0.004/s
info: UBI for best fitting
[[ 2.98498521 -1.99762695 -4.07745438]
[-4.3817533 0.06641813 -3.23747296]
[ 1.2388625 5.0653148 -1.58702706]]
info: Unit cell: (5.433809378508551, 5.448431378945361, 5.450765932101124, 89.91126104288118, 89.90248876000827, 90.02225411981081)
info: Indexes 38 peaks, with <drlv2>=0.006450
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 178
info: Tried r1=1 r2=0 attempt 6 of 49, got 91 grains
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: hkls of rings being used for indexing
info: Ring 1: [(0, -2, -2), (-2, -2, 0), (2, -2, 0), (-2, 0, -2), (2, 0, -2), (0, -2, 2), (0, 2, -2), (-2, 0, 2), (2, 0, 2), (-2, 2, 0), (2, 2, 0), (0, 2, 2)]
info: Ring 2: [(0, -2, -2), (-2, -2, 0), (2, -2, 0), (-2, 0, -2), (2, 0, -2), (0, -2, 2), (0, 2, -2), (-2, 0, 2), (2, 0, 2), (-2, 2, 0), (2, 2, 0), (0, 2, 2)]
info: Possible angles and cosines between peaks in rings:
info: 60.000000 0.500000
info: 90.000000 0.000000
info: 120.000000 -0.500000
info: Number of peaks in ring 1: 52
info: Number of peaks in ring 2: 52
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 50
info: Time taken 0.000074 /s
info: Scoring 50 potential orientations
info: new grain 21 pks, i 1748 j 349 UBI -4.224395 -1.738418 2.965530 3.425076 -2.230945 3.609969 0.057974 4.656311 2.793637
info: new grain 32 pks, i 1702 j 301 UBI -1.460245 1.006790 5.154793 0.391508 -5.306805 1.117587 5.231330 0.680687 1.346781
info: new grain 17 pks, i 1693 j 291 UBI -3.469202 2.160588 3.591139 -0.295158 -4.772928 2.626648 4.188825 1.464079 3.138726
info: new grain 19 pks, i 1677 j 1656 UBI -4.752381 0.157305 2.667500 1.752744 -3.901393 3.346013 1.992972 3.795176 3.365124
info: new grain 18 pks, i 1668 j 1632 UBI -4.400862 1.557472 2.786753 1.115354 -3.727156 3.797706 3.012150 3.640086 2.728769
info: new grain 19 pks, i 1646 j 234 UBI -4.118666 -1.109874 3.366200 3.097662 -3.662694 2.599682 1.751769 3.868245 3.402329
info: new grain 19 pks, i 1624 j 173 UBI -4.130645 -2.022483 2.905568 3.541843 -2.280165 3.464591 -0.062134 4.507755 3.031776
info: new grain 18 pks, i 263 j 1592 UBI 3.336591 -3.213607 2.902568 1.601386 4.296540 2.931499 -3.997962 -0.960819 3.549671
info: Number of orientations with more than 15 peaks is 99
info: Time taken 0.006/s
info: UBI for best fitting
[[ 2.98498521 -1.99762695 -4.07745438]
[-4.3817533 0.06641813 -3.23747296]
[ 1.2388625 5.0653148 -1.58702706]]
info: Unit cell: (5.433809378508551, 5.448431378945361, 5.450765932101124, 89.91126104288118, 89.90248876000827, 90.02225411981081)
info: Indexes 38 peaks, with <drlv2>=0.006450
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 23
info: Tried r1=1 r2=1 attempt 7 of 49, got 99 grains
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: hkls of rings being used for indexing
info: Ring 1: [(0, -2, -2), (-2, -2, 0), (2, -2, 0), (-2, 0, -2), (2, 0, -2), (0, -2, 2), (0, 2, -2), (-2, 0, 2), (2, 0, 2), (-2, 2, 0), (2, 2, 0), (0, 2, 2)]
info: Ring 2: [(-2, -4, -2), (-2, -4, 2), (-4, -2, -2), (-4, -2, 2), (-2, -2, -4), (2, -4, -2), (2, -4, 2), (-2, -2, 4), (2, -2, -4), (-4, 2, -2), (2, -2, 4), (4, -2, -2), (-4, 2, 2), (-2, 2, -4), (4, -2, 2), (-2, 2, 4), (2, 2, -4), (-2, 4, -2), (-2, 4, 2), (2, 2, 4), (4, 2, -2), (4, 2, 2), (2, 4, -2), (2, 4, 2)]
info: Possible angles and cosines between peaks in rings:
info: 30.000000 0.866025
info: 54.735610 0.577350
info: 73.221345 0.288675
info: 90.000000 0.000000
info: 106.778655 -0.288675
info: 125.264390 -0.577350
info: 150.000000 -0.866025
info: Number of peaks in ring 1: 6
info: Number of peaks in ring 2: 2
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 0
info: Time taken 0.000018 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-2, -4, -2), (-2, -4, 2), (-4, -2, -2), (-4, -2, 2), (-2, -2, -4), (2, -4, -2), (2, -4, 2), (-2, -2, 4), (2, -2, -4), (-4, 2, -2), (2, -2, 4), (4, -2, -2), (-4, 2, 2), (-2, 2, -4), (4, -2, 2), (-2, 2, 4), (2, 2, -4), (-2, 4, -2), (-2, 4, 2), (2, 2, 4), (4, 2, -2), (4, 2, 2), (2, 4, -2), (2, 4, 2)]
info: Ring 2: [(0, -2, -2), (-2, -2, 0), (2, -2, 0), (-2, 0, -2), (2, 0, -2), (0, -2, 2), (0, 2, -2), (-2, 0, 2), (2, 0, 2), (-2, 2, 0), (2, 2, 0), (0, 2, 2)]
info: Possible angles and cosines between peaks in rings:
info: 30.000000 0.866025
info: 54.735610 0.577350
info: 73.221345 0.288675
info: 90.000000 0.000000
info: 106.778655 -0.288675
info: 125.264390 -0.577350
info: 150.000000 -0.866025
info: Number of peaks in ring 1: 2
info: Number of peaks in ring 2: 6
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 0
info: Time taken 0.000020 /s
info: hkls of rings being used for indexing
info: Ring 1: [(0, -2, -2), (-2, -2, 0), (2, -2, 0), (-2, 0, -2), (2, 0, -2), (0, -2, 2), (0, 2, -2), (-2, 0, 2), (2, 0, 2), (-2, 2, 0), (2, 2, 0), (0, 2, 2)]
info: Ring 2: [(-3, -1, -3), (-3, 1, -3), (-3, -3, -1), (-1, -3, -3), (-3, -3, 1), (-3, 3, -1), (-1, 3, -3), (1, -3, -3), (-3, 3, 1), (1, 3, -3), (-3, -1, 3), (-3, 1, 3), (3, -1, -3), (3, 1, -3), (-1, -3, 3), (3, -3, -1), (-1, 3, 3), (1, -3, 3), (3, -3, 1), (3, 3, -1), (1, 3, 3), (3, 3, 1), (3, -1, 3), (3, 1, 3)]
info: Possible angles and cosines between peaks in rings:
info: 13.262676 0.973329
info: 49.542360 0.648886
info: 71.068177 0.324443
info: 90.000000 0.000000
info: 108.931823 -0.324443
info: 130.457640 -0.648886
info: 166.737324 -0.973329
info: Number of peaks in ring 1: 6
info: Number of peaks in ring 2: 5
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 6
info: Time taken 0.000015 /s
info: Scoring 6 potential orientations
info: new grain 17 pks, i 1575 j 826 UBI 2.840314 -2.845336 3.647245 0.491098 4.478779 3.081752 -4.624408 -1.259743 2.610287
info: Number of orientations with more than 15 peaks is 100
info: Time taken 0.011/s
info: UBI for best fitting
[[ 2.98498521 -1.99762695 -4.07745438]
[-4.3817533 0.06641813 -3.23747296]
[ 1.2388625 5.0653148 -1.58702706]]
info: Unit cell: (5.433809378508551, 5.448431378945361, 5.450765932101124, 89.91126104288118, 89.90248876000827, 90.02225411981081)
info: Indexes 38 peaks, with <drlv2>=0.006450
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 5
info: Tried r1=1 r2=5 attempt 8 of 49, got 100 grains
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: hkls of rings being used for indexing
info: Ring 1: [(-2, -4, -2), (-2, -4, 2), (-4, -2, -2), (-4, -2, 2), (-2, -2, -4), (2, -4, -2), (2, -4, 2), (-2, -2, 4), (2, -2, -4), (-4, 2, -2), (2, -2, 4), (4, -2, -2), (-4, 2, 2), (-2, 2, -4), (4, -2, 2), (-2, 2, 4), (2, 2, -4), (-2, 4, -2), (-2, 4, 2), (2, 2, 4), (4, 2, -2), (4, 2, 2), (2, 4, -2), (2, 4, 2)]
info: Ring 2: [(-2, -4, -2), (-2, -4, 2), (-4, -2, -2), (-4, -2, 2), (-2, -2, -4), (2, -4, -2), (2, -4, 2), (-2, -2, 4), (2, -2, -4), (-4, 2, -2), (2, -2, 4), (4, -2, -2), (-4, 2, 2), (-2, 2, -4), (4, -2, 2), (-2, 2, 4), (2, 2, -4), (-2, 4, -2), (-2, 4, 2), (2, 2, 4), (4, 2, -2), (4, 2, 2), (2, 4, -2), (2, 4, 2)]
info: Possible angles and cosines between peaks in rings:
info: 33.557310 0.833333
info: 48.189685 0.666667
info: 60.000000 0.500000
info: 70.528779 0.333333
info: 80.405932 0.166667
info: 99.594068 -0.166667
info: 109.471221 -0.333333
info: 120.000000 -0.500000
info: 131.810315 -0.666667
info: 146.442690 -0.833333
info: Number of peaks in ring 1: 2
info: Number of peaks in ring 2: 2
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 0
info: Time taken 0.000014 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-3, -1, -3), (-3, 1, -3), (-3, -3, -1), (-1, -3, -3), (-3, -3, 1), (-3, 3, -1), (-1, 3, -3), (1, -3, -3), (-3, 3, 1), (1, 3, -3), (-3, -1, 3), (-3, 1, 3), (3, -1, -3), (3, 1, -3), (-1, -3, 3), (3, -3, -1), (-1, 3, 3), (1, -3, 3), (3, -3, 1), (3, 3, -1), (1, 3, 3), (3, 3, 1), (3, -1, 3), (3, 1, 3)]
info: Ring 2: [(-2, -4, -2), (-2, -4, 2), (-4, -2, -2), (-4, -2, 2), (-2, -2, -4), (2, -4, -2), (2, -4, 2), (-2, -2, 4), (2, -2, -4), (-4, 2, -2), (2, -2, 4), (4, -2, -2), (-4, 2, 2), (-2, 2, -4), (4, -2, 2), (-2, 2, 4), (2, 2, -4), (-2, 4, -2), (-2, 4, 2), (2, 2, 4), (4, 2, -2), (4, 2, 2), (2, 4, -2), (2, 4, 2)]
info: Possible angles and cosines between peaks in rings:
info: 20.514127 0.936586
info: 41.472934 0.749269
info: 67.998286 0.374634
info: 79.203742 0.187317
info: 100.796258 -0.187317
info: 112.001714 -0.374634
info: 138.527066 -0.749269
info: 159.485873 -0.936586
info: Number of peaks in ring 1: 1
info: Number of peaks in ring 2: 2
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 0
info: Time taken 0.000010 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-2, -4, -2), (-2, -4, 2), (-4, -2, -2), (-4, -2, 2), (-2, -2, -4), (2, -4, -2), (2, -4, 2), (-2, -2, 4), (2, -2, -4), (-4, 2, -2), (2, -2, 4), (4, -2, -2), (-4, 2, 2), (-2, 2, -4), (4, -2, 2), (-2, 2, 4), (2, 2, -4), (-2, 4, -2), (-2, 4, 2), (2, 2, 4), (4, 2, -2), (4, 2, 2), (2, 4, -2), (2, 4, 2)]
info: Ring 2: [(-3, -1, -3), (-3, 1, -3), (-3, -3, -1), (-1, -3, -3), (-3, -3, 1), (-3, 3, -1), (-1, 3, -3), (1, -3, -3), (-3, 3, 1), (1, 3, -3), (-3, -1, 3), (-3, 1, 3), (3, -1, -3), (3, 1, -3), (-1, -3, 3), (3, -3, -1), (-1, 3, 3), (1, -3, 3), (3, -3, 1), (3, 3, -1), (1, 3, 3), (3, 3, 1), (3, -1, 3), (3, 1, 3)]
info: Possible angles and cosines between peaks in rings:
info: 20.514127 0.936586
info: 41.472934 0.749269
info: 67.998286 0.374634
info: 79.203742 0.187317
info: 100.796258 -0.187317
info: 112.001714 -0.374634
info: 138.527066 -0.749269
info: 159.485873 -0.936586
info: Number of peaks in ring 1: 2
info: Number of peaks in ring 2: 1
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 0
info: Time taken 0.000011 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-3, -1, -3), (-3, 1, -3), (-3, -3, -1), (-1, -3, -3), (-3, -3, 1), (-3, 3, -1), (-1, 3, -3), (1, -3, -3), (-3, 3, 1), (1, 3, -3), (-3, -1, 3), (-3, 1, 3), (3, -1, -3), (3, 1, -3), (-1, -3, 3), (3, -3, -1), (-1, 3, 3), (1, -3, 3), (3, -3, 1), (3, 3, -1), (1, 3, 3), (3, 3, 1), (3, -1, 3), (3, 1, 3)]
info: Ring 2: [(-3, -1, -3), (-3, 1, -3), (-3, -3, -1), (-1, -3, -3), (-3, -3, 1), (-3, 3, -1), (-1, 3, -3), (1, -3, -3), (-3, 3, 1), (1, 3, -3), (-3, -1, 3), (-3, 1, 3), (3, -1, -3), (3, 1, -3), (-1, -3, 3), (3, -3, -1), (-1, 3, 3), (1, -3, 3), (3, -3, 1), (3, 3, -1), (1, 3, 3), (3, 3, 1), (3, -1, 3), (3, 1, 3)]
info: Possible angles and cosines between peaks in rings:
info: 26.525352 0.894737
info: 37.863646 0.789474
info: 61.726286 0.473684
info: 80.915280 0.157895
info: 86.983039 0.052632
info: 93.016961 -0.052632
info: 99.084720 -0.157895
info: 118.273714 -0.473684
info: 142.136354 -0.789474
info: 153.474648 -0.894737
info: Number of peaks in ring 1: 1
info: Number of peaks in ring 2: 1
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 0
info: Time taken 0.000012 /s
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: hkls of rings being used for indexing
info: Ring 1: [(-2, -4, -2), (-2, -4, 2), (-4, -2, -2), (-4, -2, 2), (-2, -2, -4), (2, -4, -2), (2, -4, 2), (-2, -2, 4), (2, -2, -4), (-4, 2, -2), (2, -2, 4), (4, -2, -2), (-4, 2, 2), (-2, 2, -4), (4, -2, 2), (-2, 2, 4), (2, 2, -4), (-2, 4, -2), (-2, 4, 2), (2, 2, 4), (4, 2, -2), (4, 2, 2), (2, 4, -2), (2, 4, 2)]
info: Ring 2: [(-1, -5, -1), (1, -5, -1), (-1, -5, 1), (-1, -1, -5), (-5, -1, -1), (1, -5, 1), (1, -1, -5), (-5, -1, 1), (-1, 1, -5), (-5, 1, -1), (1, 1, -5), (-5, 1, 1), (5, -1, -1), (-1, -1, 5), (5, -1, 1), (1, -1, 5), (5, 1, -1), (-1, 1, 5), (-1, 5, -1), (5, 1, 1), (1, 1, 5), (1, 5, -1), (-1, 5, 1), (1, 5, 1), (-3, -3, -3), (-3, -3, 3), (3, -3, -3), (-3, 3, -3), (3, -3, 3), (-3, 3, 3), (3, 3, -3), (3, 3, 3)]
info: Possible angles and cosines between peaks in rings:
info: 19.471221 0.942809
info: 38.216923 0.785674
info: 51.057559 0.628539
info: 61.874494 0.471405
info: 71.683269 0.314270
info: 80.959369 0.157135
info: 90.000000 0.000000
info: 99.040631 -0.157135
info: 108.316731 -0.314270
info: 118.125506 -0.471405
info: 128.942441 -0.628539
info: 141.783077 -0.785674
info: 160.528779 -0.942809
info: Number of peaks in ring 1: 2
info: Number of peaks in ring 2: 2
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 0
info: Time taken 0.000012 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -5, -1), (1, -5, -1), (-1, -5, 1), (-1, -1, -5), (-5, -1, -1), (1, -5, 1), (1, -1, -5), (-5, -1, 1), (-1, 1, -5), (-5, 1, -1), (1, 1, -5), (-5, 1, 1), (5, -1, -1), (-1, -1, 5), (5, -1, 1), (1, -1, 5), (5, 1, -1), (-1, 1, 5), (-1, 5, -1), (5, 1, 1), (1, 1, 5), (1, 5, -1), (-1, 5, 1), (1, 5, 1), (-3, -3, -3), (-3, -3, 3), (3, -3, -3), (-3, 3, -3), (3, -3, 3), (-3, 3, 3), (3, 3, -3), (3, 3, 3)]
info: Ring 2: [(-2, -4, -2), (-2, -4, 2), (-4, -2, -2), (-4, -2, 2), (-2, -2, -4), (2, -4, -2), (2, -4, 2), (-2, -2, 4), (2, -2, -4), (-4, 2, -2), (2, -2, 4), (4, -2, -2), (-4, 2, 2), (-2, 2, -4), (4, -2, 2), (-2, 2, 4), (2, 2, -4), (-2, 4, -2), (-2, 4, 2), (2, 2, 4), (4, 2, -2), (4, 2, 2), (2, 4, -2), (2, 4, 2)]
info: Possible angles and cosines between peaks in rings:
info: 19.471221 0.942809
info: 38.216923 0.785674
info: 51.057559 0.628539
info: 61.874494 0.471405
info: 71.683269 0.314270
info: 80.959369 0.157135
info: 90.000000 0.000000
info: 99.040631 -0.157135
info: 108.316731 -0.314270
info: 118.125506 -0.471405
info: 128.942441 -0.628539
info: 141.783077 -0.785674
info: 160.528779 -0.942809
info: Number of peaks in ring 1: 2
info: Number of peaks in ring 2: 2
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 0
info: Time taken 0.000011 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-3, -1, -3), (-3, 1, -3), (-3, -3, -1), (-1, -3, -3), (-3, -3, 1), (-3, 3, -1), (-1, 3, -3), (1, -3, -3), (-3, 3, 1), (1, 3, -3), (-3, -1, 3), (-3, 1, 3), (3, -1, -3), (3, 1, -3), (-1, -3, 3), (3, -3, -1), (-1, 3, 3), (1, -3, 3), (3, -3, 1), (3, 3, -1), (1, 3, 3), (3, 3, 1), (3, -1, 3), (3, 1, 3)]
info: Ring 2: [(-1, -5, -1), (1, -5, -1), (-1, -5, 1), (-1, -1, -5), (-5, -1, -1), (1, -5, 1), (1, -1, -5), (-5, -1, 1), (-1, 1, -5), (-5, 1, -1), (1, 1, -5), (-5, 1, 1), (5, -1, -1), (-1, -1, 5), (5, -1, 1), (1, -1, 5), (5, 1, -1), (-1, 1, 5), (-1, 5, -1), (5, 1, 1), (1, 1, 5), (1, 5, -1), (-1, 5, 1), (1, 5, 1), (-3, -3, -3), (-3, -3, 3), (3, -3, -3), (-3, 3, -3), (3, -3, 3), (-3, 3, 3), (3, 3, -3), (3, 3, 3)]
info: Possible angles and cosines between peaks in rings:
info: 22.001714 0.927173
info: 32.978962 0.838870
info: 41.360367 0.750568
info: 48.527066 0.662266
info: 54.972886 0.573964
info: 60.944155 0.485662
info: 77.246595 0.220755
info: 82.388621 0.132453
info: 87.469507 0.044151
info: 92.530493 -0.044151
info: 97.611379 -0.132453
info: 102.753405 -0.220755
info: 119.055845 -0.485662
info: 125.027114 -0.573964
info: 131.472934 -0.662266
info: 138.639633 -0.750568
info: 147.021038 -0.838870
info: 157.998286 -0.927173
info: Number of peaks in ring 1: 1
info: Number of peaks in ring 2: 2
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 0
info: Time taken 0.000011 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -5, -1), (1, -5, -1), (-1, -5, 1), (-1, -1, -5), (-5, -1, -1), (1, -5, 1), (1, -1, -5), (-5, -1, 1), (-1, 1, -5), (-5, 1, -1), (1, 1, -5), (-5, 1, 1), (5, -1, -1), (-1, -1, 5), (5, -1, 1), (1, -1, 5), (5, 1, -1), (-1, 1, 5), (-1, 5, -1), (5, 1, 1), (1, 1, 5), (1, 5, -1), (-1, 5, 1), (1, 5, 1), (-3, -3, -3), (-3, -3, 3), (3, -3, -3), (-3, 3, -3), (3, -3, 3), (-3, 3, 3), (3, 3, -3), (3, 3, 3)]
info: Ring 2: [(-3, -1, -3), (-3, 1, -3), (-3, -3, -1), (-1, -3, -3), (-3, -3, 1), (-3, 3, -1), (-1, 3, -3), (1, -3, -3), (-3, 3, 1), (1, 3, -3), (-3, -1, 3), (-3, 1, 3), (3, -1, -3), (3, 1, -3), (-1, -3, 3), (3, -3, -1), (-1, 3, 3), (1, -3, 3), (3, -3, 1), (3, 3, -1), (1, 3, 3), (3, 3, 1), (3, -1, 3), (3, 1, 3)]
info: Possible angles and cosines between peaks in rings:
info: 22.001714 0.927173
info: 32.978962 0.838870
info: 41.360367 0.750568
info: 48.527066 0.662266
info: 54.972886 0.573964
info: 60.944155 0.485662
info: 77.246595 0.220755
info: 82.388621 0.132453
info: 87.469507 0.044151
info: 92.530493 -0.044151
info: 97.611379 -0.132453
info: 102.753405 -0.220755
info: 119.055845 -0.485662
info: 125.027114 -0.573964
info: 131.472934 -0.662266
info: 138.639633 -0.750568
info: 147.021038 -0.838870
info: 157.998286 -0.927173
info: Number of peaks in ring 1: 2
info: Number of peaks in ring 2: 1
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 0
info: Time taken 0.000012 /s
info: no peaks left for those rings
info: no peaks left for those rings
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -5, -1), (1, -5, -1), (-1, -5, 1), (-1, -1, -5), (-5, -1, -1), (1, -5, 1), (1, -1, -5), (-5, -1, 1), (-1, 1, -5), (-5, 1, -1), (1, 1, -5), (-5, 1, 1), (5, -1, -1), (-1, -1, 5), (5, -1, 1), (1, -1, 5), (5, 1, -1), (-1, 1, 5), (-1, 5, -1), (5, 1, 1), (1, 1, 5), (1, 5, -1), (-1, 5, 1), (1, 5, 1), (-3, -3, -3), (-3, -3, 3), (3, -3, -3), (-3, 3, -3), (3, -3, 3), (-3, 3, 3), (3, 3, -3), (3, 3, 3)]
info: Ring 2: [(-1, -5, -1), (1, -5, -1), (-1, -5, 1), (-1, -1, -5), (-5, -1, -1), (1, -5, 1), (1, -1, -5), (-5, -1, 1), (-1, 1, -5), (-5, 1, -1), (1, 1, -5), (-5, 1, 1), (5, -1, -1), (-1, -1, 5), (5, -1, 1), (1, -1, 5), (5, 1, -1), (-1, 1, 5), (-1, 5, -1), (5, 1, 1), (1, 1, 5), (1, 5, -1), (-1, 5, 1), (1, 5, 1), (-3, -3, -3), (-3, -3, 3), (3, -3, -3), (-3, 3, -3), (3, -3, 3), (-3, 3, 3), (3, 3, -3), (3, 3, 3)]
info: Possible angles and cosines between peaks in rings:
info: 22.191607 0.925926
info: 31.586338 0.851852
info: 38.942441 0.777778
info: 56.251011 0.555556
info: 65.957924 0.407407
info: 70.528779 0.333333
info: 87.877449 0.037037
info: 92.122551 -0.037037
info: 109.471221 -0.333333
info: 114.042076 -0.407407
info: 123.748989 -0.555556
info: 141.057559 -0.777778
info: 148.413662 -0.851852
info: 157.808393 -0.925926
info: Number of peaks in ring 1: 2
info: Number of peaks in ring 2: 2
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 0
info: Time taken 0.000012 /s
info:
Tested 8 pairs and found 100 grains so far
Just reflected beam#
[20]:
# make an indexer
idx_refl = ImageD11.indexing.indexer(unitcell=ref_unitcell, gv=q_sample_refl_paired, minpks=15)
idx_refl.ds_tol = 0.005
idx_refl.assigntorings()
idx_refl.hkl_tol = 0.025
idx_refl.cosine_tol = 0.002
idx_refl.score_all_pairs()
idx_refl.saveubis('grains_found_refl.ubi')
info: gv: [[ 0.10670255 0.22951448 0.19081555]
[-0.03788436 -0.12132348 0.29375373]
[ 0.14975004 -0.1978495 0.20148587]
...
[ 0.64362911 0.1321422 0.68670726]
[-0.19368004 0.54663209 0.75434869]
[ 0.42308694 -0.37183459 0.77316786]] (2764, 3) float64
info: Assign to rings, maximum d-spacing considered: 0.959021
info: Ring assignment array shape (2764,)
info: Ring ( h, k, l) Mult total indexed to_index ubis peaks_per_ubi tth
info: Ring 7 ( -1, -5, -1) 32 283 0 283 N/A N/A -57.01
info: Ring 6 ( -4, -2, -2) 24 390 0 390 N/A N/A -53.48
info: Ring 5 ( -1, -3, -3) 24 493 0 493 N/A N/A -47.20
info: Ring 4 ( 0, -4, 0) 6 119 0 119 N/A N/A -43.11
info: Ring 3 ( -2, -2, -2) 8 0 0 0 N/A N/A -37.11
info: Ring 2 ( -1, -3, -1) 24 681 0 681 N/A N/A -35.47
info: Ring 1 ( 0, -2, -2) 12 458 0 458 N/A N/A -30.12
info: Ring 0 ( -1, -1, -1) 8 336 0 336 N/A N/A -18.31
info: Using only those peaks which are assigned to rings for scoring trial matrices
info: Shape of scoring matrix (2760, 3)
info: Assign to rings, maximum d-spacing considered: 0.959021
info: Ring assignment array shape (2764,)
info: Ring ( h, k, l) Mult total indexed to_index ubis peaks_per_ubi tth
info: Ring 7 ( -1, -5, -1) 32 283 0 283 N/A N/A -57.01
info: Ring 6 ( -4, -2, -2) 24 390 0 390 N/A N/A -53.48
info: Ring 5 ( -1, -3, -3) 24 493 0 493 N/A N/A -47.20
info: Ring 4 ( 0, -4, 0) 6 119 0 119 N/A N/A -43.11
info: Ring 3 ( -2, -2, -2) 8 0 0 0 N/A N/A -37.11
info: Ring 2 ( -1, -3, -1) 24 681 0 681 N/A N/A -35.47
info: Ring 1 ( 0, -2, -2) 12 458 0 458 N/A N/A -30.12
info: Ring 0 ( -1, -1, -1) 8 336 0 336 N/A N/A -18.31
info: Using only those peaks which are assigned to rings for scoring trial matrices
info: Shape of scoring matrix (2760, 3)
info: hkls of rings being used for indexing
info: Ring 1: [(0, -4, 0), (-4, 0, 0), (0, 0, -4), (0, 0, 4), (4, 0, 0), (0, 4, 0)]
info: Ring 2: [(0, -4, 0), (-4, 0, 0), (0, 0, -4), (0, 0, 4), (4, 0, 0), (0, 4, 0)]
info: Possible angles and cosines between peaks in rings:
info: 90.000000 0.000000
info: Number of peaks in ring 1: 119
info: Number of peaks in ring 2: 119
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 0
info: Time taken 0.000144 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -1, -1), (-1, 1, -1), (1, -1, -1), (1, 1, -1), (-1, -1, 1), (-1, 1, 1), (1, -1, 1), (1, 1, 1)]
info: Ring 2: [(0, -4, 0), (-4, 0, 0), (0, 0, -4), (0, 0, 4), (4, 0, 0), (0, 4, 0)]
info: Possible angles and cosines between peaks in rings:
info: 54.735610 0.577350
info: 125.264390 -0.577350
info: Number of peaks in ring 1: 336
info: Number of peaks in ring 2: 119
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 221
info: Time taken 0.000431 /s
info: Scoring 221 potential orientations
info: new grain 30 pks, i 1544 j 777 UBI 2.099278 1.765113 -4.710153 -3.627935 -2.992927 -2.729548 -3.470879 4.196082 0.048321
info: new grain 28 pks, i 1543 j 775 UBI 1.282045 2.007187 -4.881797 -2.118834 4.809720 1.423176 4.850166 1.577727 1.946340
info: new grain 27 pks, i 1537 j 754 UBI -3.275900 1.135043 -4.208488 -2.774729 -4.587504 0.941729 -3.342356 2.697943 3.324655
info: new grain 26 pks, i 1530 j 2130 UBI 2.517231 1.216574 -4.660801 -2.658957 4.738736 -0.189755 4.020143 2.384971 2.804515
info: new grain 28 pks, i 1526 j 768 UBI 1.740360 -3.390534 -3.890375 -3.061869 2.621014 -3.648880 4.150817 3.358054 -1.089209
info: new grain 28 pks, i 1525 j 2177 UBI -3.019063 -1.865198 -4.147543 4.468673 -2.046950 -2.341001 -0.742905 -4.700404 2.632895
info: new grain 28 pks, i 1518 j 743 UBI -1.621224 2.476892 -4.580731 4.363839 -1.954557 -2.587484 -2.826770 -4.437092 -1.398121
info: new grain 21 pks, i 1514 j 2171 UBI -1.154570 2.226531 -4.812924 -3.482410 -4.051974 -1.035279 -4.021248 2.875766 2.319276
info: new grain 20 pks, i 1510 j 762 UBI -2.164154 0.932581 -4.918287 4.993943 0.338812 -2.112878 -0.064777 -5.353976 -1.005140
info: new grain 33 pks, i 1503 j 2139 UBI 1.976487 -1.447329 -4.850976 -5.065742 -0.282434 -1.993322 0.267062 5.242075 -1.460036
info: new grain 27 pks, i 1502 j 2164 UBI 1.594879 1.882913 -4.863442 -0.584808 -4.977883 -2.106648 -5.170977 1.148549 -1.238125
info: new grain 26 pks, i 1501 j 759 UBI -2.789428 1.763064 -4.322430 2.702099 -3.515258 -3.181045 -3.818339 -3.765697 0.904615
info: new grain 24 pks, i 1500 j 2125 UBI -3.647992 -0.472264 -4.006501 3.241724 -3.574901 -2.511000 -2.422427 -4.072968 2.698392
info: new grain 38 pks, i 1497 j 780 UBI 2.986012 -1.997118 -4.077299 1.238536 5.065129 -1.587239 4.384516 -0.066053 3.237814
info: new grain 36 pks, i 1491 j 742 UBI 1.029727 -3.658069 -3.886691 -3.013201 2.881691 -3.505385 4.415296 2.818402 -1.494843
info: new grain 30 pks, i 1489 j 753 UBI 3.234752 0.087097 -4.367588 -3.883412 -2.459110 -2.921818 -2.023665 4.855975 -1.423414
info: new grain 34 pks, i 1486 j 748 UBI 3.189240 -1.871803 -3.983070 4.054972 3.184635 1.748847 1.734245 -4.002339 3.272152
info: new grain 21 pks, i 1482 j 737 UBI -2.766926 -1.579827 -4.433442 0.758701 -5.210930 1.376227 -4.624420 0.096914 2.838094
info: new grain 28 pks, i 1477 j 2162 UBI -2.450094 0.657686 -4.818331 -2.810683 -4.591381 0.793530 -3.964979 2.848490 2.408142
info: new grain 30 pks, i 1469 j 763 UBI -2.804897 1.879691 -4.268049 4.576526 0.132631 -2.956632 -0.911007 -5.107347 -1.635201
info: new grain 21 pks, i 1458 j 782 UBI -0.085829 2.630297 -4.771367 0.407238 -4.755765 -2.608409 -5.426130 -0.401268 -0.140906
info: new grain 28 pks, i 1453 j 766 UBI 2.701514 0.765745 -4.654837 -3.483718 -3.313599 -2.558454 -3.200283 4.248475 -1.186877
info: new grain 32 pks, i 1450 j 2155 UBI -0.533233 -2.176986 -4.963381 3.352370 -4.052127 1.401020 -4.256751 -2.912530 1.739067
info: new grain 28 pks, i 1439 j 2176 UBI 2.426296 0.464518 -4.862770 -1.674017 5.167734 -0.355844 4.579247 1.647102 2.421528
info: new grain 29 pks, i 1438 j 2141 UBI 0.597526 3.515275 -4.123950 -5.412814 0.233872 -0.596942 -0.196348 4.148364 3.503779
info: new grain 29 pks, i 1435 j 2173 UBI -1.882424 2.588741 -4.403991 -4.689732 -2.734973 0.412951 -2.025404 3.933905 3.174446
info: new grain 28 pks, i 1432 j 789 UBI 2.148310 1.634904 -4.735549 -3.299371 -3.405605 -2.661037 -3.761514 3.917547 -0.362157
info: new grain 22 pks, i 1428 j 2132 UBI -1.843742 2.119047 -4.668255 -0.498781 -5.005871 -2.092580 -5.096987 -0.273734 1.858929
info: new grain 27 pks, i 1426 j 750 UBI 2.827970 0.808950 -4.593739 -4.567310 -0.536011 -2.891968 -0.882302 5.354444 0.431038
info: new grain 30 pks, i 1422 j 784 UBI 2.330718 2.521967 -4.223342 -4.235024 -1.343460 -3.133413 -2.499058 4.633625 1.405645
info: new grain 30 pks, i 1414 j 776 UBI -2.720857 -1.826547 -4.347004 1.354360 -5.109406 1.292923 -4.516904 -0.433571 3.011359
info: new grain 17 pks, i 1413 j 2174 UBI 1.493265 -2.413713 -4.646307 5.168898 1.429993 0.959991 0.809565 -4.676129 2.673689
info: new grain 35 pks, i 1408 j 791 UBI -0.786317 3.208651 -4.308111 -4.976427 1.243019 1.826374 2.058969 4.211407 2.787879
info: new grain 22 pks, i 1406 j 2154 UBI 1.054995 2.016948 -4.948658 0.775353 -5.045426 -1.868235 -5.282171 -0.335849 -1.293327
info: new grain 30 pks, i 1402 j 787 UBI 2.419873 1.014470 -4.784429 0.440465 5.256095 1.328616 4.856773 -0.984961 2.231062
info: new grain 26 pks, i 1399 j 770 UBI 1.969393 1.259446 -4.923149 -0.204316 5.289579 1.265561 5.069763 -0.278465 1.949647
info: new grain 24 pks, i 1397 j 769 UBI 0.129622 2.854657 -4.639157 -3.503607 -3.502999 -2.269866 -4.172292 3.032868 1.715307
info: new grain 24 pks, i 1388 j 741 UBI 2.097283 -2.637681 -4.282856 -3.153223 2.916667 -3.339231 3.910151 3.764552 -0.378990
info: new grain 26 pks, i 1384 j 2167 UBI 3.372151 1.411823 -4.023431 -4.232084 1.793075 -2.907547 0.566892 4.944446 2.238497
info: new grain 30 pks, i 161 j 756 UBI -2.984716 1.409113 -4.330784 0.367137 -5.084502 -1.927441 -4.539990 -1.334486 2.676785
info: new grain 29 pks, i 153 j 2133 UBI -2.016246 2.559545 -4.360963 -2.517577 -4.579107 -1.555593 -4.386498 1.456526 2.860972
info: new grain 25 pks, i 150 j 2160 UBI -3.206171 -1.817308 -3.986203 4.377647 -0.823974 -3.139512 0.438195 -5.064922 1.970455
info: new grain 28 pks, i 140 j 2148 UBI -3.782673 -0.530084 -3.852701 -0.850998 -5.154532 1.570872 -3.817208 1.674539 3.511161
info: new grain 23 pks, i 124 j 2166 UBI -1.729176 -2.830951 -4.326390 5.058337 -0.033883 -1.977109 1.022286 -4.650663 2.649148
info: new grain 27 pks, i 123 j 2142 UBI -3.141713 -1.141476 -4.277845 4.268797 0.699994 -3.325771 1.248949 -5.276709 0.506723
info: new grain 17 pks, i 115 j 755 UBI 0.357875 3.658902 -4.025581 0.401114 -4.026141 -3.631235 -5.414763 -0.066339 -0.569769
info: new grain 30 pks, i 106 j 2120 UBI 2.746624 1.922593 -4.281943 -4.623957 1.997827 -2.088692 0.848946 4.683028 2.634495
info: new grain 28 pks, i 40 j 746 UBI -2.116298 -2.375693 -4.418707 5.013593 -0.905953 -1.901299 0.100734 -4.812718 2.549090
info: Number of orientations with more than 15 peaks is 48
info: Time taken 0.006/s
info: UBI for best fitting
[[ 2.9860118 -1.99711801 -4.07729872]
[ 1.23853608 5.06512937 -1.58723865]
[ 4.38451616 -0.06605301 3.23781397]]
info: Unit cell: (5.434069532771511, 5.450581040703263, 5.45085170207342, 90.08363643789832, 89.95628793440436, 89.89502116840501)
info: Indexes 38 peaks, with <drlv2>=0.006508
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 1352
info: Tried r1=0 r2=4 attempt 1 of 49, got 48 grains
info: hkls of rings being used for indexing
info: Ring 1: [(0, -4, 0), (-4, 0, 0), (0, 0, -4), (0, 0, 4), (4, 0, 0), (0, 4, 0)]
info: Ring 2: [(-1, -1, -1), (-1, 1, -1), (1, -1, -1), (1, 1, -1), (-1, -1, 1), (-1, 1, 1), (1, -1, 1), (1, 1, 1)]
info: Possible angles and cosines between peaks in rings:
info: 54.735610 0.577350
info: 125.264390 -0.577350
info: Number of peaks in ring 1: 23
info: Number of peaks in ring 2: 150
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 17
info: Time taken 0.000045 /s
info: Scoring 17 potential orientations
info: new grain 24 pks, i 2152 j 146 UBI -2.984175 -0.611157 4.516542 4.324171 1.306225 3.029123 -1.423233 5.250041 -0.259229
info: new grain 29 pks, i 2145 j 1410 UBI -1.524305 -2.454414 4.622190 -0.379600 4.845546 2.444396 -5.211164 0.368309 -1.514318
info: new grain 28 pks, i 765 j 1517 UBI 1.784811 -1.216423 5.005316 -5.095689 -1.156945 1.504644 0.718280 -5.182080 -1.517949
info: new grain 23 pks, i 757 j 1498 UBI 2.957423 0.171254 4.571582 -2.602093 -4.411205 1.823262 3.755127 -3.190552 -2.330412
info: Number of orientations with more than 15 peaks is 52
info: Time taken 0.001/s
info: UBI for best fitting
[[ 2.9860118 -1.99711801 -4.07729872]
[ 1.23853608 5.06512937 -1.58723865]
[ 4.38451616 -0.06605301 3.23781397]]
info: Unit cell: (5.434069532771511, 5.450581040703263, 5.45085170207342, 90.08363643789832, 89.95628793440436, 89.89502116840501)
info: Indexes 38 peaks, with <drlv2>=0.006508
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 1246
info: Tried r1=4 r2=0 attempt 2 of 49, got 52 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -1, -1), (-1, 1, -1), (1, -1, -1), (1, 1, -1), (-1, -1, 1), (-1, 1, 1), (1, -1, 1), (1, 1, 1)]
info: Ring 2: [(-1, -1, -1), (-1, 1, -1), (1, -1, -1), (1, 1, -1), (-1, -1, 1), (-1, 1, 1), (1, -1, 1), (1, 1, 1)]
info: Possible angles and cosines between peaks in rings:
info: 70.528779 0.333333
info: 109.471221 -0.333333
info: Number of peaks in ring 1: 140
info: Number of peaks in ring 2: 140
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 98
info: Time taken 0.000215 /s
info: Scoring 98 potential orientations
info: new grain 36 pks, i 1545 j 99 UBI -1.639069 -5.176785 -0.442038 -5.169416 1.586050 0.602763 -0.462172 0.575484 -5.389800
info: new grain 30 pks, i 1540 j 1475 UBI -1.747113 -5.086773 -0.843659 -5.117409 1.603684 0.913064 -0.630116 1.082946 -5.299941
info: new grain 28 pks, i 1536 j 52 UBI -0.264850 5.269294 1.343171 0.738707 -1.289434 5.238167 5.387551 0.441501 -0.638559
info: new grain 28 pks, i 1535 j 1430 UBI 0.875785 -1.095594 5.258893 -1.406877 5.096793 1.304684 -5.185428 -1.566962 0.529273
info: new grain 17 pks, i 1522 j 98 UBI -1.225944 1.690407 5.031553 1.255924 -4.924374 1.966024 5.151110 1.603126 0.683759
info: new grain 34 pks, i 1520 j 11 UBI 0.440436 -0.372406 5.413907 -5.207033 1.497785 0.524463 -1.524319 -5.220963 -0.225541
info: new grain 24 pks, i 1516 j 93 UBI 1.315212 0.833951 5.215445 -3.056423 -4.262925 1.454635 4.307913 -3.279164 -0.560371
info: new grain 23 pks, i 1513 j 6 UBI 1.730789 0.671478 5.123821 -3.238940 -4.067126 1.626484 4.016247 -3.559571 -0.860229
info: new grain 19 pks, i 1507 j 19 UBI 1.397706 -1.223165 5.123350 -2.366209 4.585105 1.737325 -4.690562 -2.672230 0.607221
info: new grain 19 pks, i 1483 j 81 UBI 1.212374 3.707473 3.796945 1.257244 -3.982352 3.471035 5.157264 0.105263 -1.777566
info: new grain 29 pks, i 1470 j 131 UBI -0.695550 0.232801 5.390190 5.386090 0.408161 0.686834 -0.374152 5.424325 -0.313534
info: new grain 34 pks, i 1455 j 31 UBI 5.002239 -2.073401 0.618225 -0.523569 0.268522 5.410702 -2.090399 -5.022829 0.029253
info: new grain 30 pks, i 1445 j 22 UBI -2.083924 4.973437 0.781348 0.100458 -0.787344 5.384627 5.027306 2.073363 0.197655
info: new grain 26 pks, i 1431 j 24 UBI 4.965860 -1.098283 1.952481 -1.909266 0.320591 5.082787 -1.139333 -5.321729 -0.101290
info: new grain 21 pks, i 1425 j 151 UBI -2.000413 -0.402790 5.038851 3.999544 3.196121 1.841829 -3.103358 4.386667 -0.909143
info: new grain 17 pks, i 1404 j 1427 UBI 2.669445 -4.335330 1.938891 -1.705049 1.184398 5.024269 -4.427284 -3.073115 -0.795340
info: new grain 36 pks, i 1401 j 60 UBI -2.860425 4.613519 0.369408 0.158427 -0.360213 5.430780 4.630080 2.869476 0.073052
info: new grain 30 pks, i 167 j 79 UBI -3.752335 1.761945 3.536904 3.873160 0.760970 3.722853 0.724616 5.091101 -1.806855
info: new grain 25 pks, i 111 j 92 UBI -0.702594 1.211350 5.268318 4.261473 -3.132536 1.270205 3.310793 4.284201 -0.524467
info: new grain 26 pks, i 36 j 1524 UBI 1.288378 1.378822 5.115832 -2.740190 -4.321900 1.834790 4.525808 -3.007487 -0.308544
info: Number of orientations with more than 15 peaks is 72
info: Time taken 0.003/s
info: UBI for best fitting
[[ 2.9860118 -1.99711801 -4.07729872]
[ 1.23853608 5.06512937 -1.58723865]
[ 4.38451616 -0.06605301 3.23781397]]
info: Unit cell: (5.434069532771511, 5.450581040703263, 5.45085170207342, 90.08363643789832, 89.95628793440436, 89.89502116840501)
info: Indexes 38 peaks, with <drlv2>=0.006508
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 675
info: Tried r1=0 r2=0 attempt 3 of 49, got 72 grains
info: hkls of rings being used for indexing
info: Ring 1: [(0, -2, -2), (-2, 0, -2), (-2, -2, 0), (2, 0, -2), (2, -2, 0), (0, 2, -2), (0, -2, 2), (-2, 2, 0), (-2, 0, 2), (2, 2, 0), (2, 0, 2), (0, 2, 2)]
info: Ring 2: [(0, -4, 0), (-4, 0, 0), (0, 0, -4), (0, 0, 4), (4, 0, 0), (0, 4, 0)]
info: Possible angles and cosines between peaks in rings:
info: 45.000000 0.707107
info: 90.000000 0.000000
info: 135.000000 -0.707107
info: Number of peaks in ring 1: 145
info: Number of peaks in ring 2: 14
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 35
info: Time taken 0.000157 /s
info: Scoring 35 potential orientations
info: new grain 25 pks, i 1772 j 794 UBI -4.786342 -0.802880 2.494514 -1.869742 -2.509789 -4.435463 1.790892 -4.763250 1.941543
info: new grain 24 pks, i 1762 j 740 UBI 4.866353 0.763471 -2.298397 -0.709796 -4.503436 -2.952805 -2.337706 2.954767 -3.956122
info: new grain 24 pks, i 1761 j 788 UBI -3.210617 -3.516734 -2.628366 3.668523 -0.331530 -3.996014 2.427930 -4.135551 2.601970
info: new grain 20 pks, i 1742 j 778 UBI 0.944047 -5.013568 1.862014 2.067095 -1.429215 -4.845826 4.949371 1.561348 1.646073
info: new grain 29 pks, i 1726 j 772 UBI -4.191013 -3.034812 1.672448 -0.361400 -2.243569 -4.957902 3.459773 -3.916447 1.505993
info: new grain 28 pks, i 1603 j 745 UBI -2.470871 4.331683 -2.198941 -0.687956 -2.743785 -4.636555 -4.801656 -1.835659 1.816647
info: new grain 24 pks, i 244 j 2128 UBI -2.839764 -3.451622 3.110301 -0.807701 -3.218679 -4.305507 4.576658 -2.709016 1.207685
info: Number of orientations with more than 15 peaks is 79
info: Time taken 0.001/s
info: UBI for best fitting
[[ 2.9860118 -1.99711801 -4.07729872]
[ 1.23853608 5.06512937 -1.58723865]
[ 4.38451616 -0.06605301 3.23781397]]
info: Unit cell: (5.434069532771511, 5.450581040703263, 5.45085170207342, 90.08363643789832, 89.95628793440436, 89.89502116840501)
info: Indexes 38 peaks, with <drlv2>=0.006508
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 486
info: Tried r1=1 r2=4 attempt 4 of 49, got 79 grains
info: no peaks left for those rings
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -1, -1), (-1, 1, -1), (1, -1, -1), (1, 1, -1), (-1, -1, 1), (-1, 1, 1), (1, -1, 1), (1, 1, 1)]
info: Ring 2: [(0, -2, -2), (-2, 0, -2), (-2, -2, 0), (2, 0, -2), (2, -2, 0), (0, 2, -2), (0, -2, 2), (-2, 2, 0), (-2, 0, 2), (2, 2, 0), (2, 0, 2), (0, 2, 2)]
info: Possible angles and cosines between peaks in rings:
info: 35.264390 0.816497
info: 90.000000 0.000000
info: 144.735610 -0.816497
info: Number of peaks in ring 1: 40
info: Number of peaks in ring 2: 116
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 40
info: Time taken 0.000065 /s
info: Scoring 40 potential orientations
info: new grain 26 pks, i 1541 j 314 UBI -1.066128 1.526431 -5.117076 -0.477822 5.169309 1.665376 5.313388 0.780884 -0.849077
info: new grain 27 pks, i 1506 j 1585 UBI 0.523415 -5.400642 -0.431244 -1.244479 -0.557224 5.266780 -5.272433 -0.400752 -1.313395
info: new grain 17 pks, i 1495 j 1716 UBI 5.014823 -2.104288 0.055447 -0.627229 -1.399572 5.217070 -2.012701 -4.824012 -1.566370
info: new grain 20 pks, i 1494 j 1715 UBI -4.111925 2.977483 -1.968623 1.110530 3.939372 3.575206 3.375032 2.312941 -3.597796
info: new grain 26 pks, i 1493 j 1714 UBI -3.076098 -3.937733 -2.152100 -3.836589 0.933744 3.743926 -2.343767 3.638445 -3.313461
info: new grain 28 pks, i 1481 j 1640 UBI -3.867690 0.583089 -3.771357 -3.029237 2.837657 3.552353 2.349007 4.608149 -1.664838
info: new grain 17 pks, i 1466 j 362 UBI -1.483622 -1.314747 -5.069293 -4.898675 -1.506562 1.860553 -1.857349 5.052189 -0.726411
info: new grain 17 pks, i 103 j 1740 UBI -2.955869 -2.861866 -3.561242 0.639777 3.942989 -3.718729 4.525069 -2.427318 -1.766017
info: new grain 17 pks, i 90 j 1711 UBI -1.262765 0.166222 -5.279889 2.485088 4.806979 -0.432229 4.688810 -2.502628 -1.233949
info: new grain 16 pks, i 87 j 328 UBI 1.582979 -0.948487 -5.103021 5.107364 1.383001 1.358855 1.079353 -5.175500 1.318616
info: Number of orientations with more than 15 peaks is 89
info: Time taken 0.001/s
info: UBI for best fitting
[[ 2.9860118 -1.99711801 -4.07729872]
[ 1.23853608 5.06512937 -1.58723865]
[ 4.38451616 -0.06605301 3.23781397]]
info: Unit cell: (5.434069532771511, 5.450581040703263, 5.45085170207342, 90.08363643789832, 89.95628793440436, 89.89502116840501)
info: Indexes 38 peaks, with <drlv2>=0.006508
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 237
info: Tried r1=0 r2=1 attempt 5 of 49, got 89 grains
info: hkls of rings being used for indexing
info: Ring 1: [(0, -2, -2), (-2, 0, -2), (-2, -2, 0), (2, 0, -2), (2, -2, 0), (0, 2, -2), (0, -2, 2), (-2, 2, 0), (-2, 0, 2), (2, 2, 0), (2, 0, 2), (0, 2, 2)]
info: Ring 2: [(-1, -1, -1), (-1, 1, -1), (1, -1, -1), (1, 1, -1), (-1, -1, 1), (-1, 1, 1), (1, -1, 1), (1, 1, 1)]
info: Possible angles and cosines between peaks in rings:
info: 35.264390 0.816497
info: 90.000000 0.000000
info: 144.735610 -0.816497
info: Number of peaks in ring 1: 64
info: Number of peaks in ring 2: 4
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 11
info: Time taken 0.000073 /s
info: Scoring 11 potential orientations
info: new grain 21 pks, i 1658 j 1394 UBI 3.058510 -3.888861 2.302057 4.063760 1.200655 -3.417469 1.951971 3.619833 3.559512
info: new grain 20 pks, i 395 j 1418 UBI -3.011258 -4.429359 0.979018 1.017197 -1.794279 -5.026541 4.410818 -2.601296 1.848683
info: Number of orientations with more than 15 peaks is 91
info: Time taken 0.000/s
info: UBI for best fitting
[[ 2.9860118 -1.99711801 -4.07729872]
[ 1.23853608 5.06512937 -1.58723865]
[ 4.38451616 -0.06605301 3.23781397]]
info: Unit cell: (5.434069532771511, 5.450581040703263, 5.45085170207342, 90.08363643789832, 89.95628793440436, 89.89502116840501)
info: Indexes 38 peaks, with <drlv2>=0.006508
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 191
info: Tried r1=1 r2=0 attempt 6 of 49, got 91 grains
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: hkls of rings being used for indexing
info: Ring 1: [(0, -2, -2), (-2, 0, -2), (-2, -2, 0), (2, 0, -2), (2, -2, 0), (0, 2, -2), (0, -2, 2), (-2, 2, 0), (-2, 0, 2), (2, 2, 0), (2, 0, 2), (0, 2, 2)]
info: Ring 2: [(0, -2, -2), (-2, 0, -2), (-2, -2, 0), (2, 0, -2), (2, -2, 0), (0, 2, -2), (0, -2, 2), (-2, 2, 0), (-2, 0, 2), (2, 2, 0), (2, 0, 2), (0, 2, 2)]
info: Possible angles and cosines between peaks in rings:
info: 60.000000 0.500000
info: 90.000000 0.000000
info: 120.000000 -0.500000
info: Number of peaks in ring 1: 54
info: Number of peaks in ring 2: 54
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 51
info: Time taken 0.000074 /s
info: Scoring 51 potential orientations
info: new grain 21 pks, i 1748 j 349 UBI -4.224090 -1.739827 2.966211 3.424490 -2.231273 3.609998 0.061321 4.657020 2.793422
info: new grain 32 pks, i 1702 j 301 UBI -1.461026 1.007477 5.154976 0.391325 -5.305107 1.117359 5.231721 0.682535 1.346517
info: new grain 17 pks, i 1693 j 291 UBI -3.471430 2.159276 3.591484 -0.293905 -4.773625 2.627299 4.189660 1.463475 3.138011
info: new grain 18 pks, i 1668 j 1632 UBI -4.402400 1.558952 2.785924 1.117105 -3.728980 3.798154 3.013462 3.639741 2.730305
info: new grain 19 pks, i 1646 j 234 UBI -4.117689 -1.108190 3.365187 3.096896 -3.665281 2.601511 1.754192 3.867443 3.402665
info: new grain 19 pks, i 1624 j 173 UBI -4.129500 -2.024167 2.905637 3.542629 -2.279939 3.465959 -0.061455 4.508501 3.030709
info: new grain 19 pks, i 338 j 275 UBI -4.754248 0.157828 2.667526 1.746990 -3.899720 3.346610 1.991241 3.797019 3.364769
info: new grain 18 pks, i 263 j 1592 UBI 3.336978 -3.212006 2.904028 1.602259 4.296546 2.930041 -3.997307 -0.962030 3.549513
info: Number of orientations with more than 15 peaks is 99
info: Time taken 0.002/s
info: UBI for best fitting
[[ 2.9860118 -1.99711801 -4.07729872]
[ 1.23853608 5.06512937 -1.58723865]
[ 4.38451616 -0.06605301 3.23781397]]
info: Unit cell: (5.434069532771511, 5.450581040703263, 5.45085170207342, 90.08363643789832, 89.95628793440436, 89.89502116840501)
info: Indexes 38 peaks, with <drlv2>=0.006508
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 33
info: Tried r1=1 r2=1 attempt 7 of 49, got 99 grains
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: hkls of rings being used for indexing
info: Ring 1: [(0, -2, -2), (-2, 0, -2), (-2, -2, 0), (2, 0, -2), (2, -2, 0), (0, 2, -2), (0, -2, 2), (-2, 2, 0), (-2, 0, 2), (2, 2, 0), (2, 0, 2), (0, 2, 2)]
info: Ring 2: [(-4, -2, -2), (-2, -4, -2), (-2, -2, -4), (-4, -2, 2), (-2, -4, 2), (-4, 2, -2), (-2, -2, 4), (2, -4, -2), (-2, 2, -4), (-4, 2, 2), (2, -2, -4), (2, -4, 2), (-2, 4, -2), (-2, 2, 4), (4, -2, -2), (2, -2, 4), (-2, 4, 2), (2, 2, -4), (4, -2, 2), (2, 4, -2), (4, 2, -2), (2, 2, 4), (2, 4, 2), (4, 2, 2)]
info: Possible angles and cosines between peaks in rings:
info: 30.000000 0.866025
info: 54.735610 0.577350
info: 73.221345 0.288675
info: 90.000000 0.000000
info: 106.778655 -0.288675
info: 125.264390 -0.577350
info: 150.000000 -0.866025
info: Number of peaks in ring 1: 8
info: Number of peaks in ring 2: 3
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 2
info: Time taken 0.000019 /s
info: Scoring 2 potential orientations
info: Number of orientations with more than 15 peaks is 99
info: Time taken 0.011/s
info: UBI for best fitting
[[ 2.9860118 -1.99711801 -4.07729872]
[ 1.23853608 5.06512937 -1.58723865]
[ 4.38451616 -0.06605301 3.23781397]]
info: Unit cell: (5.434069532771511, 5.450581040703263, 5.45085170207342, 90.08363643789832, 89.95628793440436, 89.89502116840501)
info: Indexes 38 peaks, with <drlv2>=0.006508
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 33
info: Tried r1=1 r2=6 attempt 8 of 49, got 99 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-4, -2, -2), (-2, -4, -2), (-2, -2, -4), (-4, -2, 2), (-2, -4, 2), (-4, 2, -2), (-2, -2, 4), (2, -4, -2), (-2, 2, -4), (-4, 2, 2), (2, -2, -4), (2, -4, 2), (-2, 4, -2), (-2, 2, 4), (4, -2, -2), (2, -2, 4), (-2, 4, 2), (2, 2, -4), (4, -2, 2), (2, 4, -2), (4, 2, -2), (2, 2, 4), (2, 4, 2), (4, 2, 2)]
info: Ring 2: [(0, -2, -2), (-2, 0, -2), (-2, -2, 0), (2, 0, -2), (2, -2, 0), (0, 2, -2), (0, -2, 2), (-2, 2, 0), (-2, 0, 2), (2, 2, 0), (2, 0, 2), (0, 2, 2)]
info: Possible angles and cosines between peaks in rings:
info: 30.000000 0.866025
info: 54.735610 0.577350
info: 73.221345 0.288675
info: 90.000000 0.000000
info: 106.778655 -0.288675
info: 125.264390 -0.577350
info: 150.000000 -0.866025
info: Number of peaks in ring 1: 3
info: Number of peaks in ring 2: 8
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 2
info: Time taken 0.000015 /s
info: Scoring 2 potential orientations
info: Number of orientations with more than 15 peaks is 99
info: Time taken 0.011/s
info: UBI for best fitting
[[ 2.9860118 -1.99711801 -4.07729872]
[ 1.23853608 5.06512937 -1.58723865]
[ 4.38451616 -0.06605301 3.23781397]]
info: Unit cell: (5.434069532771511, 5.450581040703263, 5.45085170207342, 90.08363643789832, 89.95628793440436, 89.89502116840501)
info: Indexes 38 peaks, with <drlv2>=0.006508
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 33
info: Tried r1=6 r2=1 attempt 9 of 49, got 99 grains
info: hkls of rings being used for indexing
info: Ring 1: [(0, -2, -2), (-2, 0, -2), (-2, -2, 0), (2, 0, -2), (2, -2, 0), (0, 2, -2), (0, -2, 2), (-2, 2, 0), (-2, 0, 2), (2, 2, 0), (2, 0, 2), (0, 2, 2)]
info: Ring 2: [(-1, -3, -3), (-3, -1, -3), (-3, -3, -1), (1, -3, -3), (-3, 1, -3), (-3, -3, 1), (3, -1, -3), (3, -3, -1), (-1, 3, -3), (3, 1, -3), (-3, 3, -1), (1, 3, -3), (-1, -3, 3), (3, -3, 1), (-3, -1, 3), (1, -3, 3), (-3, 3, 1), (-3, 1, 3), (3, 3, -1), (3, -1, 3), (-1, 3, 3), (3, 3, 1), (3, 1, 3), (1, 3, 3)]
info: Possible angles and cosines between peaks in rings:
info: 13.262676 0.973329
info: 49.542360 0.648886
info: 71.068177 0.324443
info: 90.000000 0.000000
info: 108.931823 -0.324443
info: 130.457640 -0.648886
info: 166.737324 -0.973329
info: Number of peaks in ring 1: 8
info: Number of peaks in ring 2: 11
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 8
info: Time taken 0.000021 /s
info: Scoring 8 potential orientations
info: Number of orientations with more than 15 peaks is 99
info: Time taken 0.000/s
info: UBI for best fitting
[[ 2.9860118 -1.99711801 -4.07729872]
[ 1.23853608 5.06512937 -1.58723865]
[ 4.38451616 -0.06605301 3.23781397]]
info: Unit cell: (5.434069532771511, 5.450581040703263, 5.45085170207342, 90.08363643789832, 89.95628793440436, 89.89502116840501)
info: Indexes 38 peaks, with <drlv2>=0.006508
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 33
info: Tried r1=1 r2=5 attempt 10 of 49, got 99 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -3, -3), (-3, -1, -3), (-3, -3, -1), (1, -3, -3), (-3, 1, -3), (-3, -3, 1), (3, -1, -3), (3, -3, -1), (-1, 3, -3), (3, 1, -3), (-3, 3, -1), (1, 3, -3), (-1, -3, 3), (3, -3, 1), (-3, -1, 3), (1, -3, 3), (-3, 3, 1), (-3, 1, 3), (3, 3, -1), (3, -1, 3), (-1, 3, 3), (3, 3, 1), (3, 1, 3), (1, 3, 3)]
info: Ring 2: [(0, -2, -2), (-2, 0, -2), (-2, -2, 0), (2, 0, -2), (2, -2, 0), (0, 2, -2), (0, -2, 2), (-2, 2, 0), (-2, 0, 2), (2, 2, 0), (2, 0, 2), (0, 2, 2)]
info: Possible angles and cosines between peaks in rings:
info: 13.262676 0.973329
info: 49.542360 0.648886
info: 71.068177 0.324443
info: 90.000000 0.000000
info: 108.931823 -0.324443
info: 130.457640 -0.648886
info: 166.737324 -0.973329
info: Number of peaks in ring 1: 11
info: Number of peaks in ring 2: 8
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 7
info: Time taken 0.000023 /s
info: Scoring 7 potential orientations
info: Number of orientations with more than 15 peaks is 99
info: Time taken 0.011/s
info: UBI for best fitting
[[ 2.9860118 -1.99711801 -4.07729872]
[ 1.23853608 5.06512937 -1.58723865]
[ 4.38451616 -0.06605301 3.23781397]]
info: Unit cell: (5.434069532771511, 5.450581040703263, 5.45085170207342, 90.08363643789832, 89.95628793440436, 89.89502116840501)
info: Indexes 38 peaks, with <drlv2>=0.006508
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 33
info: Tried r1=5 r2=1 attempt 11 of 49, got 99 grains
info: hkls of rings being used for indexing
info: Ring 1: [(0, -2, -2), (-2, 0, -2), (-2, -2, 0), (2, 0, -2), (2, -2, 0), (0, 2, -2), (0, -2, 2), (-2, 2, 0), (-2, 0, 2), (2, 2, 0), (2, 0, 2), (0, 2, 2)]
info: Ring 2: [(-1, -3, -1), (-3, -1, -1), (-1, -3, 1), (-1, -1, -3), (-3, -1, 1), (1, -3, -1), (1, -3, 1), (-3, 1, -1), (1, -1, -3), (-1, 1, -3), (-3, 1, 1), (-1, -1, 3), (1, 1, -3), (3, -1, -1), (1, -1, 3), (-1, 1, 3), (3, -1, 1), (-1, 3, -1), (-1, 3, 1), (3, 1, -1), (1, 1, 3), (1, 3, -1), (3, 1, 1), (1, 3, 1)]
info: Possible angles and cosines between peaks in rings:
info: 31.482154 0.852803
info: 64.760598 0.426401
info: 90.000000 0.000000
info: 115.239402 -0.426401
info: 148.517846 -0.852803
info: Number of peaks in ring 1: 8
info: Number of peaks in ring 2: 7
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 6
info: Time taken 0.000021 /s
info: Scoring 6 potential orientations
info: Number of orientations with more than 15 peaks is 99
info: Time taken 0.011/s
info: UBI for best fitting
[[ 2.9860118 -1.99711801 -4.07729872]
[ 1.23853608 5.06512937 -1.58723865]
[ 4.38451616 -0.06605301 3.23781397]]
info: Unit cell: (5.434069532771511, 5.450581040703263, 5.45085170207342, 90.08363643789832, 89.95628793440436, 89.89502116840501)
info: Indexes 38 peaks, with <drlv2>=0.006508
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 33
info: Tried r1=1 r2=2 attempt 12 of 49, got 99 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -3, -1), (-3, -1, -1), (-1, -3, 1), (-1, -1, -3), (-3, -1, 1), (1, -3, -1), (1, -3, 1), (-3, 1, -1), (1, -1, -3), (-1, 1, -3), (-3, 1, 1), (-1, -1, 3), (1, 1, -3), (3, -1, -1), (1, -1, 3), (-1, 1, 3), (3, -1, 1), (-1, 3, -1), (-1, 3, 1), (3, 1, -1), (1, 1, 3), (1, 3, -1), (3, 1, 1), (1, 3, 1)]
info: Ring 2: [(0, -2, -2), (-2, 0, -2), (-2, -2, 0), (2, 0, -2), (2, -2, 0), (0, 2, -2), (0, -2, 2), (-2, 2, 0), (-2, 0, 2), (2, 2, 0), (2, 0, 2), (0, 2, 2)]
info: Possible angles and cosines between peaks in rings:
info: 31.482154 0.852803
info: 64.760598 0.426401
info: 90.000000 0.000000
info: 115.239402 -0.426401
info: 148.517846 -0.852803
info: Number of peaks in ring 1: 7
info: Number of peaks in ring 2: 8
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 6
info: Time taken 0.000020 /s
info: Scoring 6 potential orientations
info: Number of orientations with more than 15 peaks is 99
info: Time taken 0.011/s
info: UBI for best fitting
[[ 2.9860118 -1.99711801 -4.07729872]
[ 1.23853608 5.06512937 -1.58723865]
[ 4.38451616 -0.06605301 3.23781397]]
info: Unit cell: (5.434069532771511, 5.450581040703263, 5.45085170207342, 90.08363643789832, 89.95628793440436, 89.89502116840501)
info: Indexes 38 peaks, with <drlv2>=0.006508
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 33
info: Tried r1=2 r2=1 attempt 13 of 49, got 99 grains
info: hkls of rings being used for indexing
info: Ring 1: [(0, -2, -2), (-2, 0, -2), (-2, -2, 0), (2, 0, -2), (2, -2, 0), (0, 2, -2), (0, -2, 2), (-2, 2, 0), (-2, 0, 2), (2, 2, 0), (2, 0, 2), (0, 2, 2)]
info: Ring 2: [(-1, -5, -1), (-1, -5, 1), (1, -5, -1), (-5, -1, -1), (1, -5, 1), (-5, -1, 1), (-5, 1, -1), (-5, 1, 1), (-1, -1, -5), (-1, -1, 5), (1, -1, -5), (-1, 1, -5), (1, -1, 5), (-1, 1, 5), (1, 1, -5), (1, 1, 5), (5, -1, -1), (5, -1, 1), (5, 1, -1), (-1, 5, -1), (5, 1, 1), (-1, 5, 1), (1, 5, -1), (1, 5, 1), (-3, -3, -3), (-3, -3, 3), (-3, 3, -3), (3, -3, -3), (-3, 3, 3), (3, -3, 3), (3, 3, -3), (3, 3, 3)]
info: Possible angles and cosines between peaks in rings:
info: 35.264390 0.816497
info: 57.021038 0.544331
info: 74.206831 0.272166
info: 90.000000 0.000000
info: 105.793169 -0.272166
info: 122.978962 -0.544331
info: 144.735610 -0.816497
info: Number of peaks in ring 1: 8
info: Number of peaks in ring 2: 4
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 8
info: Time taken 0.000022 /s
info: Scoring 8 potential orientations
info: new grain 16 pks, i 1575 j 2707 UBI 0.489124 4.482846 3.082319 -4.625638 -1.254810 2.610772 2.838937 -2.837993 3.646634
info: Number of orientations with more than 15 peaks is 100
info: Time taken 0.014/s
info: UBI for best fitting
[[ 2.9860118 -1.99711801 -4.07729872]
[ 1.23853608 5.06512937 -1.58723865]
[ 4.38451616 -0.06605301 3.23781397]]
info: Unit cell: (5.434069532771511, 5.450581040703263, 5.45085170207342, 90.08363643789832, 89.95628793440436, 89.89502116840501)
info: Indexes 38 peaks, with <drlv2>=0.006508
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 15
info: Tried r1=1 r2=7 attempt 14 of 49, got 100 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -5, -1), (-1, -5, 1), (1, -5, -1), (-5, -1, -1), (1, -5, 1), (-5, -1, 1), (-5, 1, -1), (-5, 1, 1), (-1, -1, -5), (-1, -1, 5), (1, -1, -5), (-1, 1, -5), (1, -1, 5), (-1, 1, 5), (1, 1, -5), (1, 1, 5), (5, -1, -1), (5, -1, 1), (5, 1, -1), (-1, 5, -1), (5, 1, 1), (-1, 5, 1), (1, 5, -1), (1, 5, 1), (-3, -3, -3), (-3, -3, 3), (-3, 3, -3), (3, -3, -3), (-3, 3, 3), (3, -3, 3), (3, 3, -3), (3, 3, 3)]
info: Ring 2: [(0, -2, -2), (-2, 0, -2), (-2, -2, 0), (2, 0, -2), (2, -2, 0), (0, 2, -2), (0, -2, 2), (-2, 2, 0), (-2, 0, 2), (2, 2, 0), (2, 0, 2), (0, 2, 2)]
info: Possible angles and cosines between peaks in rings:
info: 35.264390 0.816497
info: 57.021038 0.544331
info: 74.206831 0.272166
info: 90.000000 0.000000
info: 105.793169 -0.272166
info: 122.978962 -0.544331
info: 144.735610 -0.816497
info: Number of peaks in ring 1: 2
info: Number of peaks in ring 2: 2
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 2
info: Time taken 0.000014 /s
info: Scoring 2 potential orientations
info: Number of orientations with more than 15 peaks is 100
info: Time taken 0.016/s
info: UBI for best fitting
[[ 2.9860118 -1.99711801 -4.07729872]
[ 1.23853608 5.06512937 -1.58723865]
[ 4.38451616 -0.06605301 3.23781397]]
info: Unit cell: (5.434069532771511, 5.450581040703263, 5.45085170207342, 90.08363643789832, 89.95628793440436, 89.89502116840501)
info: Indexes 38 peaks, with <drlv2>=0.006508
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 15
info: Tried r1=7 r2=1 attempt 15 of 49, got 100 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-4, -2, -2), (-2, -4, -2), (-2, -2, -4), (-4, -2, 2), (-2, -4, 2), (-4, 2, -2), (-2, -2, 4), (2, -4, -2), (-2, 2, -4), (-4, 2, 2), (2, -2, -4), (2, -4, 2), (-2, 4, -2), (-2, 2, 4), (4, -2, -2), (2, -2, 4), (-2, 4, 2), (2, 2, -4), (4, -2, 2), (2, 4, -2), (4, 2, -2), (2, 2, 4), (2, 4, 2), (4, 2, 2)]
info: Ring 2: [(-4, -2, -2), (-2, -4, -2), (-2, -2, -4), (-4, -2, 2), (-2, -4, 2), (-4, 2, -2), (-2, -2, 4), (2, -4, -2), (-2, 2, -4), (-4, 2, 2), (2, -2, -4), (2, -4, 2), (-2, 4, -2), (-2, 2, 4), (4, -2, -2), (2, -2, 4), (-2, 4, 2), (2, 2, -4), (4, -2, 2), (2, 4, -2), (4, 2, -2), (2, 2, 4), (2, 4, 2), (4, 2, 2)]
info: Possible angles and cosines between peaks in rings:
info: 33.557310 0.833333
info: 48.189685 0.666667
info: 60.000000 0.500000
info: 70.528779 0.333333
info: 80.405932 0.166667
info: 99.594068 -0.166667
info: 109.471221 -0.333333
info: 120.000000 -0.500000
info: 131.810315 -0.666667
info: 146.442690 -0.833333
info: Number of peaks in ring 1: 3
info: Number of peaks in ring 2: 3
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 0
info: Time taken 0.000017 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -3, -3), (-3, -1, -3), (-3, -3, -1), (1, -3, -3), (-3, 1, -3), (-3, -3, 1), (3, -1, -3), (3, -3, -1), (-1, 3, -3), (3, 1, -3), (-3, 3, -1), (1, 3, -3), (-1, -3, 3), (3, -3, 1), (-3, -1, 3), (1, -3, 3), (-3, 3, 1), (-3, 1, 3), (3, 3, -1), (3, -1, 3), (-1, 3, 3), (3, 3, 1), (3, 1, 3), (1, 3, 3)]
info: Ring 2: [(-4, -2, -2), (-2, -4, -2), (-2, -2, -4), (-4, -2, 2), (-2, -4, 2), (-4, 2, -2), (-2, -2, 4), (2, -4, -2), (-2, 2, -4), (-4, 2, 2), (2, -2, -4), (2, -4, 2), (-2, 4, -2), (-2, 2, 4), (4, -2, -2), (2, -2, 4), (-2, 4, 2), (2, 2, -4), (4, -2, 2), (2, 4, -2), (4, 2, -2), (2, 2, 4), (2, 4, 2), (4, 2, 2)]
info: Possible angles and cosines between peaks in rings:
info: 20.514127 0.936586
info: 41.472934 0.749269
info: 67.998286 0.374634
info: 79.203742 0.187317
info: 100.796258 -0.187317
info: 112.001714 -0.374634
info: 138.527066 -0.749269
info: 159.485873 -0.936586
info: Number of peaks in ring 1: 7
info: Number of peaks in ring 2: 3
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 5
info: Time taken 0.000018 /s
info: Scoring 5 potential orientations
info: Number of orientations with more than 15 peaks is 100
info: Time taken 0.021/s
info: UBI for best fitting
[[ 2.9860118 -1.99711801 -4.07729872]
[ 1.23853608 5.06512937 -1.58723865]
[ 4.38451616 -0.06605301 3.23781397]]
info: Unit cell: (5.434069532771511, 5.450581040703263, 5.45085170207342, 90.08363643789832, 89.95628793440436, 89.89502116840501)
info: Indexes 38 peaks, with <drlv2>=0.006508
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 15
info: Tried r1=5 r2=6 attempt 16 of 49, got 100 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-4, -2, -2), (-2, -4, -2), (-2, -2, -4), (-4, -2, 2), (-2, -4, 2), (-4, 2, -2), (-2, -2, 4), (2, -4, -2), (-2, 2, -4), (-4, 2, 2), (2, -2, -4), (2, -4, 2), (-2, 4, -2), (-2, 2, 4), (4, -2, -2), (2, -2, 4), (-2, 4, 2), (2, 2, -4), (4, -2, 2), (2, 4, -2), (4, 2, -2), (2, 2, 4), (2, 4, 2), (4, 2, 2)]
info: Ring 2: [(-1, -3, -3), (-3, -1, -3), (-3, -3, -1), (1, -3, -3), (-3, 1, -3), (-3, -3, 1), (3, -1, -3), (3, -3, -1), (-1, 3, -3), (3, 1, -3), (-3, 3, -1), (1, 3, -3), (-1, -3, 3), (3, -3, 1), (-3, -1, 3), (1, -3, 3), (-3, 3, 1), (-3, 1, 3), (3, 3, -1), (3, -1, 3), (-1, 3, 3), (3, 3, 1), (3, 1, 3), (1, 3, 3)]
info: Possible angles and cosines between peaks in rings:
info: 20.514127 0.936586
info: 41.472934 0.749269
info: 67.998286 0.374634
info: 79.203742 0.187317
info: 100.796258 -0.187317
info: 112.001714 -0.374634
info: 138.527066 -0.749269
info: 159.485873 -0.936586
info: Number of peaks in ring 1: 3
info: Number of peaks in ring 2: 7
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 3
info: Time taken 0.000016 /s
info: Scoring 3 potential orientations
info: Number of orientations with more than 15 peaks is 100
info: Time taken 0.021/s
info: UBI for best fitting
[[ 2.9860118 -1.99711801 -4.07729872]
[ 1.23853608 5.06512937 -1.58723865]
[ 4.38451616 -0.06605301 3.23781397]]
info: Unit cell: (5.434069532771511, 5.450581040703263, 5.45085170207342, 90.08363643789832, 89.95628793440436, 89.89502116840501)
info: Indexes 38 peaks, with <drlv2>=0.006508
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 15
info: Tried r1=6 r2=5 attempt 17 of 49, got 100 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -3, -3), (-3, -1, -3), (-3, -3, -1), (1, -3, -3), (-3, 1, -3), (-3, -3, 1), (3, -1, -3), (3, -3, -1), (-1, 3, -3), (3, 1, -3), (-3, 3, -1), (1, 3, -3), (-1, -3, 3), (3, -3, 1), (-3, -1, 3), (1, -3, 3), (-3, 3, 1), (-3, 1, 3), (3, 3, -1), (3, -1, 3), (-1, 3, 3), (3, 3, 1), (3, 1, 3), (1, 3, 3)]
info: Ring 2: [(-1, -3, -3), (-3, -1, -3), (-3, -3, -1), (1, -3, -3), (-3, 1, -3), (-3, -3, 1), (3, -1, -3), (3, -3, -1), (-1, 3, -3), (3, 1, -3), (-3, 3, -1), (1, 3, -3), (-1, -3, 3), (3, -3, 1), (-3, -1, 3), (1, -3, 3), (-3, 3, 1), (-3, 1, 3), (3, 3, -1), (3, -1, 3), (-1, 3, 3), (3, 3, 1), (3, 1, 3), (1, 3, 3)]
info: Possible angles and cosines between peaks in rings:
info: 26.525352 0.894737
info: 37.863646 0.789474
info: 61.726286 0.473684
info: 80.915280 0.157895
info: 86.983039 0.052632
info: 93.016961 -0.052632
info: 99.084720 -0.157895
info: 118.273714 -0.473684
info: 142.136354 -0.789474
info: 153.474648 -0.894737
info: Number of peaks in ring 1: 7
info: Number of peaks in ring 2: 7
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 5
info: Time taken 0.000020 /s
info: Scoring 5 potential orientations
info: Number of orientations with more than 15 peaks is 100
info: Time taken 0.022/s
info: UBI for best fitting
[[ 2.9860118 -1.99711801 -4.07729872]
[ 1.23853608 5.06512937 -1.58723865]
[ 4.38451616 -0.06605301 3.23781397]]
info: Unit cell: (5.434069532771511, 5.450581040703263, 5.45085170207342, 90.08363643789832, 89.95628793440436, 89.89502116840501)
info: Indexes 38 peaks, with <drlv2>=0.006508
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 15
info: Tried r1=5 r2=5 attempt 18 of 49, got 100 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -3, -1), (-3, -1, -1), (-1, -3, 1), (-1, -1, -3), (-3, -1, 1), (1, -3, -1), (1, -3, 1), (-3, 1, -1), (1, -1, -3), (-1, 1, -3), (-3, 1, 1), (-1, -1, 3), (1, 1, -3), (3, -1, -1), (1, -1, 3), (-1, 1, 3), (3, -1, 1), (-1, 3, -1), (-1, 3, 1), (3, 1, -1), (1, 1, 3), (1, 3, -1), (3, 1, 1), (1, 3, 1)]
info: Ring 2: [(-4, -2, -2), (-2, -4, -2), (-2, -2, -4), (-4, -2, 2), (-2, -4, 2), (-4, 2, -2), (-2, -2, 4), (2, -4, -2), (-2, 2, -4), (-4, 2, 2), (2, -2, -4), (2, -4, 2), (-2, 4, -2), (-2, 2, 4), (4, -2, -2), (2, -2, 4), (-2, 4, 2), (2, 2, -4), (4, -2, 2), (2, 4, -2), (4, 2, -2), (2, 2, 4), (2, 4, 2), (4, 2, 2)]
info: Possible angles and cosines between peaks in rings:
info: 10.024988 0.984732
info: 42.392046 0.738549
info: 60.503792 0.492366
info: 75.748245 0.246183
info: 90.000000 0.000000
info: 104.251755 -0.246183
info: 119.496208 -0.492366
info: 137.607954 -0.738549
info: 169.975012 -0.984732
info: Number of peaks in ring 1: 1
info: Number of peaks in ring 2: 3
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 1
info: Time taken 0.000015 /s
info: Scoring 1 potential orientations
info: Number of orientations with more than 15 peaks is 100
info: Time taken 0.020/s
info: UBI for best fitting
[[ 2.9860118 -1.99711801 -4.07729872]
[ 1.23853608 5.06512937 -1.58723865]
[ 4.38451616 -0.06605301 3.23781397]]
info: Unit cell: (5.434069532771511, 5.450581040703263, 5.45085170207342, 90.08363643789832, 89.95628793440436, 89.89502116840501)
info: Indexes 38 peaks, with <drlv2>=0.006508
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 15
info: Tried r1=2 r2=6 attempt 19 of 49, got 100 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-4, -2, -2), (-2, -4, -2), (-2, -2, -4), (-4, -2, 2), (-2, -4, 2), (-4, 2, -2), (-2, -2, 4), (2, -4, -2), (-2, 2, -4), (-4, 2, 2), (2, -2, -4), (2, -4, 2), (-2, 4, -2), (-2, 2, 4), (4, -2, -2), (2, -2, 4), (-2, 4, 2), (2, 2, -4), (4, -2, 2), (2, 4, -2), (4, 2, -2), (2, 2, 4), (2, 4, 2), (4, 2, 2)]
info: Ring 2: [(-1, -3, -1), (-3, -1, -1), (-1, -3, 1), (-1, -1, -3), (-3, -1, 1), (1, -3, -1), (1, -3, 1), (-3, 1, -1), (1, -1, -3), (-1, 1, -3), (-3, 1, 1), (-1, -1, 3), (1, 1, -3), (3, -1, -1), (1, -1, 3), (-1, 1, 3), (3, -1, 1), (-1, 3, -1), (-1, 3, 1), (3, 1, -1), (1, 1, 3), (1, 3, -1), (3, 1, 1), (1, 3, 1)]
info: Possible angles and cosines between peaks in rings:
info: 10.024988 0.984732
info: 42.392046 0.738549
info: 60.503792 0.492366
info: 75.748245 0.246183
info: 90.000000 0.000000
info: 104.251755 -0.246183
info: 119.496208 -0.492366
info: 137.607954 -0.738549
info: 169.975012 -0.984732
info: Number of peaks in ring 1: 3
info: Number of peaks in ring 2: 1
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 1
info: Time taken 0.000017 /s
info: Scoring 1 potential orientations
info: Number of orientations with more than 15 peaks is 100
info: Time taken 0.019/s
info: UBI for best fitting
[[ 2.9860118 -1.99711801 -4.07729872]
[ 1.23853608 5.06512937 -1.58723865]
[ 4.38451616 -0.06605301 3.23781397]]
info: Unit cell: (5.434069532771511, 5.450581040703263, 5.45085170207342, 90.08363643789832, 89.95628793440436, 89.89502116840501)
info: Indexes 38 peaks, with <drlv2>=0.006508
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 15
info: Tried r1=6 r2=2 attempt 20 of 49, got 100 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -3, -1), (-3, -1, -1), (-1, -3, 1), (-1, -1, -3), (-3, -1, 1), (1, -3, -1), (1, -3, 1), (-3, 1, -1), (1, -1, -3), (-1, 1, -3), (-3, 1, 1), (-1, -1, 3), (1, 1, -3), (3, -1, -1), (1, -1, 3), (-1, 1, 3), (3, -1, 1), (-1, 3, -1), (-1, 3, 1), (3, 1, -1), (1, 1, 3), (1, 3, -1), (3, 1, 1), (1, 3, 1)]
info: Ring 2: [(-1, -3, -3), (-3, -1, -3), (-3, -3, -1), (1, -3, -3), (-3, 1, -3), (-3, -3, 1), (3, -1, -3), (3, -3, -1), (-1, 3, -3), (3, 1, -3), (-3, 3, -1), (1, 3, -3), (-1, -3, 3), (3, -3, 1), (-3, -1, 3), (1, -3, 3), (-3, 3, 1), (-3, 1, 3), (3, 3, -1), (3, -1, 3), (-1, 3, 3), (3, 3, 1), (3, 1, 3), (1, 3, 3)]
info: Possible angles and cosines between peaks in rings:
info: 25.943119 0.899229
info: 40.457640 0.760886
info: 51.497922 0.622543
info: 61.039920 0.484200
info: 69.765867 0.345857
info: 78.023274 0.207514
info: 101.976726 -0.207514
info: 110.234133 -0.345857
info: 118.960080 -0.484200
info: 128.502078 -0.622543
info: 139.542360 -0.760886
info: 154.056881 -0.899229
info: Number of peaks in ring 1: 1
info: Number of peaks in ring 2: 7
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 1
info: Time taken 0.000014 /s
info: Scoring 1 potential orientations
info: Number of orientations with more than 15 peaks is 100
info: Time taken 0.021/s
info: UBI for best fitting
[[ 2.9860118 -1.99711801 -4.07729872]
[ 1.23853608 5.06512937 -1.58723865]
[ 4.38451616 -0.06605301 3.23781397]]
info: Unit cell: (5.434069532771511, 5.450581040703263, 5.45085170207342, 90.08363643789832, 89.95628793440436, 89.89502116840501)
info: Indexes 38 peaks, with <drlv2>=0.006508
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 15
info: Tried r1=2 r2=5 attempt 21 of 49, got 100 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -3, -3), (-3, -1, -3), (-3, -3, -1), (1, -3, -3), (-3, 1, -3), (-3, -3, 1), (3, -1, -3), (3, -3, -1), (-1, 3, -3), (3, 1, -3), (-3, 3, -1), (1, 3, -3), (-1, -3, 3), (3, -3, 1), (-3, -1, 3), (1, -3, 3), (-3, 3, 1), (-3, 1, 3), (3, 3, -1), (3, -1, 3), (-1, 3, 3), (3, 3, 1), (3, 1, 3), (1, 3, 3)]
info: Ring 2: [(-1, -3, -1), (-3, -1, -1), (-1, -3, 1), (-1, -1, -3), (-3, -1, 1), (1, -3, -1), (1, -3, 1), (-3, 1, -1), (1, -1, -3), (-1, 1, -3), (-3, 1, 1), (-1, -1, 3), (1, 1, -3), (3, -1, -1), (1, -1, 3), (-1, 1, 3), (3, -1, 1), (-1, 3, -1), (-1, 3, 1), (3, 1, -1), (1, 1, 3), (1, 3, -1), (3, 1, 1), (1, 3, 1)]
info: Possible angles and cosines between peaks in rings:
info: 25.943119 0.899229
info: 40.457640 0.760886
info: 51.497922 0.622543
info: 61.039920 0.484200
info: 69.765867 0.345857
info: 78.023274 0.207514
info: 101.976726 -0.207514
info: 110.234133 -0.345857
info: 118.960080 -0.484200
info: 128.502078 -0.622543
info: 139.542360 -0.760886
info: 154.056881 -0.899229
info: Number of peaks in ring 1: 7
info: Number of peaks in ring 2: 1
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 1
info: Time taken 0.000020 /s
info: Scoring 1 potential orientations
info: Number of orientations with more than 15 peaks is 100
info: Time taken 0.021/s
info: UBI for best fitting
[[ 2.9860118 -1.99711801 -4.07729872]
[ 1.23853608 5.06512937 -1.58723865]
[ 4.38451616 -0.06605301 3.23781397]]
info: Unit cell: (5.434069532771511, 5.450581040703263, 5.45085170207342, 90.08363643789832, 89.95628793440436, 89.89502116840501)
info: Indexes 38 peaks, with <drlv2>=0.006508
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 15
info: Tried r1=5 r2=2 attempt 22 of 49, got 100 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -3, -1), (-3, -1, -1), (-1, -3, 1), (-1, -1, -3), (-3, -1, 1), (1, -3, -1), (1, -3, 1), (-3, 1, -1), (1, -1, -3), (-1, 1, -3), (-3, 1, 1), (-1, -1, 3), (1, 1, -3), (3, -1, -1), (1, -1, 3), (-1, 1, 3), (3, -1, 1), (-1, 3, -1), (-1, 3, 1), (3, 1, -1), (1, 1, 3), (1, 3, -1), (3, 1, 1), (1, 3, 1)]
info: Ring 2: [(-1, -3, -1), (-3, -1, -1), (-1, -3, 1), (-1, -1, -3), (-3, -1, 1), (1, -3, -1), (1, -3, 1), (-3, 1, -1), (1, -1, -3), (-1, 1, -3), (-3, 1, 1), (-1, -1, 3), (1, 1, -3), (3, -1, -1), (1, -1, 3), (-1, 1, 3), (3, -1, 1), (-1, 3, -1), (-1, 3, 1), (3, 1, -1), (1, 1, 3), (1, 3, -1), (3, 1, 1), (1, 3, 1)]
info: Possible angles and cosines between peaks in rings:
info: 35.096801 0.818182
info: 50.478804 0.636364
info: 62.964308 0.454545
info: 84.784091 0.090909
info: 95.215909 -0.090909
info: 117.035692 -0.454545
info: 129.521196 -0.636364
info: 144.903199 -0.818182
info: Number of peaks in ring 1: 1
info: Number of peaks in ring 2: 1
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 0
info: Time taken 0.000014 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-4, -2, -2), (-2, -4, -2), (-2, -2, -4), (-4, -2, 2), (-2, -4, 2), (-4, 2, -2), (-2, -2, 4), (2, -4, -2), (-2, 2, -4), (-4, 2, 2), (2, -2, -4), (2, -4, 2), (-2, 4, -2), (-2, 2, 4), (4, -2, -2), (2, -2, 4), (-2, 4, 2), (2, 2, -4), (4, -2, 2), (2, 4, -2), (4, 2, -2), (2, 2, 4), (2, 4, 2), (4, 2, 2)]
info: Ring 2: [(-1, -5, -1), (-1, -5, 1), (1, -5, -1), (-5, -1, -1), (1, -5, 1), (-5, -1, 1), (-5, 1, -1), (-5, 1, 1), (-1, -1, -5), (-1, -1, 5), (1, -1, -5), (-1, 1, -5), (1, -1, 5), (-1, 1, 5), (1, 1, -5), (1, 1, 5), (5, -1, -1), (5, -1, 1), (5, 1, -1), (-1, 5, -1), (5, 1, 1), (-1, 5, 1), (1, 5, -1), (1, 5, 1), (-3, -3, -3), (-3, -3, 3), (-3, 3, -3), (3, -3, -3), (-3, 3, 3), (3, -3, 3), (3, 3, -3), (3, 3, 3)]
info: Possible angles and cosines between peaks in rings:
info: 19.471221 0.942809
info: 38.216923 0.785674
info: 51.057559 0.628539
info: 61.874494 0.471405
info: 71.683269 0.314270
info: 80.959369 0.157135
info: 90.000000 0.000000
info: 99.040631 -0.157135
info: 108.316731 -0.314270
info: 118.125506 -0.471405
info: 128.942441 -0.628539
info: 141.783077 -0.785674
info: 160.528779 -0.942809
info: Number of peaks in ring 1: 3
info: Number of peaks in ring 2: 2
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 2
info: Time taken 0.000014 /s
info: Scoring 2 potential orientations
info: Number of orientations with more than 15 peaks is 100
info: Time taken 0.029/s
info: UBI for best fitting
[[ 2.9860118 -1.99711801 -4.07729872]
[ 1.23853608 5.06512937 -1.58723865]
[ 4.38451616 -0.06605301 3.23781397]]
info: Unit cell: (5.434069532771511, 5.450581040703263, 5.45085170207342, 90.08363643789832, 89.95628793440436, 89.89502116840501)
info: Indexes 38 peaks, with <drlv2>=0.006508
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 15
info: Tried r1=6 r2=7 attempt 23 of 49, got 100 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -5, -1), (-1, -5, 1), (1, -5, -1), (-5, -1, -1), (1, -5, 1), (-5, -1, 1), (-5, 1, -1), (-5, 1, 1), (-1, -1, -5), (-1, -1, 5), (1, -1, -5), (-1, 1, -5), (1, -1, 5), (-1, 1, 5), (1, 1, -5), (1, 1, 5), (5, -1, -1), (5, -1, 1), (5, 1, -1), (-1, 5, -1), (5, 1, 1), (-1, 5, 1), (1, 5, -1), (1, 5, 1), (-3, -3, -3), (-3, -3, 3), (-3, 3, -3), (3, -3, -3), (-3, 3, 3), (3, -3, 3), (3, 3, -3), (3, 3, 3)]
info: Ring 2: [(-4, -2, -2), (-2, -4, -2), (-2, -2, -4), (-4, -2, 2), (-2, -4, 2), (-4, 2, -2), (-2, -2, 4), (2, -4, -2), (-2, 2, -4), (-4, 2, 2), (2, -2, -4), (2, -4, 2), (-2, 4, -2), (-2, 2, 4), (4, -2, -2), (2, -2, 4), (-2, 4, 2), (2, 2, -4), (4, -2, 2), (2, 4, -2), (4, 2, -2), (2, 2, 4), (2, 4, 2), (4, 2, 2)]
info: Possible angles and cosines between peaks in rings:
info: 19.471221 0.942809
info: 38.216923 0.785674
info: 51.057559 0.628539
info: 61.874494 0.471405
info: 71.683269 0.314270
info: 80.959369 0.157135
info: 90.000000 0.000000
info: 99.040631 -0.157135
info: 108.316731 -0.314270
info: 118.125506 -0.471405
info: 128.942441 -0.628539
info: 141.783077 -0.785674
info: 160.528779 -0.942809
info: Number of peaks in ring 1: 2
info: Number of peaks in ring 2: 3
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 2
info: Time taken 0.000020 /s
info: Scoring 2 potential orientations
info: Number of orientations with more than 15 peaks is 100
info: Time taken 0.028/s
info: UBI for best fitting
[[ 2.9860118 -1.99711801 -4.07729872]
[ 1.23853608 5.06512937 -1.58723865]
[ 4.38451616 -0.06605301 3.23781397]]
info: Unit cell: (5.434069532771511, 5.450581040703263, 5.45085170207342, 90.08363643789832, 89.95628793440436, 89.89502116840501)
info: Indexes 38 peaks, with <drlv2>=0.006508
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 15
info: Tried r1=7 r2=6 attempt 24 of 49, got 100 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -3, -3), (-3, -1, -3), (-3, -3, -1), (1, -3, -3), (-3, 1, -3), (-3, -3, 1), (3, -1, -3), (3, -3, -1), (-1, 3, -3), (3, 1, -3), (-3, 3, -1), (1, 3, -3), (-1, -3, 3), (3, -3, 1), (-3, -1, 3), (1, -3, 3), (-3, 3, 1), (-3, 1, 3), (3, 3, -1), (3, -1, 3), (-1, 3, 3), (3, 3, 1), (3, 1, 3), (1, 3, 3)]
info: Ring 2: [(-1, -5, -1), (-1, -5, 1), (1, -5, -1), (-5, -1, -1), (1, -5, 1), (-5, -1, 1), (-5, 1, -1), (-5, 1, 1), (-1, -1, -5), (-1, -1, 5), (1, -1, -5), (-1, 1, -5), (1, -1, 5), (-1, 1, 5), (1, 1, -5), (1, 1, 5), (5, -1, -1), (5, -1, 1), (5, 1, -1), (-1, 5, -1), (5, 1, 1), (-1, 5, 1), (1, 5, -1), (1, 5, 1), (-3, -3, -3), (-3, -3, 3), (-3, 3, -3), (3, -3, -3), (-3, 3, 3), (3, -3, 3), (3, 3, -3), (3, 3, 3)]
info: Possible angles and cosines between peaks in rings:
info: 22.001714 0.927173
info: 32.978962 0.838870
info: 41.360367 0.750568
info: 48.527066 0.662266
info: 54.972886 0.573964
info: 60.944155 0.485662
info: 77.246595 0.220755
info: 82.388621 0.132453
info: 87.469507 0.044151
info: 92.530493 -0.044151
info: 97.611379 -0.132453
info: 102.753405 -0.220755
info: 119.055845 -0.485662
info: 125.027114 -0.573964
info: 131.472934 -0.662266
info: 138.639633 -0.750568
info: 147.021038 -0.838870
info: 157.998286 -0.927173
info: Number of peaks in ring 1: 7
info: Number of peaks in ring 2: 2
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 3
info: Time taken 0.000021 /s
info: Scoring 3 potential orientations
info: Number of orientations with more than 15 peaks is 100
info: Time taken 0.029/s
info: UBI for best fitting
[[ 2.9860118 -1.99711801 -4.07729872]
[ 1.23853608 5.06512937 -1.58723865]
[ 4.38451616 -0.06605301 3.23781397]]
info: Unit cell: (5.434069532771511, 5.450581040703263, 5.45085170207342, 90.08363643789832, 89.95628793440436, 89.89502116840501)
info: Indexes 38 peaks, with <drlv2>=0.006508
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 15
info: Tried r1=5 r2=7 attempt 25 of 49, got 100 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -5, -1), (-1, -5, 1), (1, -5, -1), (-5, -1, -1), (1, -5, 1), (-5, -1, 1), (-5, 1, -1), (-5, 1, 1), (-1, -1, -5), (-1, -1, 5), (1, -1, -5), (-1, 1, -5), (1, -1, 5), (-1, 1, 5), (1, 1, -5), (1, 1, 5), (5, -1, -1), (5, -1, 1), (5, 1, -1), (-1, 5, -1), (5, 1, 1), (-1, 5, 1), (1, 5, -1), (1, 5, 1), (-3, -3, -3), (-3, -3, 3), (-3, 3, -3), (3, -3, -3), (-3, 3, 3), (3, -3, 3), (3, 3, -3), (3, 3, 3)]
info: Ring 2: [(-1, -3, -3), (-3, -1, -3), (-3, -3, -1), (1, -3, -3), (-3, 1, -3), (-3, -3, 1), (3, -1, -3), (3, -3, -1), (-1, 3, -3), (3, 1, -3), (-3, 3, -1), (1, 3, -3), (-1, -3, 3), (3, -3, 1), (-3, -1, 3), (1, -3, 3), (-3, 3, 1), (-3, 1, 3), (3, 3, -1), (3, -1, 3), (-1, 3, 3), (3, 3, 1), (3, 1, 3), (1, 3, 3)]
info: Possible angles and cosines between peaks in rings:
info: 22.001714 0.927173
info: 32.978962 0.838870
info: 41.360367 0.750568
info: 48.527066 0.662266
info: 54.972886 0.573964
info: 60.944155 0.485662
info: 77.246595 0.220755
info: 82.388621 0.132453
info: 87.469507 0.044151
info: 92.530493 -0.044151
info: 97.611379 -0.132453
info: 102.753405 -0.220755
info: 119.055845 -0.485662
info: 125.027114 -0.573964
info: 131.472934 -0.662266
info: 138.639633 -0.750568
info: 147.021038 -0.838870
info: 157.998286 -0.927173
info: Number of peaks in ring 1: 2
info: Number of peaks in ring 2: 7
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 2
info: Time taken 0.000015 /s
info: Scoring 2 potential orientations
info: Number of orientations with more than 15 peaks is 100
info: Time taken 0.028/s
info: UBI for best fitting
[[ 2.9860118 -1.99711801 -4.07729872]
[ 1.23853608 5.06512937 -1.58723865]
[ 4.38451616 -0.06605301 3.23781397]]
info: Unit cell: (5.434069532771511, 5.450581040703263, 5.45085170207342, 90.08363643789832, 89.95628793440436, 89.89502116840501)
info: Indexes 38 peaks, with <drlv2>=0.006508
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 15
info: Tried r1=7 r2=5 attempt 26 of 49, got 100 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -3, -1), (-3, -1, -1), (-1, -3, 1), (-1, -1, -3), (-3, -1, 1), (1, -3, -1), (1, -3, 1), (-3, 1, -1), (1, -1, -3), (-1, 1, -3), (-3, 1, 1), (-1, -1, 3), (1, 1, -3), (3, -1, -1), (1, -1, 3), (-1, 1, 3), (3, -1, 1), (-1, 3, -1), (-1, 3, 1), (3, 1, -1), (1, 1, 3), (1, 3, -1), (3, 1, 1), (1, 3, 1)]
info: Ring 2: [(-1, -5, -1), (-1, -5, 1), (1, -5, -1), (-5, -1, -1), (1, -5, 1), (-5, -1, 1), (-5, 1, -1), (-5, 1, 1), (-1, -1, -5), (-1, -1, 5), (1, -1, -5), (-1, 1, -5), (1, -1, 5), (-1, 1, 5), (1, 1, -5), (1, 1, 5), (5, -1, -1), (5, -1, 1), (5, 1, -1), (-1, 5, -1), (5, 1, 1), (-1, 5, 1), (1, 5, -1), (1, 5, 1), (-3, -3, -3), (-3, -3, 3), (-3, 3, -3), (3, -3, -3), (-3, 3, 3), (3, -3, 3), (3, 3, -3), (3, 3, 3)]
info: Possible angles and cosines between peaks in rings:
info: 9.446233 0.986440
info: 29.496208 0.870388
info: 41.032571 0.754337
info: 58.517846 0.522233
info: 66.034832 0.406181
info: 79.975012 0.174078
info: 86.673493 0.058026
info: 93.326507 -0.058026
info: 100.024988 -0.174078
info: 113.965168 -0.406181
info: 121.482154 -0.522233
info: 138.967429 -0.754337
info: 150.503792 -0.870388
info: 170.553767 -0.986440
info: Number of peaks in ring 1: 1
info: Number of peaks in ring 2: 2
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 0
info: Time taken 0.000012 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -5, -1), (-1, -5, 1), (1, -5, -1), (-5, -1, -1), (1, -5, 1), (-5, -1, 1), (-5, 1, -1), (-5, 1, 1), (-1, -1, -5), (-1, -1, 5), (1, -1, -5), (-1, 1, -5), (1, -1, 5), (-1, 1, 5), (1, 1, -5), (1, 1, 5), (5, -1, -1), (5, -1, 1), (5, 1, -1), (-1, 5, -1), (5, 1, 1), (-1, 5, 1), (1, 5, -1), (1, 5, 1), (-3, -3, -3), (-3, -3, 3), (-3, 3, -3), (3, -3, -3), (-3, 3, 3), (3, -3, 3), (3, 3, -3), (3, 3, 3)]
info: Ring 2: [(-1, -3, -1), (-3, -1, -1), (-1, -3, 1), (-1, -1, -3), (-3, -1, 1), (1, -3, -1), (1, -3, 1), (-3, 1, -1), (1, -1, -3), (-1, 1, -3), (-3, 1, 1), (-1, -1, 3), (1, 1, -3), (3, -1, -1), (1, -1, 3), (-1, 1, 3), (3, -1, 1), (-1, 3, -1), (-1, 3, 1), (3, 1, -1), (1, 1, 3), (1, 3, -1), (3, 1, 1), (1, 3, 1)]
info: Possible angles and cosines between peaks in rings:
info: 9.446233 0.986440
info: 29.496208 0.870388
info: 41.032571 0.754337
info: 58.517846 0.522233
info: 66.034832 0.406181
info: 79.975012 0.174078
info: 86.673493 0.058026
info: 93.326507 -0.058026
info: 100.024988 -0.174078
info: 113.965168 -0.406181
info: 121.482154 -0.522233
info: 138.967429 -0.754337
info: 150.503792 -0.870388
info: 170.553767 -0.986440
info: Number of peaks in ring 1: 2
info: Number of peaks in ring 2: 1
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 0
info: Time taken 0.000012 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -5, -1), (-1, -5, 1), (1, -5, -1), (-5, -1, -1), (1, -5, 1), (-5, -1, 1), (-5, 1, -1), (-5, 1, 1), (-1, -1, -5), (-1, -1, 5), (1, -1, -5), (-1, 1, -5), (1, -1, 5), (-1, 1, 5), (1, 1, -5), (1, 1, 5), (5, -1, -1), (5, -1, 1), (5, 1, -1), (-1, 5, -1), (5, 1, 1), (-1, 5, 1), (1, 5, -1), (1, 5, 1), (-3, -3, -3), (-3, -3, 3), (-3, 3, -3), (3, -3, -3), (-3, 3, 3), (3, -3, 3), (3, 3, -3), (3, 3, 3)]
info: Ring 2: [(-1, -5, -1), (-1, -5, 1), (1, -5, -1), (-5, -1, -1), (1, -5, 1), (-5, -1, 1), (-5, 1, -1), (-5, 1, 1), (-1, -1, -5), (-1, -1, 5), (1, -1, -5), (-1, 1, -5), (1, -1, 5), (-1, 1, 5), (1, 1, -5), (1, 1, 5), (5, -1, -1), (5, -1, 1), (5, 1, -1), (-1, 5, -1), (5, 1, 1), (-1, 5, 1), (1, 5, -1), (1, 5, 1), (-3, -3, -3), (-3, -3, 3), (-3, 3, -3), (3, -3, -3), (-3, 3, 3), (3, -3, 3), (3, 3, -3), (3, 3, 3)]
info: Possible angles and cosines between peaks in rings:
info: 22.191607 0.925926
info: 31.586338 0.851852
info: 38.942441 0.777778
info: 56.251011 0.555556
info: 65.957924 0.407407
info: 70.528779 0.333333
info: 87.877449 0.037037
info: 92.122551 -0.037037
info: 109.471221 -0.333333
info: 114.042076 -0.407407
info: 123.748989 -0.555556
info: 141.057559 -0.777778
info: 148.413662 -0.851852
info: 157.808393 -0.925926
info: Number of peaks in ring 1: 2
info: Number of peaks in ring 2: 2
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 0
info: Time taken 0.000013 /s
info:
Tested 26 pairs and found 100 grains so far
Combined scattering vectors#
[21]:
# make an indexer
idx_both = ImageD11.indexing.indexer(unitcell=ref_unitcell, gv=q_sample_cat, minpks=30)
idx_both.ds_tol = 0.005
idx_both.assigntorings()
idx_both.hkl_tol = 0.025
idx_both.cosine_tol = 0.002
idx_both.score_all_pairs()
idx_both.saveubis('grains_found_both.ubi')
info: gv: [[ 0.10700901 0.2296791 0.19076552]
[-0.03791894 -0.12150881 0.29387471]
[ 0.14969174 -0.19784589 0.2012963 ]
...
[ 0.64362911 0.1321422 0.68670726]
[-0.19368004 0.54663209 0.75434869]
[ 0.42308694 -0.37183459 0.77316786]] (5528, 3) float64
info: Assign to rings, maximum d-spacing considered: 0.959149
info: Ring assignment array shape (5528,)
info: Ring ( h, k, l) Mult total indexed to_index ubis peaks_per_ubi tth
info: Ring 7 ( -1, -5, -1) 32 566 0 566 N/A N/A -57.01
info: Ring 6 ( -2, -2, -4) 24 780 0 780 N/A N/A -53.48
info: Ring 5 ( -3, -3, -1) 24 986 0 986 N/A N/A -47.20
info: Ring 4 ( -4, 0, 0) 6 238 0 238 N/A N/A -43.11
info: Ring 3 ( -2, -2, -2) 8 0 0 0 N/A N/A -37.11
info: Ring 2 ( -1, -1, -3) 24 1362 0 1362 N/A N/A -35.47
info: Ring 1 ( -2, -2, 0) 12 916 0 916 N/A N/A -30.12
info: Ring 0 ( -1, -1, -1) 8 672 0 672 N/A N/A -18.31
info: Using only those peaks which are assigned to rings for scoring trial matrices
info: Shape of scoring matrix (5520, 3)
info: Assign to rings, maximum d-spacing considered: 0.959149
info: Ring assignment array shape (5528,)
info: Ring ( h, k, l) Mult total indexed to_index ubis peaks_per_ubi tth
info: Ring 7 ( -1, -5, -1) 32 566 0 566 N/A N/A -57.01
info: Ring 6 ( -2, -2, -4) 24 780 0 780 N/A N/A -53.48
info: Ring 5 ( -3, -3, -1) 24 986 0 986 N/A N/A -47.20
info: Ring 4 ( -4, 0, 0) 6 238 0 238 N/A N/A -43.11
info: Ring 3 ( -2, -2, -2) 8 0 0 0 N/A N/A -37.11
info: Ring 2 ( -1, -1, -3) 24 1362 0 1362 N/A N/A -35.47
info: Ring 1 ( -2, -2, 0) 12 916 0 916 N/A N/A -30.12
info: Ring 0 ( -1, -1, -1) 8 672 0 672 N/A N/A -18.31
info: Using only those peaks which are assigned to rings for scoring trial matrices
info: Shape of scoring matrix (5520, 3)
info: hkls of rings being used for indexing
info: Ring 1: [(-4, 0, 0), (0, 0, -4), (0, -4, 0), (0, 4, 0), (0, 0, 4), (4, 0, 0)]
info: Ring 2: [(-4, 0, 0), (0, 0, -4), (0, -4, 0), (0, 4, 0), (0, 0, 4), (4, 0, 0)]
info: Possible angles and cosines between peaks in rings:
info: 90.000000 0.000000
info: Number of peaks in ring 1: 238
info: Number of peaks in ring 2: 238
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 0
info: Time taken 0.000372 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -1, -1), (-1, -1, 1), (-1, 1, -1), (-1, 1, 1), (1, -1, -1), (1, -1, 1), (1, 1, -1), (1, 1, 1)]
info: Ring 2: [(-4, 0, 0), (0, 0, -4), (0, -4, 0), (0, 4, 0), (0, 0, 4), (4, 0, 0)]
info: Possible angles and cosines between peaks in rings:
info: 54.735610 0.577350
info: 125.264390 -0.577350
info: Number of peaks in ring 1: 672
info: Number of peaks in ring 2: 238
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 449
info: Time taken 0.001170 /s
info: Scoring 449 potential orientations
info: new grain 60 pks, i 4308 j 777 UBI 2.099153 1.765475 -4.710095 -3.628011 -2.992975 -2.729552 -3.470922 4.195359 0.048209
info: new grain 56 pks, i 4307 j 775 UBI 1.283297 2.007461 -4.881852 -2.118731 4.811528 1.422304 4.849336 1.578289 1.945446
info: new grain 54 pks, i 4301 j 3518 UBI -3.275305 1.134867 -4.208369 -2.775033 -4.588526 0.941742 -3.342200 2.698764 3.325107
info: new grain 51 pks, i 4294 j 4894 UBI 2.516895 1.216931 -4.660677 -2.659572 4.738342 -0.190036 4.019862 2.384926 2.804897
info: new grain 56 pks, i 4290 j 3532 UBI 1.740183 -3.390501 -3.890137 -3.061820 2.620629 -3.649178 4.150532 3.358676 -1.088652
info: new grain 56 pks, i 4289 j 4941 UBI -3.018697 -1.864320 -4.148070 4.467768 -2.045822 -2.340918 -0.745779 -4.697013 2.632865
info: new grain 56 pks, i 4282 j 743 UBI -1.619959 2.476463 -4.580529 4.363854 -1.954816 -2.587732 -2.827397 -4.436537 -1.398127
info: new grain 43 pks, i 4278 j 2171 UBI -1.154037 2.226545 -4.813267 -3.481020 -4.052036 -1.033793 -4.020636 2.874997 2.318803
info: new grain 35 pks, i 4274 j 762 UBI -2.158279 0.931069 -4.915431 5.001011 0.337468 -2.110275 -0.066488 -5.351611 -1.005076
info: new grain 66 pks, i 4267 j 2139 UBI 1.976405 -1.447575 -4.850940 -5.066119 -0.281758 -1.992974 0.266697 5.241433 -1.460119
info: new grain 54 pks, i 4266 j 2164 UBI 1.594907 1.882729 -4.863371 -0.585221 -4.977770 -2.106912 -5.171179 1.148376 -1.238020
info: new grain 52 pks, i 4265 j 3523 UBI -2.789505 1.763044 -4.322817 2.701551 -3.514971 -3.180780 -3.819296 -3.765978 0.904889
info: new grain 48 pks, i 4264 j 4889 UBI -3.647514 -0.472180 -4.006662 3.241124 -3.574953 -2.511452 -2.422291 -4.073191 2.697906
info: new grain 76 pks, i 4261 j 780 UBI 2.985498 -1.997372 -4.077377 1.238699 5.065222 -1.587133 4.383134 -0.066236 3.237643
info: new grain 72 pks, i 4255 j 742 UBI 1.029345 -3.658170 -3.886985 -3.012915 2.881495 -3.505369 4.415500 2.818218 -1.495037
info: new grain 60 pks, i 4253 j 2134 UBI 3.235172 0.087396 -4.367567 -3.883433 -2.459326 -2.921731 -2.023727 4.855176 -1.423177
info: new grain 68 pks, i 4250 j 3512 UBI 3.189650 -1.872435 -3.983051 4.054954 3.184610 1.749237 1.734338 -4.001891 3.271952
info: new grain 43 pks, i 4246 j 3501 UBI -2.764922 -1.580411 -4.433514 0.757092 -5.209218 1.377914 -4.625043 0.098654 2.839046
info: new grain 56 pks, i 4241 j 4926 UBI -2.450129 0.658301 -4.818437 -2.811142 -4.591728 0.793383 -3.965009 2.848516 2.408109
info: new grain 60 pks, i 4233 j 763 UBI -2.805279 1.879270 -4.267683 4.576188 0.132602 -2.956701 -0.911398 -5.107012 -1.635294
info: new grain 42 pks, i 4222 j 3546 UBI -0.085320 2.630026 -4.771232 0.407390 -4.755451 -2.608542 -5.426475 -0.402234 -0.140331
info: new grain 56 pks, i 4217 j 3530 UBI 2.701493 0.765428 -4.655079 -3.483438 -3.314188 -2.558407 -3.199599 4.247871 -1.186347
info: new grain 64 pks, i 4214 j 774 UBI -0.533729 -2.176666 -4.963677 3.351651 -4.052682 1.401176 -4.256853 -2.912476 1.739064
info: new grain 56 pks, i 4203 j 4940 UBI 2.426574 0.464749 -4.862340 -1.673867 5.167493 -0.355668 4.579859 1.647494 2.422099
info: new grain 58 pks, i 4202 j 2141 UBI 0.597689 3.515116 -4.123915 -5.412592 0.234164 -0.596816 -0.196414 4.148268 3.504104
info: new grain 57 pks, i 4199 j 4937 UBI -1.881998 2.588792 -4.403791 -4.689730 -2.736044 0.412345 -2.024935 3.931938 3.174101
info: new grain 56 pks, i 4196 j 3553 UBI 2.148225 1.635272 -4.735359 -3.298626 -3.406329 -2.660954 -3.761916 3.917452 -0.362049
info: new grain 43 pks, i 4192 j 2132 UBI -1.843857 2.120019 -4.668498 -0.501230 -5.003254 -2.093885 -5.096983 -0.273545 1.859383
info: new grain 54 pks, i 4190 j 3514 UBI 2.827823 0.810254 -4.593654 -4.567598 -0.537347 -2.892190 -0.882319 5.354424 0.430406
info: new grain 60 pks, i 4186 j 784 UBI 2.330810 2.521921 -4.223386 -4.235712 -1.343204 -3.133462 -2.499279 4.633444 1.405657
info: new grain 60 pks, i 4178 j 3540 UBI -2.720776 -1.826484 -4.347221 1.353520 -5.109704 1.292945 -4.516926 -0.432974 3.011105
info: new grain 34 pks, i 4177 j 4938 UBI 1.494364 -2.412223 -4.645537 5.168901 1.430442 0.958201 0.809443 -4.675883 2.673391
info: new grain 70 pks, i 4172 j 791 UBI -0.786141 3.209242 -4.308627 -4.976385 1.242667 1.826428 2.059167 4.211252 2.787290
info: new grain 44 pks, i 4170 j 4918 UBI 1.054789 2.016269 -4.948483 0.776599 -5.045731 -1.868300 -5.281785 -0.336639 -1.293587
info: new grain 60 pks, i 4166 j 3551 UBI 2.419887 1.014367 -4.784455 0.440125 5.256877 1.328667 4.857042 -0.985646 2.231507
info: new grain 52 pks, i 4163 j 770 UBI 1.968777 1.259064 -4.922994 -0.204322 5.289154 1.265552 5.070058 -0.279313 1.949678
info: new grain 47 pks, i 4161 j 3533 UBI 0.131139 2.853870 -4.639633 -3.504688 -3.503727 -2.269520 -4.172795 3.032298 1.715399
info: new grain 48 pks, i 4152 j 3505 UBI 2.097504 -2.639377 -4.282617 -3.152661 2.916436 -3.338978 3.910713 3.764922 -0.378965
info: new grain 52 pks, i 4148 j 2167 UBI 3.372288 1.412458 -4.023223 -4.231402 1.792988 -2.908228 0.567604 4.944523 2.238210
info: new grain 60 pks, i 2925 j 3520 UBI -2.984405 1.410140 -4.330628 0.366479 -5.084873 -1.927457 -4.540741 -1.334985 2.677228
info: new grain 58 pks, i 2917 j 4897 UBI -2.016006 2.560132 -4.360824 -2.516397 -4.578876 -1.554939 -4.386252 1.456470 2.861704
info: new grain 49 pks, i 2914 j 2160 UBI -3.204104 -1.818169 -3.987019 4.379093 -0.824255 -3.140029 0.438880 -5.065497 1.970303
info: new grain 57 pks, i 2904 j 2148 UBI -3.782678 -0.530582 -3.852635 -0.849483 -5.155157 1.570454 -3.817366 1.675007 3.510880
info: new grain 47 pks, i 2888 j 2166 UBI -1.729784 -2.831174 -4.325881 5.059437 -0.033266 -1.977834 1.023337 -4.650417 2.648428
info: new grain 55 pks, i 2887 j 4906 UBI -3.141881 -1.141645 -4.277929 4.268322 0.699983 -3.325833 1.248358 -5.276873 0.506762
info: new grain 34 pks, i 2879 j 755 UBI 0.358115 3.659023 -4.025523 0.400812 -4.025567 -3.631280 -5.414397 -0.067821 -0.569571
info: new grain 60 pks, i 2870 j 2120 UBI 2.747052 1.922592 -4.282036 -4.623381 1.998204 -2.088596 0.849663 4.682751 2.634662
info: new grain 56 pks, i 2804 j 3510 UBI -2.115745 -2.375800 -4.418766 5.014439 -0.906800 -1.901528 0.101491 -4.812939 2.549301
info: new grain 34 pks, i 130 j 4885 UBI -2.341520 2.974010 -3.947838 -0.699194 -4.516325 -2.962042 -4.872897 -0.777506 2.294776
info: Number of orientations with more than 30 peaks is 49
info: Time taken 0.009/s
info: UBI for best fitting
[[ 2.98549839 -1.9973725 -4.07737656]
[ 1.23869934 5.06522209 -1.58713285]
[ 4.38313438 -0.06623563 3.23764343]]
info: Unit cell: (5.433939374668945, 5.45067349527024, 5.4496411934491205, 90.08618757723819, 89.96701829125598, 89.89875491202103)
info: Indexes 76 peaks, with <drlv2>=0.006492
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 2651
info: Tried r1=0 r2=4 attempt 1 of 49, got 49 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-4, 0, 0), (0, 0, -4), (0, -4, 0), (0, 4, 0), (0, 0, 4), (4, 0, 0)]
info: Ring 2: [(-1, -1, -1), (-1, -1, 1), (-1, 1, -1), (-1, 1, 1), (1, -1, -1), (1, -1, 1), (1, 1, -1), (1, 1, 1)]
info: Possible angles and cosines between peaks in rings:
info: 54.735610 0.577350
info: 125.264390 -0.577350
info: Number of peaks in ring 1: 42
info: Number of peaks in ring 2: 296
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 30
info: Time taken 0.000104 /s
info: Scoring 30 potential orientations
info: new grain 48 pks, i 4916 j 2910 UBI -2.984519 -0.610759 4.516722 4.324665 1.305918 3.029048 -1.423339 5.250112 -0.258936
info: new grain 60 pks, i 4909 j 1410 UBI -1.522927 -2.454806 4.621851 -0.379594 4.845871 2.444712 -5.209894 0.367403 -1.514639
info: new grain 55 pks, i 3529 j 4281 UBI 1.783563 -1.216086 5.005179 -5.095782 -1.156693 1.504771 0.718385 -5.182178 -1.517486
info: new grain 33 pks, i 2128 j 104 UBI 0.813581 3.209373 4.306135 -2.842538 -3.448139 3.110292 4.569634 -2.714221 1.207478
info: Number of orientations with more than 30 peaks is 53
info: Time taken 0.001/s
info: UBI for best fitting
[[ 2.98549839 -1.9973725 -4.07737656]
[ 1.23869934 5.06522209 -1.58713285]
[ 4.38313438 -0.06623563 3.23764343]]
info: Unit cell: (5.433939374668945, 5.45067349527024, 5.4496411934491205, 90.08618757723819, 89.96701829125598, 89.89875491202103)
info: Indexes 76 peaks, with <drlv2>=0.006492
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 2443
info: Tried r1=4 r2=0 attempt 2 of 49, got 53 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -1, -1), (-1, -1, 1), (-1, 1, -1), (-1, 1, 1), (1, -1, -1), (1, -1, 1), (1, 1, -1), (1, 1, 1)]
info: Ring 2: [(-1, -1, -1), (-1, -1, 1), (-1, 1, -1), (-1, 1, 1), (1, -1, -1), (1, -1, 1), (1, 1, -1), (1, 1, 1)]
info: Possible angles and cosines between peaks in rings:
info: 70.528779 0.333333
info: 109.471221 -0.333333
info: Number of peaks in ring 1: 272
info: Number of peaks in ring 2: 272
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 189
info: Time taken 0.000504 /s
info: Scoring 189 potential orientations
info: new grain 70 pks, i 4309 j 99 UBI -1.638995 -5.177330 -0.441819 -5.169423 1.585399 0.603298 -0.460375 0.576016 -5.389053
info: new grain 60 pks, i 4304 j 94 UBI -1.746888 -5.086789 -0.844063 -5.117353 1.603478 0.913127 -0.629702 1.082724 -5.299739
info: new grain 56 pks, i 4300 j 2816 UBI -0.264562 5.269396 1.343243 0.738694 -1.289531 5.238115 5.387492 0.441386 -0.638539
info: new grain 56 pks, i 4299 j 49 UBI 0.875754 -1.096318 5.258971 -1.406663 5.097342 1.304407 -5.185162 -1.566749 0.529739
info: new grain 35 pks, i 4286 j 98 UBI -1.226100 1.690301 5.031015 1.257840 -4.923614 1.966621 5.149782 1.603072 0.684173
info: new grain 68 pks, i 4284 j 11 UBI 0.440339 -0.372111 5.413603 -5.207131 1.497191 0.524463 -1.524208 -5.220192 -0.225731
info: new grain 48 pks, i 4280 j 1474 UBI 1.315220 0.834359 5.215695 -3.056086 -4.263958 1.454580 4.308259 -3.279279 -0.560094
info: new grain 46 pks, i 4277 j 2770 UBI 1.730353 0.671210 5.123414 -3.238284 -4.066528 1.627414 4.017210 -3.559469 -0.860437
info: new grain 35 pks, i 4271 j 2783 UBI 1.396302 -1.224357 5.125079 -2.366843 4.583575 1.738280 -4.691595 -2.671287 0.606311
info: new grain 38 pks, i 4247 j 81 UBI 1.212826 3.705883 3.795978 1.257048 -3.981362 3.471524 5.156353 0.106240 -1.776834
info: new grain 50 pks, i 4237 j 111 UBI 4.259251 -3.133479 1.270652 -0.702800 1.209443 5.266694 -3.314521 -4.284049 0.525233
info: new grain 58 pks, i 4234 j 2895 UBI -0.695595 0.233197 5.390419 5.386289 0.408067 0.686819 -0.373983 5.424582 -0.313135
info: new grain 68 pks, i 4219 j 2795 UBI 5.001366 -2.073058 0.618019 -0.524210 0.268370 5.410708 -2.090865 -5.023543 0.029158
info: new grain 60 pks, i 4209 j 22 UBI -2.083684 4.973906 0.781071 0.100539 -0.787585 5.384510 5.026807 2.073687 0.197933
info: new grain 52 pks, i 4195 j 2788 UBI 4.966455 -1.098037 1.951771 -1.909434 0.320424 5.082799 -1.140253 -5.322113 -0.101376
info: new grain 42 pks, i 4189 j 2915 UBI -2.000601 -0.402751 5.039099 3.999388 3.196091 1.841798 -3.102724 4.387073 -0.908829
info: new grain 37 pks, i 4168 j 1427 UBI 2.669537 -4.334862 1.939191 -1.702591 1.182777 5.024204 -4.425569 -3.075082 -0.795194
info: new grain 72 pks, i 4165 j 2824 UBI -2.860581 4.613363 0.369544 0.158438 -0.359920 5.430756 4.629486 2.869595 0.072976
info: new grain 60 pks, i 2931 j 2843 UBI -3.751896 1.762504 3.537048 3.872893 0.761471 3.722617 0.725230 5.091400 -1.806481
info: new grain 52 pks, i 2800 j 4288 UBI 1.287767 1.378843 5.115532 -2.739654 -4.323275 1.835603 4.525787 -3.005914 -0.308511
info: Number of orientations with more than 30 peaks is 73
info: Time taken 0.004/s
info: UBI for best fitting
[[ 2.98549839 -1.9973725 -4.07737656]
[ 1.23869934 5.06522209 -1.58713285]
[ 4.38313438 -0.06623563 3.23764343]]
info: Unit cell: (5.433939374668945, 5.45067349527024, 5.4496411934491205, 90.08618757723819, 89.96701829125598, 89.89875491202103)
info: Indexes 76 peaks, with <drlv2>=0.006492
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 1301
info: Tried r1=0 r2=0 attempt 3 of 49, got 73 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-2, -2, 0), (-2, 0, -2), (-2, 0, 2), (0, -2, -2), (0, -2, 2), (-2, 2, 0), (2, -2, 0), (0, 2, -2), (0, 2, 2), (2, 0, -2), (2, 0, 2), (2, 2, 0)]
info: Ring 2: [(-4, 0, 0), (0, 0, -4), (0, -4, 0), (0, 4, 0), (0, 0, 4), (4, 0, 0)]
info: Possible angles and cosines between peaks in rings:
info: 45.000000 0.707107
info: 90.000000 0.000000
info: 135.000000 -0.707107
info: Number of peaks in ring 1: 282
info: Number of peaks in ring 2: 24
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 52
info: Time taken 0.000297 /s
info: Scoring 52 potential orientations
info: new grain 50 pks, i 4536 j 3558 UBI -4.785252 -0.803032 2.494257 -1.869299 -2.510665 -4.435601 1.792262 -4.763746 1.941649
info: new grain 48 pks, i 4525 j 788 UBI -3.210638 -3.517306 -2.629066 3.668684 -0.331224 -3.995873 2.427609 -4.135388 2.601370
info: new grain 40 pks, i 4506 j 778 UBI 0.944117 -5.013858 1.861724 2.067118 -1.429165 -4.845877 4.949379 1.560947 1.646488
info: new grain 59 pks, i 4490 j 3536 UBI -4.191047 -3.035843 1.672320 -0.360035 -2.243736 -4.957565 3.459224 -3.915889 1.506003
info: new grain 45 pks, i 4440 j 3521 UBI -3.754062 3.186212 2.331468 -2.957910 -0.171527 -4.572403 -2.596996 -4.409737 1.824389
info: new grain 56 pks, i 4367 j 3509 UBI -2.470668 4.332195 -2.199007 -0.688263 -2.744125 -4.636647 -4.802498 -1.835246 1.816691
info: Number of orientations with more than 30 peaks is 79
info: Time taken 0.001/s
info: UBI for best fitting
[[ 2.98549839 -1.9973725 -4.07737656]
[ 1.23869934 5.06522209 -1.58713285]
[ 4.38313438 -0.06623563 3.23764343]]
info: Unit cell: (5.433939374668945, 5.45067349527024, 5.4496411934491205, 90.08618757723819, 89.96701829125598, 89.89875491202103)
info: Indexes 76 peaks, with <drlv2>=0.006492
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 977
info: Tried r1=1 r2=4 attempt 4 of 49, got 79 grains
info: no peaks left for those rings
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -1, -1), (-1, -1, 1), (-1, 1, -1), (-1, 1, 1), (1, -1, -1), (1, -1, 1), (1, 1, -1), (1, 1, 1)]
info: Ring 2: [(-2, -2, 0), (-2, 0, -2), (-2, 0, 2), (0, -2, -2), (0, -2, 2), (-2, 2, 0), (2, -2, 0), (0, 2, -2), (0, 2, 2), (2, 0, -2), (2, 0, 2), (2, 2, 0)]
info: Possible angles and cosines between peaks in rings:
info: 35.264390 0.816497
info: 90.000000 0.000000
info: 144.735610 -0.816497
info: Number of peaks in ring 1: 80
info: Number of peaks in ring 2: 232
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 80
info: Time taken 0.000151 /s
info: Scoring 80 potential orientations
info: new grain 52 pks, i 4305 j 3078 UBI -1.065950 1.526990 -5.117065 -0.478034 5.168400 1.665394 5.314004 0.781462 -0.849400
info: new grain 53 pks, i 4270 j 1585 UBI 0.523078 -5.400467 -0.431317 -1.245088 -0.556912 5.266956 -5.272534 -0.401297 -1.313203
info: new grain 34 pks, i 4259 j 4480 UBI 5.014812 -2.103976 0.055368 -0.628282 -1.400803 5.216828 -2.013145 -4.824333 -1.566326
info: new grain 41 pks, i 4258 j 4479 UBI -4.111535 2.976035 -1.968416 1.110879 3.939324 3.575174 3.374731 2.313086 -3.597461
info: new grain 52 pks, i 4257 j 333 UBI -3.075426 -3.938266 -2.152394 -3.835656 0.933979 3.743661 -2.343167 3.638617 -3.313687
info: new grain 55 pks, i 4245 j 1640 UBI -3.866499 0.582027 -3.773176 -3.029717 2.837536 3.552089 2.348903 4.606776 -1.666631
info: new grain 52 pks, i 4235 j 1711 UBI -1.251209 0.175351 -5.289129 2.505478 4.816976 -0.437974 4.672358 -2.535676 -1.214048
info: new grain 36 pks, i 4230 j 362 UBI -1.489984 -1.313313 -5.066422 -4.905819 -1.508786 1.864807 -1.854999 5.051568 -0.727650
info: new grain 34 pks, i 2867 j 4504 UBI -2.954932 -2.863034 -3.561521 0.638244 3.946302 -3.718444 4.525313 -2.427422 -1.766900
info: new grain 40 pks, i 2851 j 328 UBI 1.595901 -0.953969 -5.105992 5.089341 1.389324 1.362774 1.077246 -5.175467 1.319135
info: new grain 44 pks, i 13 j 4383 UBI -3.054534 3.889391 -2.303167 1.942247 3.616038 3.560863 4.069845 1.203428 -3.416234
info: Number of orientations with more than 30 peaks is 90
info: Time taken 0.002/s
info: UBI for best fitting
[[ 2.98549839 -1.9973725 -4.07737656]
[ 1.23869934 5.06522209 -1.58713285]
[ 4.38313438 -0.06623563 3.23764343]]
info: Unit cell: (5.433939374668945, 5.45067349527024, 5.4496411934491205, 90.08618757723819, 89.96701829125598, 89.89875491202103)
info: Indexes 76 peaks, with <drlv2>=0.006492
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 406
info: Tried r1=0 r2=1 attempt 5 of 49, got 90 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-2, -2, 0), (-2, 0, -2), (-2, 0, 2), (0, -2, -2), (0, -2, 2), (-2, 2, 0), (2, -2, 0), (0, 2, -2), (0, 2, 2), (2, 0, -2), (2, 0, 2), (2, 2, 0)]
info: Ring 2: [(-1, -1, -1), (-1, -1, 1), (-1, 1, -1), (-1, 1, 1), (1, -1, -1), (1, -1, 1), (1, 1, -1), (1, 1, 1)]
info: Possible angles and cosines between peaks in rings:
info: 35.264390 0.816497
info: 90.000000 0.000000
info: 144.735610 -0.816497
info: Number of peaks in ring 1: 112
info: Number of peaks in ring 2: 4
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 4
info: Time taken 0.000118 /s
info: Scoring 4 potential orientations
info: new grain 45 pks, i 3159 j 1418 UBI -3.015062 -4.427402 0.977512 1.020954 -1.791785 -5.026439 4.411731 -2.602582 1.848302
info: Number of orientations with more than 30 peaks is 91
info: Time taken 0.000/s
info: UBI for best fitting
[[ 2.98549839 -1.9973725 -4.07737656]
[ 1.23869934 5.06522209 -1.58713285]
[ 4.38313438 -0.06623563 3.23764343]]
info: Unit cell: (5.433939374668945, 5.45067349527024, 5.4496411934491205, 90.08618757723819, 89.96701829125598, 89.89875491202103)
info: Indexes 76 peaks, with <drlv2>=0.006492
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 362
info: Tried r1=1 r2=0 attempt 6 of 49, got 91 grains
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: hkls of rings being used for indexing
info: Ring 1: [(-2, -2, 0), (-2, 0, -2), (-2, 0, 2), (0, -2, -2), (0, -2, 2), (-2, 2, 0), (2, -2, 0), (0, 2, -2), (0, 2, 2), (2, 0, -2), (2, 0, 2), (2, 2, 0)]
info: Ring 2: [(-2, -2, 0), (-2, 0, -2), (-2, 0, 2), (0, -2, -2), (0, -2, 2), (-2, 2, 0), (2, -2, 0), (0, 2, -2), (0, 2, 2), (2, 0, -2), (2, 0, 2), (2, 2, 0)]
info: Possible angles and cosines between peaks in rings:
info: 60.000000 0.500000
info: 90.000000 0.000000
info: 120.000000 -0.500000
info: Number of peaks in ring 1: 104
info: Number of peaks in ring 2: 104
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 101
info: Time taken 0.000147 /s
info: Scoring 101 potential orientations
info: new grain 42 pks, i 4512 j 3113 UBI -4.224243 -1.739123 2.965871 3.424783 -2.231109 3.609983 0.059647 4.656665 2.793529
info: new grain 64 pks, i 4466 j 3065 UBI -1.460635 1.007133 5.154885 0.391416 -5.305956 1.117473 5.231526 0.681611 1.346649
info: new grain 34 pks, i 4457 j 291 UBI -3.470316 2.159932 3.591312 -0.294531 -4.773276 2.626974 4.189243 1.463777 3.138369
info: new grain 36 pks, i 4432 j 4396 UBI -4.401631 1.558212 2.786339 1.116229 -3.728068 3.797930 3.012806 3.639914 2.729537
info: new grain 38 pks, i 4420 j 338 UBI 1.747946 -3.900733 3.346808 1.990774 3.797079 3.364900 -4.754147 0.158213 2.667421
info: new grain 38 pks, i 4410 j 2998 UBI -4.118178 -1.109032 3.365694 3.097279 -3.663987 2.600596 1.752981 3.867844 3.402497
info: new grain 38 pks, i 4388 j 2937 UBI -4.130073 -2.023325 2.905602 3.542236 -2.280052 3.465275 -0.061794 4.508128 3.031243
info: new grain 36 pks, i 3027 j 4356 UBI 3.336785 -3.212807 2.903298 1.601822 4.296543 2.930770 -3.997635 -0.961425 3.549592
info: Number of orientations with more than 30 peaks is 99
info: Time taken 0.002/s
info: UBI for best fitting
[[ 2.98549839 -1.9973725 -4.07737656]
[ 1.23869934 5.06522209 -1.58713285]
[ 4.38313438 -0.06623563 3.23764343]]
info: Unit cell: (5.433939374668945, 5.45067349527024, 5.4496411934491205, 90.08618757723819, 89.96701829125598, 89.89875491202103)
info: Indexes 76 peaks, with <drlv2>=0.006492
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 50
info: Tried r1=1 r2=1 attempt 7 of 49, got 99 grains
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: hkls of rings being used for indexing
info: Ring 1: [(-2, -2, 0), (-2, 0, -2), (-2, 0, 2), (0, -2, -2), (0, -2, 2), (-2, 2, 0), (2, -2, 0), (0, 2, -2), (0, 2, 2), (2, 0, -2), (2, 0, 2), (2, 2, 0)]
info: Ring 2: [(-2, -2, -4), (-2, 2, -4), (2, -2, -4), (-4, -2, -2), (-2, -4, -2), (2, 2, -4), (-4, 2, -2), (2, -4, -2), (-2, 4, -2), (4, -2, -2), (2, 4, -2), (4, 2, -2), (-4, -2, 2), (-2, -4, 2), (-4, 2, 2), (2, -4, 2), (-2, 4, 2), (4, -2, 2), (-2, -2, 4), (2, 4, 2), (4, 2, 2), (-2, 2, 4), (2, -2, 4), (2, 2, 4)]
info: Possible angles and cosines between peaks in rings:
info: 30.000000 0.866025
info: 54.735610 0.577350
info: 73.221345 0.288675
info: 90.000000 0.000000
info: 106.778655 -0.288675
info: 125.264390 -0.577350
info: 150.000000 -0.866025
info: Number of peaks in ring 1: 12
info: Number of peaks in ring 2: 2
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 0
info: Time taken 0.000023 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-2, -2, -4), (-2, 2, -4), (2, -2, -4), (-4, -2, -2), (-2, -4, -2), (2, 2, -4), (-4, 2, -2), (2, -4, -2), (-2, 4, -2), (4, -2, -2), (2, 4, -2), (4, 2, -2), (-4, -2, 2), (-2, -4, 2), (-4, 2, 2), (2, -4, 2), (-2, 4, 2), (4, -2, 2), (-2, -2, 4), (2, 4, 2), (4, 2, 2), (-2, 2, 4), (2, -2, 4), (2, 2, 4)]
info: Ring 2: [(-2, -2, 0), (-2, 0, -2), (-2, 0, 2), (0, -2, -2), (0, -2, 2), (-2, 2, 0), (2, -2, 0), (0, 2, -2), (0, 2, 2), (2, 0, -2), (2, 0, 2), (2, 2, 0)]
info: Possible angles and cosines between peaks in rings:
info: 30.000000 0.866025
info: 54.735610 0.577350
info: 73.221345 0.288675
info: 90.000000 0.000000
info: 106.778655 -0.288675
info: 125.264390 -0.577350
info: 150.000000 -0.866025
info: Number of peaks in ring 1: 2
info: Number of peaks in ring 2: 12
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 0
info: Time taken 0.000021 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-2, -2, 0), (-2, 0, -2), (-2, 0, 2), (0, -2, -2), (0, -2, 2), (-2, 2, 0), (2, -2, 0), (0, 2, -2), (0, 2, 2), (2, 0, -2), (2, 0, 2), (2, 2, 0)]
info: Ring 2: [(-3, -3, -1), (-3, -3, 1), (-3, -1, -3), (-1, -3, -3), (-3, -1, 3), (-3, 1, -3), (-1, -3, 3), (-3, 1, 3), (1, -3, -3), (-3, 3, -1), (-3, 3, 1), (1, -3, 3), (-1, 3, -3), (3, -3, -1), (3, -3, 1), (-1, 3, 3), (3, -1, -3), (1, 3, -3), (3, -1, 3), (3, 1, -3), (1, 3, 3), (3, 1, 3), (3, 3, -1), (3, 3, 1)]
info: Possible angles and cosines between peaks in rings:
info: 13.262676 0.973329
info: 49.542360 0.648886
info: 71.068177 0.324443
info: 90.000000 0.000000
info: 108.931823 -0.324443
info: 130.457640 -0.648886
info: 166.737324 -0.973329
info: Number of peaks in ring 1: 12
info: Number of peaks in ring 2: 12
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 12
info: Time taken 0.000024 /s
info: Scoring 12 potential orientations
info: new grain 34 pks, i 1575 j 826 UBI 2.839848 -2.844297 3.646684 0.490258 4.479082 3.081868 -4.624772 -1.260247 2.610241
info: Number of orientations with more than 30 peaks is 100
info: Time taken 0.001/s
info: UBI for best fitting
[[ 2.98549839 -1.9973725 -4.07737656]
[ 1.23869934 5.06522209 -1.58713285]
[ 4.38313438 -0.06623563 3.23764343]]
info: Unit cell: (5.433939374668945, 5.45067349527024, 5.4496411934491205, 90.08618757723819, 89.96701829125598, 89.89875491202103)
info: Indexes 76 peaks, with <drlv2>=0.006492
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 14
info: Tried r1=1 r2=5 attempt 8 of 49, got 100 grains
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: no peaks left for those rings
info: hkls of rings being used for indexing
info: Ring 1: [(-2, -2, -4), (-2, 2, -4), (2, -2, -4), (-4, -2, -2), (-2, -4, -2), (2, 2, -4), (-4, 2, -2), (2, -4, -2), (-2, 4, -2), (4, -2, -2), (2, 4, -2), (4, 2, -2), (-4, -2, 2), (-2, -4, 2), (-4, 2, 2), (2, -4, 2), (-2, 4, 2), (4, -2, 2), (-2, -2, 4), (2, 4, 2), (4, 2, 2), (-2, 2, 4), (2, -2, 4), (2, 2, 4)]
info: Ring 2: [(-2, -2, -4), (-2, 2, -4), (2, -2, -4), (-4, -2, -2), (-2, -4, -2), (2, 2, -4), (-4, 2, -2), (2, -4, -2), (-2, 4, -2), (4, -2, -2), (2, 4, -2), (4, 2, -2), (-4, -2, 2), (-2, -4, 2), (-4, 2, 2), (2, -4, 2), (-2, 4, 2), (4, -2, 2), (-2, -2, 4), (2, 4, 2), (4, 2, 2), (-2, 2, 4), (2, -2, 4), (2, 2, 4)]
info: Possible angles and cosines between peaks in rings:
info: 33.557310 0.833333
info: 48.189685 0.666667
info: 60.000000 0.500000
info: 70.528779 0.333333
info: 80.405932 0.166667
info: 99.594068 -0.166667
info: 109.471221 -0.333333
info: 120.000000 -0.500000
info: 131.810315 -0.666667
info: 146.442690 -0.833333
info: Number of peaks in ring 1: 2
info: Number of peaks in ring 2: 2
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 0
info: Time taken 0.000014 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-3, -3, -1), (-3, -3, 1), (-3, -1, -3), (-1, -3, -3), (-3, -1, 3), (-3, 1, -3), (-1, -3, 3), (-3, 1, 3), (1, -3, -3), (-3, 3, -1), (-3, 3, 1), (1, -3, 3), (-1, 3, -3), (3, -3, -1), (3, -3, 1), (-1, 3, 3), (3, -1, -3), (1, 3, -3), (3, -1, 3), (3, 1, -3), (1, 3, 3), (3, 1, 3), (3, 3, -1), (3, 3, 1)]
info: Ring 2: [(-2, -2, -4), (-2, 2, -4), (2, -2, -4), (-4, -2, -2), (-2, -4, -2), (2, 2, -4), (-4, 2, -2), (2, -4, -2), (-2, 4, -2), (4, -2, -2), (2, 4, -2), (4, 2, -2), (-4, -2, 2), (-2, -4, 2), (-4, 2, 2), (2, -4, 2), (-2, 4, 2), (4, -2, 2), (-2, -2, 4), (2, 4, 2), (4, 2, 2), (-2, 2, 4), (2, -2, 4), (2, 2, 4)]
info: Possible angles and cosines between peaks in rings:
info: 20.514127 0.936586
info: 41.472934 0.749269
info: 67.998286 0.374634
info: 79.203742 0.187317
info: 100.796258 -0.187317
info: 112.001714 -0.374634
info: 138.527066 -0.749269
info: 159.485873 -0.936586
info: Number of peaks in ring 1: 4
info: Number of peaks in ring 2: 2
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 2
info: Time taken 0.000014 /s
info: Scoring 2 potential orientations
info: Number of orientations with more than 30 peaks is 100
info: Time taken 0.000/s
info: UBI for best fitting
[[ 2.98549839 -1.9973725 -4.07737656]
[ 1.23869934 5.06522209 -1.58713285]
[ 4.38313438 -0.06623563 3.23764343]]
info: Unit cell: (5.433939374668945, 5.45067349527024, 5.4496411934491205, 90.08618757723819, 89.96701829125598, 89.89875491202103)
info: Indexes 76 peaks, with <drlv2>=0.006492
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 14
info: Tried r1=5 r2=6 attempt 9 of 49, got 100 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-2, -2, -4), (-2, 2, -4), (2, -2, -4), (-4, -2, -2), (-2, -4, -2), (2, 2, -4), (-4, 2, -2), (2, -4, -2), (-2, 4, -2), (4, -2, -2), (2, 4, -2), (4, 2, -2), (-4, -2, 2), (-2, -4, 2), (-4, 2, 2), (2, -4, 2), (-2, 4, 2), (4, -2, 2), (-2, -2, 4), (2, 4, 2), (4, 2, 2), (-2, 2, 4), (2, -2, 4), (2, 2, 4)]
info: Ring 2: [(-3, -3, -1), (-3, -3, 1), (-3, -1, -3), (-1, -3, -3), (-3, -1, 3), (-3, 1, -3), (-1, -3, 3), (-3, 1, 3), (1, -3, -3), (-3, 3, -1), (-3, 3, 1), (1, -3, 3), (-1, 3, -3), (3, -3, -1), (3, -3, 1), (-1, 3, 3), (3, -1, -3), (1, 3, -3), (3, -1, 3), (3, 1, -3), (1, 3, 3), (3, 1, 3), (3, 3, -1), (3, 3, 1)]
info: Possible angles and cosines between peaks in rings:
info: 20.514127 0.936586
info: 41.472934 0.749269
info: 67.998286 0.374634
info: 79.203742 0.187317
info: 100.796258 -0.187317
info: 112.001714 -0.374634
info: 138.527066 -0.749269
info: 159.485873 -0.936586
info: Number of peaks in ring 1: 2
info: Number of peaks in ring 2: 4
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 2
info: Time taken 0.000013 /s
info: Scoring 2 potential orientations
info: Number of orientations with more than 30 peaks is 100
info: Time taken 0.000/s
info: UBI for best fitting
[[ 2.98549839 -1.9973725 -4.07737656]
[ 1.23869934 5.06522209 -1.58713285]
[ 4.38313438 -0.06623563 3.23764343]]
info: Unit cell: (5.433939374668945, 5.45067349527024, 5.4496411934491205, 90.08618757723819, 89.96701829125598, 89.89875491202103)
info: Indexes 76 peaks, with <drlv2>=0.006492
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 14
info: Tried r1=6 r2=5 attempt 10 of 49, got 100 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-3, -3, -1), (-3, -3, 1), (-3, -1, -3), (-1, -3, -3), (-3, -1, 3), (-3, 1, -3), (-1, -3, 3), (-3, 1, 3), (1, -3, -3), (-3, 3, -1), (-3, 3, 1), (1, -3, 3), (-1, 3, -3), (3, -3, -1), (3, -3, 1), (-1, 3, 3), (3, -1, -3), (1, 3, -3), (3, -1, 3), (3, 1, -3), (1, 3, 3), (3, 1, 3), (3, 3, -1), (3, 3, 1)]
info: Ring 2: [(-3, -3, -1), (-3, -3, 1), (-3, -1, -3), (-1, -3, -3), (-3, -1, 3), (-3, 1, -3), (-1, -3, 3), (-3, 1, 3), (1, -3, -3), (-3, 3, -1), (-3, 3, 1), (1, -3, 3), (-1, 3, -3), (3, -3, -1), (3, -3, 1), (-1, 3, 3), (3, -1, -3), (1, 3, -3), (3, -1, 3), (3, 1, -3), (1, 3, 3), (3, 1, 3), (3, 3, -1), (3, 3, 1)]
info: Possible angles and cosines between peaks in rings:
info: 26.525352 0.894737
info: 37.863646 0.789474
info: 61.726286 0.473684
info: 80.915280 0.157895
info: 86.983039 0.052632
info: 93.016961 -0.052632
info: 99.084720 -0.157895
info: 118.273714 -0.473684
info: 142.136354 -0.789474
info: 153.474648 -0.894737
info: Number of peaks in ring 1: 4
info: Number of peaks in ring 2: 4
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 0
info: Time taken 0.000015 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -1, -3), (-3, -1, -1), (-1, 1, -3), (-1, -3, -1), (1, -1, -3), (-3, 1, -1), (1, 1, -3), (1, -3, -1), (-3, -1, 1), (-1, -3, 1), (-3, 1, 1), (-1, 3, -1), (1, -3, 1), (3, -1, -1), (1, 3, -1), (3, 1, -1), (-1, 3, 1), (-1, -1, 3), (3, -1, 1), (-1, 1, 3), (1, 3, 1), (1, -1, 3), (3, 1, 1), (1, 1, 3)]
info: Ring 2: [(-2, -2, -4), (-2, 2, -4), (2, -2, -4), (-4, -2, -2), (-2, -4, -2), (2, 2, -4), (-4, 2, -2), (2, -4, -2), (-2, 4, -2), (4, -2, -2), (2, 4, -2), (4, 2, -2), (-4, -2, 2), (-2, -4, 2), (-4, 2, 2), (2, -4, 2), (-2, 4, 2), (4, -2, 2), (-2, -2, 4), (2, 4, 2), (4, 2, 2), (-2, 2, 4), (2, -2, 4), (2, 2, 4)]
info: Possible angles and cosines between peaks in rings:
info: 10.024988 0.984732
info: 42.392046 0.738549
info: 60.503792 0.492366
info: 75.748245 0.246183
info: 90.000000 0.000000
info: 104.251755 -0.246183
info: 119.496208 -0.492366
info: 137.607954 -0.738549
info: 169.975012 -0.984732
info: Number of peaks in ring 1: 2
info: Number of peaks in ring 2: 2
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 0
info: Time taken 0.000011 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-2, -2, -4), (-2, 2, -4), (2, -2, -4), (-4, -2, -2), (-2, -4, -2), (2, 2, -4), (-4, 2, -2), (2, -4, -2), (-2, 4, -2), (4, -2, -2), (2, 4, -2), (4, 2, -2), (-4, -2, 2), (-2, -4, 2), (-4, 2, 2), (2, -4, 2), (-2, 4, 2), (4, -2, 2), (-2, -2, 4), (2, 4, 2), (4, 2, 2), (-2, 2, 4), (2, -2, 4), (2, 2, 4)]
info: Ring 2: [(-1, -1, -3), (-3, -1, -1), (-1, 1, -3), (-1, -3, -1), (1, -1, -3), (-3, 1, -1), (1, 1, -3), (1, -3, -1), (-3, -1, 1), (-1, -3, 1), (-3, 1, 1), (-1, 3, -1), (1, -3, 1), (3, -1, -1), (1, 3, -1), (3, 1, -1), (-1, 3, 1), (-1, -1, 3), (3, -1, 1), (-1, 1, 3), (1, 3, 1), (1, -1, 3), (3, 1, 1), (1, 1, 3)]
info: Possible angles and cosines between peaks in rings:
info: 10.024988 0.984732
info: 42.392046 0.738549
info: 60.503792 0.492366
info: 75.748245 0.246183
info: 90.000000 0.000000
info: 104.251755 -0.246183
info: 119.496208 -0.492366
info: 137.607954 -0.738549
info: 169.975012 -0.984732
info: Number of peaks in ring 1: 2
info: Number of peaks in ring 2: 2
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 0
info: Time taken 0.000011 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -1, -3), (-3, -1, -1), (-1, 1, -3), (-1, -3, -1), (1, -1, -3), (-3, 1, -1), (1, 1, -3), (1, -3, -1), (-3, -1, 1), (-1, -3, 1), (-3, 1, 1), (-1, 3, -1), (1, -3, 1), (3, -1, -1), (1, 3, -1), (3, 1, -1), (-1, 3, 1), (-1, -1, 3), (3, -1, 1), (-1, 1, 3), (1, 3, 1), (1, -1, 3), (3, 1, 1), (1, 1, 3)]
info: Ring 2: [(-3, -3, -1), (-3, -3, 1), (-3, -1, -3), (-1, -3, -3), (-3, -1, 3), (-3, 1, -3), (-1, -3, 3), (-3, 1, 3), (1, -3, -3), (-3, 3, -1), (-3, 3, 1), (1, -3, 3), (-1, 3, -3), (3, -3, -1), (3, -3, 1), (-1, 3, 3), (3, -1, -3), (1, 3, -3), (3, -1, 3), (3, 1, -3), (1, 3, 3), (3, 1, 3), (3, 3, -1), (3, 3, 1)]
info: Possible angles and cosines between peaks in rings:
info: 25.943119 0.899229
info: 40.457640 0.760886
info: 51.497922 0.622543
info: 61.039920 0.484200
info: 69.765867 0.345857
info: 78.023274 0.207514
info: 101.976726 -0.207514
info: 110.234133 -0.345857
info: 118.960080 -0.484200
info: 128.502078 -0.622543
info: 139.542360 -0.760886
info: 154.056881 -0.899229
info: Number of peaks in ring 1: 2
info: Number of peaks in ring 2: 4
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 0
info: Time taken 0.000012 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-3, -3, -1), (-3, -3, 1), (-3, -1, -3), (-1, -3, -3), (-3, -1, 3), (-3, 1, -3), (-1, -3, 3), (-3, 1, 3), (1, -3, -3), (-3, 3, -1), (-3, 3, 1), (1, -3, 3), (-1, 3, -3), (3, -3, -1), (3, -3, 1), (-1, 3, 3), (3, -1, -3), (1, 3, -3), (3, -1, 3), (3, 1, -3), (1, 3, 3), (3, 1, 3), (3, 3, -1), (3, 3, 1)]
info: Ring 2: [(-1, -1, -3), (-3, -1, -1), (-1, 1, -3), (-1, -3, -1), (1, -1, -3), (-3, 1, -1), (1, 1, -3), (1, -3, -1), (-3, -1, 1), (-1, -3, 1), (-3, 1, 1), (-1, 3, -1), (1, -3, 1), (3, -1, -1), (1, 3, -1), (3, 1, -1), (-1, 3, 1), (-1, -1, 3), (3, -1, 1), (-1, 1, 3), (1, 3, 1), (1, -1, 3), (3, 1, 1), (1, 1, 3)]
info: Possible angles and cosines between peaks in rings:
info: 25.943119 0.899229
info: 40.457640 0.760886
info: 51.497922 0.622543
info: 61.039920 0.484200
info: 69.765867 0.345857
info: 78.023274 0.207514
info: 101.976726 -0.207514
info: 110.234133 -0.345857
info: 118.960080 -0.484200
info: 128.502078 -0.622543
info: 139.542360 -0.760886
info: 154.056881 -0.899229
info: Number of peaks in ring 1: 4
info: Number of peaks in ring 2: 2
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 0
info: Time taken 0.000013 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -1, -3), (-3, -1, -1), (-1, 1, -3), (-1, -3, -1), (1, -1, -3), (-3, 1, -1), (1, 1, -3), (1, -3, -1), (-3, -1, 1), (-1, -3, 1), (-3, 1, 1), (-1, 3, -1), (1, -3, 1), (3, -1, -1), (1, 3, -1), (3, 1, -1), (-1, 3, 1), (-1, -1, 3), (3, -1, 1), (-1, 1, 3), (1, 3, 1), (1, -1, 3), (3, 1, 1), (1, 1, 3)]
info: Ring 2: [(-1, -1, -3), (-3, -1, -1), (-1, 1, -3), (-1, -3, -1), (1, -1, -3), (-3, 1, -1), (1, 1, -3), (1, -3, -1), (-3, -1, 1), (-1, -3, 1), (-3, 1, 1), (-1, 3, -1), (1, -3, 1), (3, -1, -1), (1, 3, -1), (3, 1, -1), (-1, 3, 1), (-1, -1, 3), (3, -1, 1), (-1, 1, 3), (1, 3, 1), (1, -1, 3), (3, 1, 1), (1, 1, 3)]
info: Possible angles and cosines between peaks in rings:
info: 35.096801 0.818182
info: 50.478804 0.636364
info: 62.964308 0.454545
info: 84.784091 0.090909
info: 95.215909 -0.090909
info: 117.035692 -0.454545
info: 129.521196 -0.636364
info: 144.903199 -0.818182
info: Number of peaks in ring 1: 2
info: Number of peaks in ring 2: 2
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 0
info: Time taken 0.000011 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-2, -2, -4), (-2, 2, -4), (2, -2, -4), (-4, -2, -2), (-2, -4, -2), (2, 2, -4), (-4, 2, -2), (2, -4, -2), (-2, 4, -2), (4, -2, -2), (2, 4, -2), (4, 2, -2), (-4, -2, 2), (-2, -4, 2), (-4, 2, 2), (2, -4, 2), (-2, 4, 2), (4, -2, 2), (-2, -2, 4), (2, 4, 2), (4, 2, 2), (-2, 2, 4), (2, -2, 4), (2, 2, 4)]
info: Ring 2: [(-1, -5, -1), (-1, -5, 1), (1, -5, -1), (1, -5, 1), (-5, -1, -1), (-5, -1, 1), (-1, -1, -5), (-5, 1, -1), (-5, 1, 1), (1, -1, -5), (-1, -1, 5), (-1, 1, -5), (1, -1, 5), (1, 1, -5), (-1, 1, 5), (5, -1, -1), (5, -1, 1), (1, 1, 5), (5, 1, -1), (5, 1, 1), (-1, 5, -1), (-1, 5, 1), (1, 5, -1), (1, 5, 1), (-3, -3, -3), (-3, 3, -3), (-3, -3, 3), (3, -3, -3), (-3, 3, 3), (3, 3, -3), (3, -3, 3), (3, 3, 3)]
info: Possible angles and cosines between peaks in rings:
info: 19.471221 0.942809
info: 38.216923 0.785674
info: 51.057559 0.628539
info: 61.874494 0.471405
info: 71.683269 0.314270
info: 80.959369 0.157135
info: 90.000000 0.000000
info: 99.040631 -0.157135
info: 108.316731 -0.314270
info: 118.125506 -0.471405
info: 128.942441 -0.628539
info: 141.783077 -0.785674
info: 160.528779 -0.942809
info: Number of peaks in ring 1: 2
info: Number of peaks in ring 2: 6
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 0
info: Time taken 0.000012 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -5, -1), (-1, -5, 1), (1, -5, -1), (1, -5, 1), (-5, -1, -1), (-5, -1, 1), (-1, -1, -5), (-5, 1, -1), (-5, 1, 1), (1, -1, -5), (-1, -1, 5), (-1, 1, -5), (1, -1, 5), (1, 1, -5), (-1, 1, 5), (5, -1, -1), (5, -1, 1), (1, 1, 5), (5, 1, -1), (5, 1, 1), (-1, 5, -1), (-1, 5, 1), (1, 5, -1), (1, 5, 1), (-3, -3, -3), (-3, 3, -3), (-3, -3, 3), (3, -3, -3), (-3, 3, 3), (3, 3, -3), (3, -3, 3), (3, 3, 3)]
info: Ring 2: [(-2, -2, -4), (-2, 2, -4), (2, -2, -4), (-4, -2, -2), (-2, -4, -2), (2, 2, -4), (-4, 2, -2), (2, -4, -2), (-2, 4, -2), (4, -2, -2), (2, 4, -2), (4, 2, -2), (-4, -2, 2), (-2, -4, 2), (-4, 2, 2), (2, -4, 2), (-2, 4, 2), (4, -2, 2), (-2, -2, 4), (2, 4, 2), (4, 2, 2), (-2, 2, 4), (2, -2, 4), (2, 2, 4)]
info: Possible angles and cosines between peaks in rings:
info: 19.471221 0.942809
info: 38.216923 0.785674
info: 51.057559 0.628539
info: 61.874494 0.471405
info: 71.683269 0.314270
info: 80.959369 0.157135
info: 90.000000 0.000000
info: 99.040631 -0.157135
info: 108.316731 -0.314270
info: 118.125506 -0.471405
info: 128.942441 -0.628539
info: 141.783077 -0.785674
info: 160.528779 -0.942809
info: Number of peaks in ring 1: 6
info: Number of peaks in ring 2: 2
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 0
info: Time taken 0.000015 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-3, -3, -1), (-3, -3, 1), (-3, -1, -3), (-1, -3, -3), (-3, -1, 3), (-3, 1, -3), (-1, -3, 3), (-3, 1, 3), (1, -3, -3), (-3, 3, -1), (-3, 3, 1), (1, -3, 3), (-1, 3, -3), (3, -3, -1), (3, -3, 1), (-1, 3, 3), (3, -1, -3), (1, 3, -3), (3, -1, 3), (3, 1, -3), (1, 3, 3), (3, 1, 3), (3, 3, -1), (3, 3, 1)]
info: Ring 2: [(-1, -5, -1), (-1, -5, 1), (1, -5, -1), (1, -5, 1), (-5, -1, -1), (-5, -1, 1), (-1, -1, -5), (-5, 1, -1), (-5, 1, 1), (1, -1, -5), (-1, -1, 5), (-1, 1, -5), (1, -1, 5), (1, 1, -5), (-1, 1, 5), (5, -1, -1), (5, -1, 1), (1, 1, 5), (5, 1, -1), (5, 1, 1), (-1, 5, -1), (-1, 5, 1), (1, 5, -1), (1, 5, 1), (-3, -3, -3), (-3, 3, -3), (-3, -3, 3), (3, -3, -3), (-3, 3, 3), (3, 3, -3), (3, -3, 3), (3, 3, 3)]
info: Possible angles and cosines between peaks in rings:
info: 22.001714 0.927173
info: 32.978962 0.838870
info: 41.360367 0.750568
info: 48.527066 0.662266
info: 54.972886 0.573964
info: 60.944155 0.485662
info: 77.246595 0.220755
info: 82.388621 0.132453
info: 87.469507 0.044151
info: 92.530493 -0.044151
info: 97.611379 -0.132453
info: 102.753405 -0.220755
info: 119.055845 -0.485662
info: 125.027114 -0.573964
info: 131.472934 -0.662266
info: 138.639633 -0.750568
info: 147.021038 -0.838870
info: 157.998286 -0.927173
info: Number of peaks in ring 1: 4
info: Number of peaks in ring 2: 6
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 0
info: Time taken 0.000013 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -5, -1), (-1, -5, 1), (1, -5, -1), (1, -5, 1), (-5, -1, -1), (-5, -1, 1), (-1, -1, -5), (-5, 1, -1), (-5, 1, 1), (1, -1, -5), (-1, -1, 5), (-1, 1, -5), (1, -1, 5), (1, 1, -5), (-1, 1, 5), (5, -1, -1), (5, -1, 1), (1, 1, 5), (5, 1, -1), (5, 1, 1), (-1, 5, -1), (-1, 5, 1), (1, 5, -1), (1, 5, 1), (-3, -3, -3), (-3, 3, -3), (-3, -3, 3), (3, -3, -3), (-3, 3, 3), (3, 3, -3), (3, -3, 3), (3, 3, 3)]
info: Ring 2: [(-3, -3, -1), (-3, -3, 1), (-3, -1, -3), (-1, -3, -3), (-3, -1, 3), (-3, 1, -3), (-1, -3, 3), (-3, 1, 3), (1, -3, -3), (-3, 3, -1), (-3, 3, 1), (1, -3, 3), (-1, 3, -3), (3, -3, -1), (3, -3, 1), (-1, 3, 3), (3, -1, -3), (1, 3, -3), (3, -1, 3), (3, 1, -3), (1, 3, 3), (3, 1, 3), (3, 3, -1), (3, 3, 1)]
info: Possible angles and cosines between peaks in rings:
info: 22.001714 0.927173
info: 32.978962 0.838870
info: 41.360367 0.750568
info: 48.527066 0.662266
info: 54.972886 0.573964
info: 60.944155 0.485662
info: 77.246595 0.220755
info: 82.388621 0.132453
info: 87.469507 0.044151
info: 92.530493 -0.044151
info: 97.611379 -0.132453
info: 102.753405 -0.220755
info: 119.055845 -0.485662
info: 125.027114 -0.573964
info: 131.472934 -0.662266
info: 138.639633 -0.750568
info: 147.021038 -0.838870
info: 157.998286 -0.927173
info: Number of peaks in ring 1: 6
info: Number of peaks in ring 2: 4
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 0
info: Time taken 0.000016 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -1, -3), (-3, -1, -1), (-1, 1, -3), (-1, -3, -1), (1, -1, -3), (-3, 1, -1), (1, 1, -3), (1, -3, -1), (-3, -1, 1), (-1, -3, 1), (-3, 1, 1), (-1, 3, -1), (1, -3, 1), (3, -1, -1), (1, 3, -1), (3, 1, -1), (-1, 3, 1), (-1, -1, 3), (3, -1, 1), (-1, 1, 3), (1, 3, 1), (1, -1, 3), (3, 1, 1), (1, 1, 3)]
info: Ring 2: [(-1, -5, -1), (-1, -5, 1), (1, -5, -1), (1, -5, 1), (-5, -1, -1), (-5, -1, 1), (-1, -1, -5), (-5, 1, -1), (-5, 1, 1), (1, -1, -5), (-1, -1, 5), (-1, 1, -5), (1, -1, 5), (1, 1, -5), (-1, 1, 5), (5, -1, -1), (5, -1, 1), (1, 1, 5), (5, 1, -1), (5, 1, 1), (-1, 5, -1), (-1, 5, 1), (1, 5, -1), (1, 5, 1), (-3, -3, -3), (-3, 3, -3), (-3, -3, 3), (3, -3, -3), (-3, 3, 3), (3, 3, -3), (3, -3, 3), (3, 3, 3)]
info: Possible angles and cosines between peaks in rings:
info: 9.446233 0.986440
info: 29.496208 0.870388
info: 41.032571 0.754337
info: 58.517846 0.522233
info: 66.034832 0.406181
info: 79.975012 0.174078
info: 86.673493 0.058026
info: 93.326507 -0.058026
info: 100.024988 -0.174078
info: 113.965168 -0.406181
info: 121.482154 -0.522233
info: 138.967429 -0.754337
info: 150.503792 -0.870388
info: 170.553767 -0.986440
info: Number of peaks in ring 1: 2
info: Number of peaks in ring 2: 6
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 2
info: Time taken 0.000013 /s
info: Scoring 2 potential orientations
info: Number of orientations with more than 30 peaks is 100
info: Time taken 0.026/s
info: UBI for best fitting
[[ 2.98549839 -1.9973725 -4.07737656]
[ 1.23869934 5.06522209 -1.58713285]
[ 4.38313438 -0.06623563 3.23764343]]
info: Unit cell: (5.433939374668945, 5.45067349527024, 5.4496411934491205, 90.08618757723819, 89.96701829125598, 89.89875491202103)
info: Indexes 76 peaks, with <drlv2>=0.006492
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 14
info: Tried r1=2 r2=7 attempt 11 of 49, got 100 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -5, -1), (-1, -5, 1), (1, -5, -1), (1, -5, 1), (-5, -1, -1), (-5, -1, 1), (-1, -1, -5), (-5, 1, -1), (-5, 1, 1), (1, -1, -5), (-1, -1, 5), (-1, 1, -5), (1, -1, 5), (1, 1, -5), (-1, 1, 5), (5, -1, -1), (5, -1, 1), (1, 1, 5), (5, 1, -1), (5, 1, 1), (-1, 5, -1), (-1, 5, 1), (1, 5, -1), (1, 5, 1), (-3, -3, -3), (-3, 3, -3), (-3, -3, 3), (3, -3, -3), (-3, 3, 3), (3, 3, -3), (3, -3, 3), (3, 3, 3)]
info: Ring 2: [(-1, -1, -3), (-3, -1, -1), (-1, 1, -3), (-1, -3, -1), (1, -1, -3), (-3, 1, -1), (1, 1, -3), (1, -3, -1), (-3, -1, 1), (-1, -3, 1), (-3, 1, 1), (-1, 3, -1), (1, -3, 1), (3, -1, -1), (1, 3, -1), (3, 1, -1), (-1, 3, 1), (-1, -1, 3), (3, -1, 1), (-1, 1, 3), (1, 3, 1), (1, -1, 3), (3, 1, 1), (1, 1, 3)]
info: Possible angles and cosines between peaks in rings:
info: 9.446233 0.986440
info: 29.496208 0.870388
info: 41.032571 0.754337
info: 58.517846 0.522233
info: 66.034832 0.406181
info: 79.975012 0.174078
info: 86.673493 0.058026
info: 93.326507 -0.058026
info: 100.024988 -0.174078
info: 113.965168 -0.406181
info: 121.482154 -0.522233
info: 138.967429 -0.754337
info: 150.503792 -0.870388
info: 170.553767 -0.986440
info: Number of peaks in ring 1: 6
info: Number of peaks in ring 2: 2
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 4
info: Time taken 0.000021 /s
info: Scoring 4 potential orientations
info: Number of orientations with more than 30 peaks is 100
info: Time taken 0.026/s
info: UBI for best fitting
[[ 2.98549839 -1.9973725 -4.07737656]
[ 1.23869934 5.06522209 -1.58713285]
[ 4.38313438 -0.06623563 3.23764343]]
info: Unit cell: (5.433939374668945, 5.45067349527024, 5.4496411934491205, 90.08618757723819, 89.96701829125598, 89.89875491202103)
info: Indexes 76 peaks, with <drlv2>=0.006492
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 14
info: Tried r1=7 r2=2 attempt 12 of 49, got 100 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -5, -1), (-1, -5, 1), (1, -5, -1), (1, -5, 1), (-5, -1, -1), (-5, -1, 1), (-1, -1, -5), (-5, 1, -1), (-5, 1, 1), (1, -1, -5), (-1, -1, 5), (-1, 1, -5), (1, -1, 5), (1, 1, -5), (-1, 1, 5), (5, -1, -1), (5, -1, 1), (1, 1, 5), (5, 1, -1), (5, 1, 1), (-1, 5, -1), (-1, 5, 1), (1, 5, -1), (1, 5, 1), (-3, -3, -3), (-3, 3, -3), (-3, -3, 3), (3, -3, -3), (-3, 3, 3), (3, 3, -3), (3, -3, 3), (3, 3, 3)]
info: Ring 2: [(-1, -5, -1), (-1, -5, 1), (1, -5, -1), (1, -5, 1), (-5, -1, -1), (-5, -1, 1), (-1, -1, -5), (-5, 1, -1), (-5, 1, 1), (1, -1, -5), (-1, -1, 5), (-1, 1, -5), (1, -1, 5), (1, 1, -5), (-1, 1, 5), (5, -1, -1), (5, -1, 1), (1, 1, 5), (5, 1, -1), (5, 1, 1), (-1, 5, -1), (-1, 5, 1), (1, 5, -1), (1, 5, 1), (-3, -3, -3), (-3, 3, -3), (-3, -3, 3), (3, -3, -3), (-3, 3, 3), (3, 3, -3), (3, -3, 3), (3, 3, 3)]
info: Possible angles and cosines between peaks in rings:
info: 22.191607 0.925926
info: 31.586338 0.851852
info: 38.942441 0.777778
info: 56.251011 0.555556
info: 65.957924 0.407407
info: 70.528779 0.333333
info: 87.877449 0.037037
info: 92.122551 -0.037037
info: 109.471221 -0.333333
info: 114.042076 -0.407407
info: 123.748989 -0.555556
info: 141.057559 -0.777778
info: 148.413662 -0.851852
info: 157.808393 -0.925926
info: Number of peaks in ring 1: 6
info: Number of peaks in ring 2: 6
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 0
info: Time taken 0.000021 /s
info:
Tested 12 pairs and found 100 grains so far
Grain position and UBI refinement#
Indexed with direct beam g-vectors, refined with direct beam centroids
Indexed with reflected beam g-vectors, refined with reflected beam centroids
Indexed with combined g-vectors, refined with both direct and reflected beam centroids (alternating)
We implement a gradient-aware minimiser using ADAM from the Optax library. The loss function itself is identical to makemap.py in ImageD11.
Peak to grain assignment#
We have to establish static peak to grain assignments before we can refine, so grains do not compete for peaks. We do this just like ImageD11 - each peak is assigned to the grain that best indexes it (yields \(hkl\) values closest to integer).
[22]:
@jax.jit
def assign(ubi, q_sample):
hklf = (ubi @ q_sample.T).T
hkli = jnp.rint(hklf)
hkle = jnp.linalg.norm(hklf - hkli)
return hkle, hkli
assign_peaks = jax.vmap(assign, in_axes=[None, 0])
assign_grains = jax.vmap(assign_peaks, in_axes=[0, None])
# compute hkl errors
hkle_dir, hkli_dir = assign_grains(jnp.array(idx_dir.ubis), q_sample_direct[mask_dir])
hkle_refl, hkli_refl = assign_grains(jnp.array(idx_refl.ubis), q_sample_refl[mask_refl])
hkle_both, hkli_both = assign_grains(jnp.array(idx_both.ubis), q_sample_cat)
# get grain assignments (minimised error per peak)
ga_dir = jnp.argmin(hkle_dir, axis=0)
ga_refl = jnp.argmin(hkle_refl, axis=0)
ga_both = jnp.argmin(hkle_both, axis=0)
# get hkli per peak
hkli_dir = jnp.squeeze(jnp.take_along_axis(hkli_dir, ga_dir[None, :, None], axis=0))
hkli_refl = jnp.squeeze(jnp.take_along_axis(hkli_refl, ga_refl[None, :, None], axis=0))
hkli_both = jnp.squeeze(jnp.take_along_axis(hkli_both, ga_both[None, :, None], axis=0))
# max grains per peak
M = max(jnp.unique(ga_dir, return_counts=True)[1].max(), jnp.unique(ga_refl, return_counts=True)[1].max(), jnp.unique(ga_both, return_counts=True)[1].max())
M
[22]:
Array(74, dtype=int64)
[23]:
@jax.jit
def solve_ub_analytical(hkl_int, q_sample, mask):
"""q = UB @ h => UB = (Q^T H)(H^T H)^-1, masked rows contributing zero."""
m = mask.astype(q_sample.dtype)[:, None]
H = hkl_int * m
Qs = q_sample * m
HHT = H.T @ H # (3, 3), symmetric
QsHT = Qs.T @ H
# degenerate grains would otherwise NaN one row of the vmapped batch
HHT = HHT + (1e-12 * jnp.trace(HHT) + 1e-15) * jnp.eye(3, dtype=HHT.dtype)
return jnp.linalg.solve(HHT, QsHT.T).T
@jax.jit
def get_grain_loss_function(ubi, origin_sample, cen_obs, hkl_int, wavelength, kvecs, mask):
# NOTE: `ubi` is deliberately unused — UB is profiled out analytically below.
q_sample = detector_to_q_vec(cen_obs[:, 0], cen_obs[:, 1], cen_obs[:, 2],
wavelength, kvecs, origin_sample)
ub_fit = solve_ub_analytical(hkl_int, q_sample, mask)
ubi_fit = jnp.linalg.inv(ub_fit)
d = jnp.linalg.solve(ub_fit, q_sample.T).T - hkl_int
hkle = jnp.sqrt(jnp.sum(d * d, axis=1) + 1e-24) # NaN-safe at zero residual
mf = mask.astype(hkle.dtype)
return jnp.sum(hkle * mf) / (jnp.sum(mf) + 1e-10) + 1e-10, ubi_fit
@partial(jax.jit, static_argnums=(7,))
def refine_grain(initial_ubi, initial_origin, cen_obs, hkl_int, wavelength, kvecs, mask,
num_steps=100, learning_rate=1e-2, scaling_factor=1000.0):
x0 = initial_origin / scaling_factor
optimizer = optax.adam(learning_rate=learning_rate)
opt_state0 = optimizer.init(x0)
def objective(scaled_origin):
loss, ubi = get_grain_loss_function(
initial_ubi, scaled_origin * scaling_factor,
cen_obs, hkl_int, wavelength, kvecs, mask)
return loss, ubi
grad_fn = jax.value_and_grad(objective, has_aux=True)
def scan_body(carry, _):
x, opt_state, best_x, best_loss = carry
(loss, _), grads = grad_fn(x)
better = loss < best_loss
best_x = jnp.where(better, x, best_x)
best_loss = jnp.where(better, loss, best_loss)
updates, opt_state = optimizer.update(grads, opt_state)
x = optax.apply_updates(x, updates)
return (x, opt_state, best_x, best_loss), loss
init_carry = (x0, opt_state0, x0, jnp.asarray(jnp.inf, x0.dtype))
(_, _, best_x, _), loss_history = jax.lax.scan(
scan_body, init_carry, None, length=num_steps)
final_origin = best_x * scaling_factor
final_loss, final_ubi = get_grain_loss_function(
initial_ubi, final_origin, cen_obs, hkl_int, wavelength, kvecs, mask)
loss_history = jnp.concatenate([loss_history, final_loss[None]])
return final_ubi, final_origin, loss_history
refine_vmap = jax.vmap(
refine_grain,
in_axes=(0, 0, 0, 0, 0, 0, 0, None, None, None)
)
Just direct beam#
[24]:
%%time
all_masks_dir = jnp.array([ga_dir == gid for gid in range(len(idx_dir.ubis))])
all_origins_dir = jnp.zeros((len(idx_dir.ubis), 3))
def get_compressed_grain_data(grain_id, assignments, cen, hkl, wave, kvec):
# Create a boolean mask for this specific grain
grain_mask = (assignments == grain_id)
# Use top_k to find the indices of the True values.
# This identifies exactly which rows in the filtered arrays belong to this grain.
# Since we want static shapes, we always take M indices.
_, indices = jax.lax.top_k(grain_mask.astype(kvec.dtype), M)
# Gather the data for this grain
# If the grain has < M peaks, top_k will pad with the last found index,
# but the 'mask' will correctly be False for those duplicates.
return {
"cen": cen[indices],
"hkl": hkl[indices],
"wave": wave[indices],
"kvec": kvec[indices],
"mask": grain_mask[indices]
}
# Vectorize the packing over all grain IDs
v_pack = jax.vmap(
get_compressed_grain_data,
in_axes=(0, None, None, None, None, None)
)
# Pack the data into grain-specific buffers (num_grains, M, ...)
grain_ids_dir = jnp.arange(len(idx_dir.ubis))
compressed_dir = v_pack(grain_ids_dir, ga_dir, centroid_with_error[mask_dir], hkli_dir, wavelengths, kvecs_direct)
# …likewise compressed_refl, compressed_both
# Run the refinement
# All inputs (except scalars) are now (num_grains, ...) so in_axes are all 0
ubis_fit_dir, origins_sample_fit_dir, all_losses_dir = refine_vmap(
jnp.array(idx_dir.ubis),
all_origins_dir,
compressed_dir["cen"],
compressed_dir["hkl"],
compressed_dir["wave"],
compressed_dir["kvec"],
compressed_dir["mask"],
100,
1e-2,
1000.0
)
ubis_fit_dir.block_until_ready()
CPU times: user 2.66 s, sys: 52.2 ms, total: 2.71 s
Wall time: 1.38 s
[24]:
Array([[[ 2.09753246, 1.76517693, -4.70347748],
[-3.63144536, -2.98785082, -2.73993678],
[-3.47120343, 4.19259302, 0.02681224]],
[[ 1.28459439, 2.00698814, -4.89440103],
[-2.12209568, 4.80968473, 1.41422273],
[ 4.84469798, 1.5734274 , 1.91703291]],
[[-3.27618993, 1.13364834, -4.19795409],
[-2.77766772, -4.58929074, 0.93052044],
[-3.34424639, 2.70252456, 3.34079638]],
[[ 2.82483156, 0.81135155, -4.58215243],
[-0.88257846, 5.3572186 , 0.40469544],
[ 4.56884272, 0.5340765 , 2.9124703 ]],
[[ 1.73926132, -3.39042287, -3.88727626],
[-3.06223375, 2.62231141, -3.65738417],
[ 4.15138991, 3.35553985, -1.06809867]],
[[-3.01937647, -1.85745014, -4.13185394],
[ 4.46793771, -2.04450145, -2.34489225],
[-0.75257968, -4.68834771, 2.65999756]],
[[ 1.50566464, -2.41786345, -4.63886696],
[-0.80974424, 4.66008984, -2.69195804],
[ 5.1694807 , 1.43365836, 0.92931047]],
[[-1.6157819 , 2.47418106, -4.57213438],
[ 4.36317522, -1.95620011, -2.60093477],
[-2.82576285, -4.43692107, -1.40151931]],
[[-1.16370169, 2.22263219, -4.83163518],
[-3.48500483, -4.05341498, -1.02411033],
[-4.01666405, 2.87411876, 2.28995463]],
[[-2.1657806 , 0.93227415, -4.90673812],
[ 4.99408785, 0.33190067, -2.14180505],
[-0.0654086 , -5.35470212, -0.98894638]],
[[ 1.97860086, -1.44710014, -4.8607094 ],
[-5.06351226, -0.28658349, -1.97547192],
[ 0.26773328, 5.23975432, -1.44993051]],
[[ 1.59226163, 1.88299608, -4.85375815],
[-0.59150404, -4.976475 , -2.12449143],
[-5.17155989, 1.14888383, -1.250986 ]],
[[-2.78730401, 1.76442872, -4.33069195],
[ 2.69781315, -3.51050861, -3.16702771],
[-3.8192694 , -3.76828519, 0.92392085]],
[[-3.64508725, -0.47464268, -4.01512208],
[ 3.23771761, -3.57763791, -2.51820933],
[-2.41979451, -4.07560544, 2.67752153]],
[[ 1.02783465, -3.65997294, -3.89568499],
[-3.01228297, 2.88038783, -3.50072648],
[ 4.41563909, 2.81788465, -1.48292626]],
[[ 3.23705414, 0.08372948, -4.37655554],
[-3.8815943 , -2.46087195, -2.91769625],
[-2.02344661, 4.85445834, -1.40330038]],
[[ 3.19123748, -1.87398289, -3.99206484],
[ 4.05478463, 3.18413316, 1.7476159 ],
[ 1.73350207, -3.99817924, 3.26161359]],
[[-2.76253218, -1.5862988 , -4.41332639],
[ 0.75111265, -5.20597325, 1.40107165],
[-4.62984441, 0.10208688, 2.8620118 ]],
[[-2.44974216, 0.66139335, -4.8162544 ],
[-2.81218645, -4.59168065, 0.80052855],
[-3.96580086, 2.84826007, 2.40789363]],
[[ 2.98593882, -2.00000605, -4.08767054],
[-4.37976123, 0.06555859, -3.23173205],
[ 1.23723616, 5.06330992, -1.57400706]],
[[-2.80626021, 1.87743023, -4.26990065],
[ 4.57359968, 0.13180612, -2.94934862],
[-0.91409989, -5.10769299, -1.64402352]],
[[-0.0882765 , 2.630008 , -4.76576733],
[ 0.41024157, -4.74948607, -2.6275472 ],
[-5.42621436, -0.40140612, -0.12070348]],
[[ 2.70314137, 0.75959876, -4.66281853],
[-3.47931656, -3.31550031, -2.55665152],
[-3.19591446, 4.24923422, -1.16096275]],
[[-0.53612347, -2.17385066, -4.96174677],
[ 3.34940076, -4.0531257 , 1.41180683],
[-4.25697193, -2.91425669, 1.73688263]],
[[-3.20682196, -1.81947117, -4.00457398],
[ 0.44011029, -5.06446624, 1.94858106],
[-4.37620325, 0.82411042, 3.13050934]],
[[ 0.13744626, 2.85932426, -4.6298936 ],
[-4.17151581, 3.0282882 , 1.74732241],
[ 3.49637739, 3.50359264, 2.26772774]],
[[ 2.42212798, 0.46306158, -4.85293888],
[-1.67674882, 5.16749419, -0.34482643],
[ 4.57825004, 1.64808986, 2.44287358]],
[[ 0.59667776, 3.51175146, -4.11779827],
[-5.40833477, 0.23851555, -0.58021699],
[-0.1934366 , 4.15206971, 3.51339533]],
[[-2.72055347, -1.82564454, -4.34720017],
[ 4.51600957, 0.43297285, -3.00788688],
[ 1.35365509, -5.10996829, 1.29746275]],
[[-1.88346584, 2.58830462, -4.40288767],
[-4.69044816, -2.73514188, 0.39853612],
[-2.02201835, 3.93027018, 3.17597802]],
[[ 2.14669855, 1.63491571, -4.7286641 ],
[-3.29702425, -3.40745104, -2.67435653],
[-3.76278776, 3.91843631, -0.35326578]],
[[-1.83730251, 2.11359186, -4.66768257],
[-0.4953283 , -5.00816692, -2.07275483],
[-5.10017537, -0.2738461 , 1.88283377]],
[[ 2.52461086, 1.21432883, -4.66753497],
[-4.01902718, -2.38191881, -2.79346812],
[-2.66617745, 4.74215382, -0.20797579]],
[[ 2.33010509, 2.52402844, -4.22319657],
[-4.2392047 , -1.34225721, -3.14064291],
[-2.49695919, 4.63292642, 1.39135177]],
[[-0.78076511, 3.21594285, -4.32248473],
[-4.97755922, 1.24073392, 1.82221726],
[ 2.06133533, 4.21287844, 2.76250557]],
[[ 1.0542753 , 2.01158233, -4.94726178],
[ 0.77679126, -5.04660894, -1.88646367],
[-5.28465577, -0.34046108, -1.26571179]],
[[ 2.41634031, 1.01379187, -4.77110243],
[ 0.44195936, 5.25776356, 1.34099168],
[ 4.8579205 , -0.98397299, 2.2498155 ]],
[[ 1.96710402, 1.25796178, -4.91755739],
[-0.20410471, 5.28871239, 1.27165527],
[ 5.07150019, -0.2774329 , 1.95770477]],
[[ 2.09460166, -2.63342958, -4.27893092],
[-3.15218456, 2.92137654, -3.3415689 ],
[ 3.91243432, 3.76510722, -0.40180404]],
[[ 3.37457245, 1.4162487 , -4.03051056],
[-4.23270676, 1.79586309, -2.91388215],
[ 0.57282881, 4.94036334, 2.21409928]],
[[-2.98008586, 1.41568692, -4.32985455],
[ 0.36381701, -5.084077 , -1.91292113],
[-4.54215274, -1.33785328, 2.6883119 ]],
[[-2.00849785, 2.56273199, -4.36242315],
[-2.51719613, -4.57733482, -1.5279143 ],
[-4.3878505 , 1.45427657, 2.87487712]],
[[-3.78897571, -0.52958477, -3.87248316],
[-0.84639209, -5.15405027, 1.53503467],
[-3.81588834, 1.67162833, 3.50551471]],
[[-2.33809344, 2.95400541, -3.92917 ],
[-0.70438091, -4.50680616, -2.97048379],
[-4.86540545, -0.76677272, 2.31690878]],
[[-1.72654715, -2.83599615, -4.31377067],
[ 5.06112136, -0.03074736, -2.00603162],
[ 1.02028091, -4.64688848, 2.64731414]],
[[-3.14401691, -1.14523947, -4.29365624],
[ 4.2648382 , 0.6958221 , -3.30971815],
[ 1.24611264, -5.27669184, 0.49625033]],
[[ 0.36005724, 3.66181322, -4.01084021],
[ 0.39959496, -4.02719139, -3.64072455],
[-5.41612045, -0.05386951, -0.5361019 ]],
[[ 2.74955359, 1.91920753, -4.28811372],
[-4.62101239, 2.00152576, -2.06794227],
[ 0.84789257, 4.68441737, 2.64004825]],
[[-2.11370201, -2.37786162, -4.41659016],
[ 5.01585088, -0.90644264, -1.91304134],
[ 0.10066994, -4.81235164, 2.54265451]],
[[-2.98400567, -0.60879597, 4.51191971],
[ 4.32384034, 1.30967796, 3.03652184],
[-1.42617146, 5.24874882, -0.23462923]],
[[-1.52302829, -2.45206015, 4.61454241],
[-0.37604048, 4.84570845, 2.45107944],
[-5.21274663, 0.36658715, -1.52524289]],
[[ 0.80962473, 3.22449189, 4.30963684],
[-2.83876696, -3.44708543, 3.11317098],
[ 4.57231393, -2.71209384, 1.16982599]],
[[ 1.77579686, -1.21593802, 5.00065421],
[-5.09610314, -1.15316336, 1.5285001 ],
[ 0.71744051, -5.18018721, -1.51423272]],
[[-1.63547897, -5.17519391, -0.41354675],
[-5.17118679, 1.58693004, 0.61223774],
[-0.46124944, 0.57662852, -5.39403719]],
[[-1.74364925, -5.08969341, -0.83523852],
[-5.11793313, 1.600563 , 0.93239725],
[-0.62639454, 1.08268588, -5.29707048]],
[[-0.26879232, 5.26932341, 1.33762124],
[ 0.735819 , -1.29092907, 5.23682918],
[ 5.38744375, 0.44056631, -0.64879085]],
[[ 0.87494615, -1.09844183, 5.25951114],
[-1.40754283, 5.097819 , 1.29778285],
[-5.18451383, -1.56703603, 0.5357186 ]],
[[ 0.44039247, -0.37015605, 5.41383047],
[-5.20702516, 1.49652831, 0.52622865],
[-1.52467545, -5.21996119, -0.23289048]],
[[ 1.31529425, 0.8351082 , 5.21612729],
[-3.05604268, -4.26466106, 1.45303469],
[ 4.30855482, -3.2793693 , -0.56047905]],
[[ 1.72649786, 0.67423202, 5.11856016],
[-3.2376099 , -4.06149237, 1.62744422],
[ 4.02262639, -3.56004651, -0.88713584]],
[[ 1.3926358 , -1.224855 , 5.11800898],
[-2.36763841, 4.58136215, 1.74123824],
[-4.69950211, -2.67144154, 0.6376724 ]],
[[ 1.20992358, 3.69963976, 3.8069457 ],
[ 1.26091755, -3.99319282, 3.4787097 ],
[ 5.15534864, 0.10834879, -1.7445897 ]],
[[ 4.26111356, -3.13502999, 1.28631548],
[-0.70024586, 1.20839504, 5.26254829],
[-3.31454887, -4.28397891, 0.54250687]],
[[ 4.96752654, -1.09833943, 1.93755499],
[-1.91344674, 0.32066381, 5.0859916 ],
[-1.14121863, -5.32228323, -0.09393136]],
[[-1.99812454, -0.39939716, 5.04763374],
[ 4.00233354, 3.20034189, 1.83637349],
[-3.1017048 , 4.38592867, -0.88206725]],
[[ 2.6718031 , -4.335567 , 1.92212389],
[-1.70122475, 1.18276083, 5.03380358],
[-4.42643051, -3.07225775, -0.77338836]],
[[-2.86470277, 4.61281008, 0.38690795],
[ 0.1528702 , -0.35983469, 5.4299586 ],
[ 4.62616228, 2.86833639, 0.06011044]],
[[-3.74862792, 1.76271377, 3.53135216],
[ 3.88002646, 0.76023039, 3.74045216],
[ 0.71949543, 5.09504191, -1.77931434]],
[[ 5.38615202, 0.40861026, 0.67531247],
[-0.69490147, 0.23606104, 5.39318305],
[ 0.37491118, -5.4231438 , 0.28652402]],
[[ 1.25801388, -4.9157821 , 1.97208554],
[-1.22859559, 1.70140633, 5.02314765],
[-5.15140162, -1.6055741 , -0.71596179]],
[[-4.78261808, -0.80724082, 2.47121643],
[-1.87505217, -2.50556439, -4.45235056],
[ 1.80056562, -4.76573013, 1.92180957]],
[[-3.207685 , -3.51840779, -2.64019793],
[ 3.668156 , -0.33720148, -4.00782609],
[ 2.42579851, -4.14071484, 2.56990457]],
[[ 0.94537719, -5.01953264, 1.88393724],
[ 2.07621242, -1.42089861, -4.82829541],
[ 4.94318683, 1.55527576, 1.66726359]],
[[-4.19138287, -3.03996089, 1.68215948],
[-0.3586686 , -2.24301267, -4.9475243 ],
[ 3.45535224, -3.91869767, 1.52615052]],
[[-3.75381389, 3.18695604, 2.32293327],
[-2.96498173, -0.16535628, -4.56277801],
[-2.59867991, -4.41073345, 1.85021445]],
[[-2.47132526, 4.32942471, -2.18841574],
[-0.69077939, -2.74487748, -4.64952319],
[-4.80209272, -1.83356247, 1.79613728]],
[[-1.0639095 , 1.53077367, -5.1144502 ],
[-0.48151485, 5.16551737, 1.64596695],
[ 5.31658567, 0.77489941, -0.87439395]],
[[-1.28002904, -1.37695014, -5.10802711],
[-4.52715 , 3.00428514, 0.32456004],
[ 2.73684444, 4.32621966, -1.85243669]],
[[ 0.52565502, -5.40018657, -0.44447636],
[-1.24895132, -0.55549078, 5.26955097],
[-5.27270967, -0.406325 , -1.29316259]],
[[ 5.02181417, -2.09907861, 0.04168189],
[-0.6302109 , -1.39892374, 5.22299442],
[-2.00453626, -4.82387999, -1.53281937]],
[[-3.07179572, -3.94205104, -2.1597853 ],
[-3.83442228, 0.93673397, 3.74757291],
[-2.34100961, 3.63650043, -3.30591816]],
[[-3.86765254, 0.58864621, -3.785532 ],
[-3.02765269, 2.82955361, 3.53099892],
[ 2.34821034, 4.6135618 , -1.68365846]],
[[ 4.67134997, -2.53343474, -1.18823582],
[ 1.25153819, -0.17545713, 5.29502996],
[-2.50448136, -4.81535707, 0.4270588 ]],
[[ 1.60971393, -0.94286031, -5.11413797],
[ 5.08938334, 1.38670643, 1.34488904],
[ 1.07054427, -5.18033165, 1.29132953]],
[[-1.49945394, -1.31130922, -5.06662947],
[-4.89786913, -1.50874242, 1.83949905],
[-1.84713952, 5.06298119, -0.76422187]],
[[-4.99731621, 2.07441441, -0.59245308],
[-0.53005062, 0.26636936, 5.41089814],
[ 2.0922964 , 5.02581849, -0.0429204 ]],
[[ 2.08151224, -4.97191665, -0.76712909],
[ 0.10364612, -0.78904391, 5.38526877],
[-5.02791457, -2.07455478, -0.20770331]],
[[ 3.37503057, 2.3193353 , -3.58600622],
[ 4.12375751, -2.95989725, 1.96670515],
[-1.11247665, -3.93560417, -3.59144141]],
[[-3.05473005, 3.88584114, -2.27834347],
[ 1.94155346, 3.61922488, 3.57172211],
[ 4.06575922, 1.19052681, -3.41840136]],
[[-3.01471884, -4.42862207, 0.96415038],
[ 1.02658874, -1.79587217, -5.03503412],
[ 4.41567588, -2.6067794 , 1.82980542]],
[[-0.63583456, -3.94091216, 3.70107976],
[ 4.519035 , -2.4330429 , -1.81283093],
[ 2.96626592, 2.86130688, 3.5567539 ]],
[[-4.23230877, -1.72983099, 2.95330002],
[ 3.42211037, -2.22902345, 3.59832847],
[ 0.06425111, 4.65478336, 2.82071152]],
[[-1.4562885 , 1.00171466, 5.14978813],
[ 0.39445587, -5.30822622, 1.14288028],
[ 5.23193098, 0.67834551, 1.34833454]],
[[-3.47155205, 2.16387807, 3.5923472 ],
[-0.28739035, -4.77570612, 2.59884205],
[ 4.18246003, 1.46789269, 3.16042276]],
[[-4.75188123, 0.15670727, 2.65135636],
[ 1.75080081, -3.90409082, 3.36583557],
[ 1.9971287 , 3.79021029, 3.35779181]],
[[-4.39978783, 1.54518635, 2.8073181 ],
[ 1.11730674, -3.73019361, 3.8039582 ],
[ 3.00397621, 3.65046845, 2.69914319]],
[[-4.12130775, -1.10998305, 3.37949541],
[ 3.09460248, -3.66412924, 2.57292027],
[ 1.74844583, 3.87014228, 3.40416132]],
[[-4.1360497 , -2.02059912, 2.907132 ],
[ 3.5393831 , -2.27875662, 3.45315186],
[-0.06209244, 4.51353806, 3.04241323]],
[[ 3.3343267 , -3.20483924, 2.87380254],
[ 1.5887278 , 4.2946982 , 2.94597353],
[-3.99999838, -0.96435431, 3.56397611]],
[[ 2.83752796, -2.8462562 , 3.67055939],
[ 0.50230948, 4.46602861, 3.07329899],
[-4.61702125, -1.26161623, 2.59061043]]], dtype=float64)
[25]:
fig, axs = plt.subplots(2,1,sharex=True,sharey=True)
axs[0].plot(all_losses_dir.T)
axs[1].plot(all_losses_dir.mean(axis=0), label='dir')
axs[0].set(yscale='log')
axs[1].set(yscale='log')
axs[0].set(title='Loss over all grains')
axs[1].set(xlabel='Epoch', ylabel='Loss',title='Mean loss')
plt.show()
Just reflected beam#
[26]:
%%time
all_masks_refl = jnp.array([ga_refl == gid for gid in range(len(idx_refl.ubis))])
all_origins_refl = jnp.zeros((len(idx_refl.ubis), 3))
# Pack the data into grain-specific buffers (num_grains, M, ...)
grain_ids_refl = jnp.arange(len(idx_refl.ubis))
compressed_refl = v_pack(grain_ids_refl, ga_refl, centroid_with_error[mask_refl], hkli_refl, wavelengths, kvecs_refl)
# 2. Run the refinement
# All inputs (except scalars) are now (num_grains, ...) so in_axes are all 0
ubis_fit_refl, origins_sample_fit_refl, all_losses_refl = refine_vmap(
jnp.array(idx_refl.ubis),
all_origins_refl,
compressed_refl["cen"],
compressed_refl["hkl"],
compressed_refl["wave"],
compressed_refl["kvec"],
compressed_refl["mask"],
100,
1e-2,
1000.0
)
ubis_fit_refl.block_until_ready()
CPU times: user 227 ms, sys: 7.32 ms, total: 234 ms
Wall time: 160 ms
[26]:
Array([[[ 2.09724686, 1.7645508 , -4.70299007],
[-3.63178029, -2.98775115, -2.74138959],
[-3.47111288, 4.19447803, 0.02679021]],
[[ 1.28510684, 2.00634863, -4.89447412],
[-2.12221974, 4.80895483, 1.41521183],
[ 4.84570644, 1.5740841 , 1.91730698]],
[[-3.27701987, 1.13355207, -4.19740447],
[-2.77682091, -4.58716471, 0.93024786],
[-3.34462609, 2.70139137, 3.33933964]],
[[ 2.52452159, 1.21427468, -4.6681076 ],
[-2.66384109, 4.74180324, -0.2079592 ],
[ 4.02005177, 2.38197237, 2.79370646]],
[[ 1.73899817, -3.39083507, -3.88616909],
[-3.06237224, 2.62326892, -3.65780992],
[ 4.15114538, 3.35423116, -1.06975431]],
[[-3.01894717, -1.85844024, -4.1309004 ],
[ 4.46830496, -2.04451012, -2.34437946],
[-0.75167567, -4.68876415, 2.65922984]],
[[-1.61754514, 2.47441751, -4.57199228],
[ 4.36368688, -1.95610624, -2.60091161],
[-2.82399157, -4.43809198, -1.40127786]],
[[-1.16429682, 2.22216639, -4.83108305],
[-3.48631808, -4.05375742, -1.02599094],
[-4.01820091, 2.87274026, 2.28994143]],
[[-2.16559053, 0.9331852 , -4.90573412],
[ 4.99268408, 0.33338371, -2.14210266],
[-0.06440866, -5.3533094 , -0.98671973]],
[[ 1.97854568, -1.44677466, -4.86120369],
[-5.06305689, -0.28789661, -1.97595317],
[ 0.26896506, 5.24105443, -1.44957243]],
[[ 1.59171712, 1.88337072, -4.85367716],
[-0.59095586, -4.97692794, -2.12431817],
[-5.1713078 , 1.14891566, -1.25113591]],
[[-2.78720901, 1.76439041, -4.32967664],
[ 2.69905708, -3.51033783, -3.1676135 ],
[-3.81769845, -3.76792455, 0.92397918]],
[[-3.64626764, -0.47529559, -4.01536179],
[ 3.23907161, -3.57780426, -2.51790775],
[-2.41959342, -4.07503545, 2.67756295]],
[[ 2.98684271, -1.99960098, -4.08821922],
[ 1.23636695, 5.06344472, -1.57329281],
[ 4.38196038, -0.06455521, 3.23179878]],
[[ 1.02837378, -3.66029434, -3.89598587],
[-3.01330502, 2.88041323, -3.5010044 ],
[ 4.41527691, 2.81807959, -1.48273984]],
[[ 3.23656174, 0.08278919, -4.37645731],
[-3.88053493, -2.45757725, -2.91813053],
[-2.02375702, 4.85375031, -1.40328367]],
[[ 3.19100711, -1.87364536, -3.99257257],
[ 4.05490888, 3.18391488, 1.74642362],
[ 1.73295884, -3.99873263, 3.2620626 ]],
[[-2.76331267, -1.5870112 , -4.41414558],
[ 0.75236684, -5.20572566, 1.40002946],
[-4.63044622, 0.10082064, 2.86132014]],
[[-2.44955897, 0.66090859, -4.81608985],
[-2.81132026, -4.5912582 , 0.80168763],
[-3.96595799, 2.84810657, 2.40757924]],
[[-2.80591019, 1.87781839, -4.27012026],
[ 4.5738861 , 0.13158587, -2.94796644],
[-0.91358944, -5.10832321, -1.64486826]],
[[-0.0887888 , 2.62966618, -4.76625825],
[ 0.41071423, -4.75024155, -2.62904353],
[-5.42691903, -0.40180084, -0.12130635]],
[[ 2.70382534, 0.75959787, -4.6632934 ],
[-3.47964742, -3.31448245, -2.55674392],
[-3.19724229, 4.25039612, -1.16165356]],
[[-0.53560452, -2.17421956, -4.96221233],
[ 3.35089949, -4.05238915, 1.41320127],
[-4.25695507, -2.91499311, 1.73614609]],
[[ 2.42129931, 0.4623259 , -4.85298462],
[-1.67706195, 5.16782152, -0.34521463],
[ 4.57734398, 1.64739029, 2.44165449]],
[[ 0.59636968, 3.51167953, -4.11831231],
[-5.4076514 , 0.23974769, -0.58045554],
[-0.19399329, 4.15325955, 3.51323278]],
[[-1.88458758, 2.58861896, -4.40389624],
[-4.69113434, -2.73516226, 0.39881407],
[-2.02391713, 3.93117614, 3.17610131]],
[[ 2.14676112, 1.63373727, -4.72817873],
[-3.29851097, -3.40638611, -2.67499868],
[-3.76197652, 3.91839316, -0.35260787]],
[[-1.8377197 , 2.11364152, -4.66833107],
[-0.4943855 , -5.01055225, -2.07178594],
[-5.10020856, -0.27513367, 1.88326355]],
[[ 2.82488698, 0.81002838, -4.58156341],
[-4.56832074, -0.53078772, -2.91204523],
[-0.88313503, 5.35685321, 0.40401749]],
[[ 2.32920119, 2.52430806, -4.22264057],
[-4.23786114, -1.34241593, -3.13994057],
[-2.49630554, 4.63300393, 1.39130125]],
[[-2.72075949, -1.82504387, -4.34677162],
[ 1.35524915, -5.1095187 , 1.29752731],
[-4.51617893, -0.43438728, 3.00876677]],
[[ 1.50444667, -2.41788484, -4.6389324 ],
[ 5.16974518, 1.43509915, 0.92970661],
[ 0.80922745, -4.66083453, 2.69307915]],
[[-0.78084137, 3.21578727, -4.32226718],
[-4.97780098, 1.24111204, 1.82187489],
[ 2.0610417 , 4.2129431 , 2.76290478]],
[[ 1.0557911 , 2.01193317, -4.94716355],
[ 0.77476976, -5.0459312 , -1.88709424],
[-5.28472238, -0.33944382, -1.264778 ]],
[[ 2.41595472, 1.0139493 , -4.77166735],
[ 0.44301149, 5.25647308, 1.3411708 ],
[ 4.85807136, -0.98273107, 2.25016383]],
[[ 1.96799248, 1.25858031, -4.91738846],
[-0.20377647, 5.2897111 , 1.2718962 ],
[ 5.07132809, -0.27536973, 1.95899889]],
[[ 0.13718816, 2.86049874, -4.63003568],
[-3.49575143, -3.50284442, -2.26782943],
[-4.17112399, 3.0295869 , 1.74871056]],
[[ 2.09467257, -2.63302342, -4.2777979 ],
[-3.15307234, 2.92054012, -3.34169872],
[ 3.91200125, 3.76427568, -0.40185016]],
[[ 3.37390587, 1.41590099, -4.03040946],
[-4.23394175, 1.7961839 , -2.91240101],
[ 0.57117064, 4.94007619, 2.21465439]],
[[-2.98032592, 1.41439898, -4.33021967],
[ 0.36498121, -5.08303037, -1.91175102],
[-4.54077325, -1.33728361, 2.68720004]],
[[-2.0083252 , 2.56196734, -4.36251624],
[-2.51925897, -4.57751244, -1.52967989],
[-4.38881587, 1.45437732, 2.87383435]],
[[-3.20734654, -1.81831614, -4.00582029],
[ 4.37769562, -0.8244811 , -3.12993051],
[ 0.44170516, -5.06428874, 1.94775684]],
[[-3.78949748, -0.5294977 , -3.87131629],
[-0.84865067, -5.15272483, 1.53490966],
[-3.81519104, 1.67131401, 3.50552403]],
[[-1.72608589, -2.83668189, -4.31391739],
[ 5.06019534, -0.0306444 , -2.00438428],
[ 1.02002072, -4.64571741, 2.64683851]],
[[-3.14453329, -1.14571238, -4.29409193],
[ 4.26619257, 0.69680195, -3.31004624],
[ 1.2476516 , -5.27603323, 0.49511632]],
[[ 0.36117935, 3.66142253, -4.01145737],
[ 0.39931936, -4.02665995, -3.64125208],
[-5.41752214, -0.0513116 , -0.53573755]],
[[ 2.74924689, 1.9188229 , -4.28835867],
[-4.62205447, 2.0007724 , -2.0679414 ],
[ 0.84636505, 4.68517414, 2.64043701]],
[[-2.11490326, -2.37763628, -4.4170929 ],
[ 5.01454472, -0.90512804, -1.91251491],
[ 0.09870275, -4.81153309, 2.54173619]],
[[-2.9833812 , -0.60892825, 4.51135225],
[ 4.32285416, 1.31040038, 3.03634467],
[-1.42581227, 5.24831858, -0.23472064]],
[[-1.52303502, -2.45237435, 4.61516719],
[-0.37643381, 4.84585349, 2.45129945],
[-5.21249016, 0.36669209, -1.5263793 ]],
[[ 1.77579248, -1.21570635, 5.00085986],
[-5.09715638, -1.15281253, 1.52958839],
[ 0.71720079, -5.17983626, -1.51549158]],
[[ 2.96502848, 0.16636691, 4.56213973],
[-2.60029244, -4.40967245, 1.85089974],
[ 3.75366003, -3.18569675, -2.32313255]],
[[-1.63687831, -5.17397777, -0.41409753],
[-5.17041177, 1.58817157, 0.61122171],
[-0.46077877, 0.5764862 , -5.39316343]],
[[-1.74411377, -5.08947488, -0.83398688],
[-5.11838377, 1.60093332, 0.93341035],
[-0.62658127, 1.0833067 , -5.29826567]],
[[-0.2692566 , 5.26900022, 1.33681214],
[ 0.73545702, -1.29082051, 5.23655118],
[ 5.38766357, 0.44072903, -0.64912753]],
[[ 0.87497874, -1.0973404 , 5.25938171],
[-1.40782569, 5.09676176, 1.29894462],
[-5.18514319, -1.56696611, 0.53451559]],
[[-1.22883872, 1.70091789, 5.02271012],
[ 1.25706323, -4.91569124, 1.9722215 ],
[ 5.15259446, 1.6052057 , 0.71567933]],
[[ 0.44062751, -0.37035863, 5.41357667],
[-5.20668188, 1.49728 , 0.52627435],
[-1.52480558, -5.22157977, -0.23291651]],
[[ 1.31534199, 0.83407312, 5.21580931],
[-3.05642126, -4.26295003, 1.45447375],
[ 4.30800465, -3.27917768, -0.56029193]],
[[ 1.72578367, 0.67489209, 5.11845503],
[-3.23745242, -4.06206061, 1.62654089],
[ 4.02164984, -3.55968963, -0.88634872]],
[[ 1.39191818, -1.22609881, 5.11798097],
[-2.36827075, 4.58322958, 1.73933209],
[-4.69969212, -2.67074707, 0.6400445 ]],
[[ 1.210433 , 3.69868709, 3.80663659],
[ 1.26020613, -3.99207118, 3.47819997],
[ 5.15504328, 0.10948209, -1.7431481 ]],
[[-0.69503489, 0.23605623, 5.3941799 ],
[ 5.38605639, 0.40844593, 0.67493039],
[-0.37535077, 5.42290422, -0.28607418]],
[[ 4.99898839, -2.07486782, 0.59237019],
[-0.53029071, 0.26643468, 5.41157757],
[-2.09231904, -5.0251493 , 0.04282286]],
[[-2.08169606, 4.9705476 , 0.7671747 ],
[ 0.10405989, -0.7888032 , 5.38544804],
[ 5.02965369, 2.07373166, 0.20786257]],
[[ 4.96652622, -1.09881632, 1.93974433],
[-1.91364974, 0.32086812, 5.0859422 ],
[-1.13902452, -5.32178923, -0.09289492]],
[[-1.99786108, -0.39858635, 5.04708149],
[ 4.00277138, 3.19999809, 1.83666773],
[-3.10275316, 4.38511917, -0.88260891]],
[[ 2.67262267, -4.33496781, 1.92267386],
[-1.70181628, 1.18292726, 5.03295985],
[-4.42609701, -3.07098686, -0.77491501]],
[[-2.86454723, 4.61280406, 0.38588677],
[ 0.15233545, -0.36032541, 5.42949658],
[ 4.62722355, 2.86808868, 0.05992567]],
[[-3.74924957, 1.76153158, 3.5317229 ],
[ 3.88116381, 0.76007216, 3.74128882],
[ 0.71800909, 5.09460064, -1.77968572]],
[[-0.70004136, 1.20800512, 5.26130746],
[ 4.26090073, -3.13422576, 1.28691258],
[ 3.31540848, 4.28310389, -0.54361742]],
[[ 1.28044597, 1.37659347, 5.10887186],
[-2.73720678, -4.32373992, 1.85228822],
[ 4.52728204, -3.00698673, -0.32523195]],
[[-4.78398924, -0.80605138, 2.4715291 ],
[-1.87584153, -2.50544703, -4.45283813],
[ 1.79829846, -4.7656159 , 1.92181301]],
[[ 4.86585093, 0.7672721 , -2.31891294],
[-0.70485228, -4.50688821, -2.96863618],
[-2.33741767, 2.95532996, -3.92927146]],
[[-3.20795619, -3.5175921 , -2.63992638],
[ 3.66841989, -0.33838229, -4.00879813],
[ 2.42613157, -4.14065708, 2.57035715]],
[[ 0.94337619, -5.02022221, 1.88586473],
[ 2.07778215, -1.41692409, -4.82876927],
[ 4.94060029, 1.54979837, 1.66804887]],
[[-4.19137868, -3.03871339, 1.68289369],
[-0.3589843 , -2.2425913 , -4.9481575 ],
[ 3.45598048, -3.92069288, 1.52743896]],
[[-2.47182009, 4.32809569, -2.18776899],
[-0.69058569, -2.74500681, -4.65090492],
[-4.8005283 , -1.83395721, 1.79539456]],
[[-2.84043073, -3.44742981, 3.11325073],
[-0.81055227, -3.22444875, -4.31037276],
[ 4.57329191, -2.71097309, 1.16992493]],
[[-1.06353328, 1.53079703, -5.11498847],
[-0.48100015, 5.16786618, 1.64601637],
[ 5.31611255, 0.77361492, -0.87440476]],
[[ 0.52508627, -5.40045467, -0.44548962],
[-1.24897538, -0.55528023, 5.2691163 ],
[-5.27232984, -0.40529294, -1.29271897]],
[[ 5.02276133, -2.10117597, 0.04242111],
[-0.62931969, -1.39843593, 5.22343723],
[-2.00400785, -4.82336191, -1.5321243 ]],
[[-4.1251577 , 2.95880575, -1.96623881],
[ 1.111861 , 3.93659648, 3.59187392],
[ 3.37416894, 2.31991278, -3.5866101 ]],
[[-3.07299468, -3.94120282, -2.15952558],
[-3.8363885 , 0.93692116, 3.74853126],
[-2.34185905, 3.63570399, -3.30474531]],
[[-3.86676521, 0.5884708 , -3.78584053],
[-3.02686778, 2.82970026, 3.53157676],
[ 2.34930429, 4.61276429, -1.68245592]],
[[-1.50005321, -1.31078187, -5.06631852],
[-4.89705484, -1.50783027, 1.83885119],
[-1.84751818, 5.0643282 , -0.76441291]],
[[-2.96721166, -2.8623255 , -3.55724526],
[ 0.63618249, 3.94036239, -3.70137827],
[ 4.51998283, -2.43177946, -1.81300755]],
[[-1.24998267, 0.17814716, -5.29539695],
[ 2.50448872, 4.81321391, -0.42718932],
[ 4.67138369, -2.53426362, -1.18835013]],
[[ 1.60982698, -0.94289912, -5.11406048],
[ 5.08980972, 1.3869888 , 1.34687134],
[ 1.06921649, -5.17837706, 1.29153759]],
[[ 3.05458623, -3.88659762, 2.27920663],
[ 4.06574225, 1.1927073 , -3.41817884],
[ 1.94153861, 3.62132061, 3.57115209]],
[[-3.01431116, -4.42815469, 0.96436116],
[ 1.02681961, -1.79516011, -5.03502529],
[ 4.41563542, -2.60588925, 1.83000912]],
[[-4.23239294, -1.73059176, 2.95362885],
[ 3.42178806, -2.22868806, 3.59842823],
[ 0.06736396, 4.65589601, 2.82123119]],
[[-1.45650056, 1.00128834, 5.14914935],
[ 0.39455597, -5.30657477, 1.14348021],
[ 5.23201208, 0.68021794, 1.34834812]],
[[-3.4714785 , 2.16331001, 3.59121201],
[-0.28624194, -4.77525527, 2.59657831],
[ 4.18296265, 1.46773073, 3.15951283]],
[[-4.40088156, 1.54594592, 2.8077736 ],
[ 1.11831696, -3.73235495, 3.80447974],
[ 3.00449189, 3.65011575, 2.69942326]],
[[-4.12103474, -1.10807062, 3.37879037],
[ 3.09464446, -3.66635074, 2.57503714],
[ 1.75021918, 3.87044114, 3.40550111]],
[[-4.13500204, -2.02161482, 2.90629313],
[ 3.53970845, -2.27786553, 3.45442179],
[-0.06197126, 4.51410014, 3.04083172]],
[[-4.7521037 , 0.15522632, 2.65047717],
[ 1.74956292, -3.90285647, 3.36607482],
[ 1.99797082, 3.79040518, 3.35806372]],
[[ 3.33399672, -3.20307694, 2.87313896],
[ 1.58789144, 4.29448957, 2.9445993 ],
[-3.99943197, -0.96463932, 3.56386918]],
[[ 0.50175561, 4.46555016, 3.07391717],
[-4.61775625, -1.2636342 , 2.59100838],
[ 2.83762992, -2.84462845, 3.66976012]]], dtype=float64)
Both direct and reflected beams#
[27]:
%%time
all_masks_both = jnp.array([ga_both == gid for gid in range(len(idx_both.ubis))])
all_origins_both = jnp.zeros((len(idx_both.ubis), 3))
centroids_both = jnp.concatenate([centroid_with_error[mask_dir], centroid_with_error[mask_refl]])
wavelengths_both = jnp.concatenate([wavelengths[mask_dir], wavelengths[mask_refl]])
kvecs_both = jnp.concatenate([kvecs_direct[mask_dir], kvecs_refl[mask_refl]])
# Pack the data into grain-specific buffers (num_grains, M, ...)
grain_ids_both = jnp.arange(len(idx_both.ubis))
compressed_both = v_pack(grain_ids_both, ga_both, centroids_both, hkli_both, wavelengths_both, kvecs_both)
# Run the refinement
ubis_fit_both, origins_sample_fit_both, all_losses_both = refine_vmap(
jnp.array(idx_both.ubis),
all_origins_both,
compressed_both["cen"],
compressed_both["hkl"],
compressed_both["wave"],
compressed_both["kvec"],
compressed_both["mask"],
100,
1e-2,
1000.0
)
ubis_fit_both.block_until_ready()
CPU times: user 628 ms, sys: 6.07 ms, total: 634 ms
Wall time: 457 ms
[27]:
Array([[[ 2.09739162, 1.76487461, -4.7032296 ],
[-3.63160115, -2.98779059, -2.74062179],
[-3.47115018, 4.19352566, 0.02681128]],
[[ 1.28485288, 2.00666974, -4.89450838],
[-2.12216269, 4.8093119 , 1.41472287],
[ 4.84519172, 1.57373994, 1.91703987]],
[[-3.27659481, 1.13359829, -4.19761128],
[-2.7772456 , -4.58824448, 0.93043695],
[-3.34445999, 2.70196786, 3.34013864]],
[[ 2.52454799, 1.21432072, -4.66791052],
[-2.66504091, 4.74200439, -0.20811697],
[ 4.01957887, 2.38191063, 2.79366014]],
[[ 1.73913942, -3.39064881, -3.88678929],
[-3.0623105 , 2.62278848, -3.65760946],
[ 4.15126537, 3.35487488, -1.06882347]],
[[-3.01916331, -1.8579542 , -4.13146076],
[ 4.46816064, -2.04450632, -2.34475962],
[-0.75213493, -4.68857995, 2.65963904]],
[[-1.61667441, 2.47430453, -4.57207589],
[ 4.3634291 , -1.95614898, -2.60088459],
[-2.82486894, -4.43751383, -1.40139208]],
[[-1.16404994, 2.22237072, -4.83141825],
[-3.48568757, -4.05360623, -1.02519718],
[-4.0174383 , 2.87345736, 2.28996647]],
[[-2.16567541, 0.93279392, -4.90615548],
[ 4.9933652 , 0.33266938, -2.1419486 ],
[-0.06489874, -5.35398364, -0.98761929]],
[[ 1.97855756, -1.44689252, -4.86084644],
[-5.06331226, -0.2872028 , -1.97572025],
[ 0.26835557, 5.24037932, -1.44989851]],
[[ 1.59201087, 1.88317278, -4.85371662],
[-0.59122197, -4.97670561, -2.12442549],
[-5.17143971, 1.14889829, -1.25098435]],
[[-2.78729345, 1.76438592, -4.33023308],
[ 2.69841947, -3.51042664, -3.16728911],
[-3.81849613, -3.76809812, 0.92390316]],
[[-3.64568864, -0.47495789, -4.01533252],
[ 3.23839021, -3.57773559, -2.51806458],
[-2.41967605, -4.07533596, 2.67752179]],
[[ 2.98639257, -1.9998121 , -4.08797081],
[ 1.23679359, 5.06337039, -1.57358506],
[ 4.38087149, -0.06505566, 3.23178783]],
[[ 1.02811826, -3.6601184 , -3.89583352],
[-3.01279715, 2.8803891 , -3.50086919],
[ 4.41546186, 2.81798785, -1.48287735]],
[[ 3.23682789, 0.08317943, -4.37659907],
[-3.88156232, -2.46074548, -2.91776777],
[-2.02328973, 4.85520558, -1.40354234]],
[[ 3.19111533, -1.87379476, -3.99237979],
[ 4.05484887, 3.18403257, 1.74702538],
[ 1.73323604, -3.99846705, 3.26185005]],
[[-2.76288735, -1.5866695 , -4.41367708],
[ 0.75175529, -5.2058084 , 1.4003238 ],
[-4.63009418, 0.10145944, 2.86154283]],
[[-2.44964101, 0.66115916, -4.81616667],
[-2.81176257, -4.5914647 , 0.80114755],
[-3.96588898, 2.84818775, 2.40776887]],
[[-2.80606082, 1.87762444, -4.26981412],
[ 4.57374569, 0.13169703, -2.94865162],
[-0.91383208, -5.10797484, -1.64444709]],
[[-0.08853057, 2.62982473, -4.76602177],
[ 0.41050191, -4.7498803 , -2.62835708],
[-5.42654621, -0.40162863, -0.12103737]],
[[ 2.70347867, 0.75961044, -4.66309521],
[-3.47950428, -3.31500291, -2.55676615],
[-3.19659901, 4.24982107, -1.16138777]],
[[-0.53582689, -2.17402893, -4.96200734],
[ 3.35015086, -4.05276555, 1.41245581],
[-4.25695519, -2.91463231, 1.73663074]],
[[ 2.42170219, 0.46270615, -4.8529105 ],
[-1.6769575 , 5.16765352, -0.34510785],
[ 4.5778293 , 1.64773687, 2.44235782]],
[[ 0.59652565, 3.51165686, -4.11793938],
[-5.40791447, 0.23912437, -0.58028366],
[-0.19377778, 4.15268281, 3.51323513]],
[[-1.88402474, 2.58845967, -4.4034001 ],
[-4.6907613 , -2.73512916, 0.39864082],
[-2.02293071, 3.93072845, 3.17598977]],
[[ 2.14673699, 1.63434008, -4.72845526],
[-3.29778374, -3.40690285, -2.67459615],
[-3.76238989, 3.91842149, -0.3530714 ]],
[[-1.83748728, 2.11361598, -4.66794394],
[-0.49482625, -5.00938587, -2.07227695],
[-5.10020095, -0.27448759, 1.8832492 ]],
[[ 2.82484716, 0.8106526 , -4.58190578],
[-4.56864395, -0.53247629, -2.91233016],
[-0.8828125 , 5.35708012, 0.40449204]],
[[ 2.3296394 , 2.52418815, -4.22298455],
[-4.23854317, -1.34233987, -3.14034006],
[-2.49665163, 4.63299143, 1.39130241]],
[[-2.72067149, -1.82537251, -4.34703772],
[ 1.35443484, -5.10975912, 1.297394 ],
[-4.51612012, -0.43366306, 3.00842218]],
[[ 1.50507104, -2.41786244, -4.63888288],
[ 5.16955992, 1.43438113, 0.92943049],
[ 0.8094451 , -4.66043619, 2.69241806]],
[[-0.78081188, 3.21585638, -4.32236991],
[-4.97766746, 1.24090264, 1.821946 ],
[ 2.06119205, 4.21289685, 2.76265463]],
[[ 1.05502177, 2.01175775, -4.94724791],
[ 0.77577257, -5.04628433, -1.88680281],
[-5.28470969, -0.3399543 , -1.26530263]],
[[ 2.41613212, 1.01386349, -4.7713961 ],
[ 0.44245564, 5.25710036, 1.34111291],
[ 4.85802337, -0.98333455, 2.25001073]],
[[ 1.96755947, 1.25825778, -4.91749281],
[-0.20395109, 5.28920873, 1.27180949],
[ 5.0714076 , -0.27640217, 1.95831696]],
[[ 0.13734196, 2.8599339 , -4.63007099],
[-3.49607513, -3.50322627, -2.26770388],
[-4.17131984, 3.02893588, 1.74809448]],
[[ 2.09462264, -2.63324227, -4.27833339],
[-3.15264762, 2.92092794, -3.34157106],
[ 3.91219741, 3.76468642, -0.40172439]],
[[ 3.37423823, 1.41608314, -4.03041089],
[-4.23334449, 1.79602408, -2.91322067],
[ 0.57199279, 4.94022627, 2.21438959]],
[[-2.9802011 , 1.41504442, -4.33005481],
[ 0.36440577, -5.0835933 , -1.91239585],
[-4.54148601, -1.33757006, 2.68786391]],
[[-2.00842308, 2.5624172 , -4.36271139],
[-2.51828892, -4.57743106, -1.52865875],
[-4.38838187, 1.45431059, 2.87433104]],
[[-3.20707428, -1.81891885, -4.00521156],
[ 4.37699997, -0.82431118, -3.13038088],
[ 0.4408974 , -5.06437664, 1.9480968 ]],
[[-3.78925355, -0.52956475, -3.87191642],
[-0.84751602, -5.15337975, 1.53494604],
[-3.81555213, 1.67145588, 3.50549994]],
[[-1.72632793, -2.83632603, -4.31387097],
[ 5.06068492, -0.030701 , -2.00519123],
[ 1.02018374, -4.64633199, 2.64720774]],
[[-3.14424002, -1.1454643 , -4.29380826],
[ 4.26550891, 0.69630104, -3.30981246],
[ 1.24689034, -5.27633487, 0.49572351]],
[[ 0.3606495 , 3.66162605, -4.01111333],
[ 0.39944809, -4.02695445, -3.6410981 ],
[-5.4168267 , -0.05258299, -0.53582057]],
[[ 2.74939582, 1.91900446, -4.28824178],
[-4.62155392, 2.00114729, -2.06800494],
[ 0.84714222, 4.68479707, 2.64035454]],
[[-2.11426928, -2.37776318, -4.41678988],
[ 5.01520251, -0.90578318, -1.91281638],
[ 0.09968099, -4.81193449, 2.54219132]],
[[-2.33774656, 2.95468838, -3.92923419],
[-0.70460658, -4.50685055, -2.96964641],
[-4.8656876 , -0.76709054, 2.31822165]],
[[-2.98370805, -0.60885445, 4.51167191],
[ 4.32333006, 1.31001683, 3.03636565],
[-1.42598034, 5.24853326, -0.23470146]],
[[-1.52304139, -2.45221451, 4.61486158],
[-0.37625468, 4.84575191, 2.45112435],
[-5.21259512, 0.36665396, -1.5257001 ]],
[[ 1.77580262, -1.21582213, 5.00073506],
[-5.09660952, -1.15299332, 1.52901392],
[ 0.7173077 , -5.17999447, -1.51484474]],
[[ 0.81009826, 3.22446444, 4.30998859],
[-2.83961638, -3.44727947, 3.11331786],
[ 4.57282528, -2.71153211, 1.16996543]],
[[-1.63618332, -5.17460175, -0.41394021],
[-5.17076998, 1.58755319, 0.61159203],
[-0.46103383, 0.57654944, -5.39346747]],
[[-1.74388336, -5.08956443, -0.83457739],
[-5.11813847, 1.60074027, 0.93283835],
[-0.62649791, 1.0830005 , -5.29768412]],
[[-0.26900779, 5.26914687, 1.33730001],
[ 0.73564411, -1.29084701, 5.23663579],
[ 5.3875407 , 0.44064537, -0.64888007]],
[[ 0.87491699, -1.09790049, 5.25933594],
[-1.40770148, 5.09728162, 1.29832152],
[-5.18481105, -1.56697358, 0.53523573]],
[[-1.22872229, 1.70119658, 5.02310466],
[ 1.2575518 , -4.91575717, 1.97209622],
[ 5.15203307, 1.60542015, 0.71573884]],
[[ 0.44051837, -0.37026385, 5.41364002],
[-5.20683596, 1.49695 , 0.5262171 ],
[-1.52473945, -5.22075571, -0.23295091]],
[[ 1.31526633, 0.83459072, 5.21604984],
[-3.05626134, -4.26380887, 1.45380533],
[ 4.30827113, -3.27924436, -0.56035208]],
[[ 1.72606026, 0.67452899, 5.11821528],
[-3.23746855, -4.06171688, 1.62682274],
[ 4.02208555, -3.55981861, -0.88682703]],
[[ 1.39231857, -1.22541907, 5.11802423],
[-2.36790268, 4.58232981, 1.7405005 ],
[-4.69957015, -2.67111285, 0.63867478]],
[[ 1.2101608 , 3.69918246, 3.8068209 ],
[ 1.26056461, -3.99261567, 3.47836333],
[ 5.15519985, 0.10890424, -1.74381734]],
[[ 4.26103279, -3.1345674 , 1.28666458],
[-0.70014237, 1.20823756, 5.2620471 ],
[-3.31499917, -4.28362569, 0.5430141 ]],
[[-0.6949603 , 0.23605842, 5.39376155],
[ 5.3861136 , 0.40853663, 0.67519874],
[-0.37512591, 5.42303259, -0.28631434]],
[[ 4.99813997, -2.07464766, 0.59225312],
[-0.5301994 , 0.26641991, 5.41125934],
[-2.09227251, -5.02547646, 0.04283334]],
[[-2.08159857, 4.9712219 , 0.76707951],
[ 0.10388211, -0.78892745, 5.38538857],
[ 5.02880199, 2.07414871, 0.20789028]],
[[ 4.96705991, -1.09858133, 1.93856405],
[-1.91341258, 0.32074803, 5.08580579],
[-1.14009339, -5.32202823, -0.09334914]],
[[-1.99801997, -0.39903289, 5.04752135],
[ 4.00256795, 3.2001761 , 1.8363898 ],
[-3.10224451, 4.38556272, -0.88232385]],
[[ 2.6722434 , -4.33523144, 1.92233794],
[-1.70149303, 1.18285557, 5.03333627],
[-4.42624575, -3.07161974, -0.7742581 ]],
[[-2.86462888, 4.61281208, 0.38641052],
[ 0.15260168, -0.36007045, 5.42972179],
[ 4.62669503, 2.86821233, 0.06002796]],
[[-3.74892846, 1.76213008, 3.53155238],
[ 3.8806033 , 0.76015282, 3.74089943],
[ 0.71875524, 5.09482229, -1.77949042]],
[[ 1.28029253, 1.37687225, 5.10860581],
[-2.73702838, -4.32499862, 1.85244738],
[ 4.52726744, -3.0056731 , -0.32492373]],
[[-4.78326645, -0.80666872, 2.4712535 ],
[-1.8754595 , -2.505486 , -4.45250549],
[ 1.79941747, -4.76565691, 1.92189507]],
[[-3.20781208, -3.5179857 , -2.64002611],
[ 3.66827232, -0.33779763, -4.00821453],
[ 2.42596231, -4.14067527, 2.57005368]],
[[ 0.94462313, -5.01943502, 1.88421409],
[ 2.07579077, -1.42082622, -4.82788621],
[ 4.943486 , 1.55547058, 1.66693937]],
[[-4.19135505, -3.03929117, 1.68253925],
[-0.35879312, -2.24280973, -4.94780119],
[ 3.45565726, -3.91965734, 1.52662485]],
[[-3.75373727, 3.18632318, 2.32305082],
[-2.96501001, -0.16586873, -4.56242525],
[-2.59949101, -4.41019994, 1.85056555]],
[[-2.47157242, 4.32875491, -2.18803839],
[-0.69067345, -2.74494426, -4.65024288],
[-4.80130796, -1.83374894, 1.79579895]],
[[-1.06372203, 1.53082042, -5.11467426],
[-0.48127561, 5.16666151, 1.64579202],
[ 5.31632899, 0.77422908, -0.87447503]],
[[ 0.52537539, -5.40031655, -0.44499178],
[-1.24892581, -0.55539234, 5.26929873],
[-5.27252529, -0.4058059 , -1.29297489]],
[[ 5.02227892, -2.10012813, 0.04212545],
[-0.62973274, -1.398621 , 5.22308099],
[-2.00427707, -4.82360538, -1.53245551]],
[[-4.12447407, 2.95931537, -1.96639046],
[ 1.11218336, 3.9361126 , 3.59175669],
[ 3.37457183, 2.31957551, -3.58618544]],
[[-3.07237777, -3.94166968, -2.15973356],
[-3.83542728, 0.93684983, 3.74811085],
[-2.34143287, 3.63610521, -3.30531796]],
[[-3.86722659, 0.58856932, -3.78573865],
[-3.02727907, 2.82964684, 3.53138242],
[ 2.34876424, 4.61318286, -1.68308293]],
[[-1.25140869, 0.17562073, -5.29464379],
[ 2.50494789, 4.81518724, -0.42733318],
[ 4.67145826, -2.53361363, -1.18826876]],
[[-1.49972813, -1.31101396, -5.0663373 ],
[-4.89740396, -1.50825045, 1.83909881],
[-1.84729402, 5.06364714, -0.76441173]],
[[-2.96673047, -2.861821 , -3.55700933],
[ 0.63601974, 3.94062295, -3.70117769],
[ 4.51950344, -2.43241783, -1.8130063 ]],
[[ 1.60976113, -0.94281221, -5.11406212],
[ 5.08960064, 1.38682601, 1.3457287 ],
[ 1.06988597, -5.17934355, 1.29170532]],
[[-3.05467839, 3.88625014, -2.27899212],
[ 1.94158112, 3.62026024, 3.57132585],
[ 4.06576259, 1.19171913, -3.418311 ]],
[[-3.01452665, -4.42839673, 0.96428847],
[ 1.0267138 , -1.79550398, -5.03506439],
[ 4.41565681, -2.60633973, 1.8299086 ]],
[[-4.23241767, -1.73021343, 2.95365141],
[ 3.42202838, -2.22889013, 3.59840922],
[ 0.06577178, 4.65537787, 2.82104423]],
[[-1.45644098, 1.0015324 , 5.14945113],
[ 0.39447609, -5.30737991, 1.14306177],
[ 5.23196241, 0.6792847 , 1.34819347]],
[[-3.47165984, 2.16361939, 3.59176994],
[-0.28681057, -4.77560868, 2.59794708],
[ 4.18283983, 1.46771789, 3.16018574]],
[[-4.40031253, 1.54553611, 2.80750317],
[ 1.11784451, -3.73127991, 3.80434824],
[ 3.00426338, 3.65024532, 2.69934194]],
[[ 1.75019322, -3.90346322, 3.36594212],
[ 1.9975605 , 3.79030021, 3.35795531],
[-4.75198485, 0.15597505, 2.65088111]],
[[-4.12116879, -1.10896846, 3.37907549],
[ 3.09467647, -3.66521037, 2.57395012],
[ 1.74944226, 3.87036006, 3.40507135]],
[[-4.13550333, -2.02110121, 2.90665866],
[ 3.53946139, -2.27823331, 3.45369114],
[-0.06208885, 4.51377784, 3.04140595]],
[[ 3.33425337, -3.20395523, 2.87347888],
[ 1.58834204, 4.29465869, 2.94544457],
[-3.9997418 , -0.96451703, 3.56386465]],
[[ 2.83754185, -2.84533421, 3.67010578],
[ 0.50210472, 4.46572478, 3.07343181],
[-4.61727641, -1.26262127, 2.59062365]]], dtype=float64)
[28]:
fig, ax = plt.subplots()
ax.plot(all_losses_dir.mean(axis=0), label='Direct beam')
ax.plot(all_losses_refl.mean(axis=0), label='Reflected beam')
ax.plot(all_losses_both.mean(axis=0), label='Both beams')
ax.set(yscale='log')
ax.legend()
ax.set(xlabel='Epoch', ylabel='loss', title='Loss over all grains')
plt.show()
Match results to ground truth#
[29]:
SYM = jnp.array(ROTATIONS[7])
def cast_to_fundamental_zone(U, symmetry_ops):
best_U = U
max_trace = jnp.trace(U)
for S in symmetry_ops:
U_equiv = jnp.matmul(U, S)
current_trace = jnp.trace(U_equiv)
if current_trace > max_trace:
max_trace = current_trace
best_U = U_equiv
return best_U
def move_grains_to_fz(gl, sym_ops):
newgl = []
for g in gl:
best_U = cast_to_fundamental_zone(g.U, sym_ops)
new_UB = best_U @ g.B
new_UBI = jnp.linalg.inv(new_UB)
newg = ImageD11.grain.grain(new_UBI, translation=g.translation)
newg.ref_unitcell = ref_unitcell
newgl.append(newg)
return newgl
def match_grains(grains1, grains2, W=50, dist_tol=100):
"""Returns (distance, index into grains1, index into grains2), all same length."""
def desc(gl):
return jnp.column_stack([
jnp.array([jnp.asarray(g.translation) for g in gl]),
W * jnp.array([Rotation.from_matrix(jnp.asarray(g.U)).as_rotvec() for g in gl])])
d, m = scipy.spatial.cKDTree(desc(grains2)).query(desc(grains1), k=1,
distance_upper_bound=dist_tol)
valid = jnp.isfinite(d)
return d[valid], jnp.nonzero(valid)[0], m[valid]
@jax.jit
def gt_ubi_aligned(U_gt, U_fit, B):
"""GT UBI in the same symmetry setting as the fitted grain."""
M = U_fit.T @ U_gt
S = SYM[jnp.argmax(jnp.trace(M @ SYM, axis1=1, axis2=2))]
return jnp.linalg.inv((U_gt @ S) @ B)
@jax.jit
def loss_at_fixed_ubi(ubi, origin, cen, hkl, wave, kvec, mask):
"""Mean |dhkl| for a GIVEN ubi — no analytical UB refit."""
q = detector_to_q_vec(cen[:, 0], cen[:, 1], cen[:, 2], wave, kvec, origin)
d = (ubi @ q.T).T - hkl
e = jnp.sqrt(jnp.sum(d * d, axis=1) + 1e-24)
mf = mask.astype(e.dtype)
return jnp.sum(e * mf) / (jnp.sum(mf) + 1e-10) + 1e-10
gt_loss_vmap = jax.vmap(loss_at_fixed_ubi, in_axes=(0, 0, 0, 0, 0, 0, 0))
# ---------- refined grain lists ----------
grains_dir = [ImageD11.grain.grain(ubis_fit_dir[g], translation=origins_sample_fit_dir[g]) for g in range(len(idx_dir.ubis))]
grains_refl = [ImageD11.grain.grain(ubis_fit_refl[g], translation=origins_sample_fit_refl[g]) for g in range(len(idx_refl.ubis))]
grains_both = [ImageD11.grain.grain(ubis_fit_both[g], translation=origins_sample_fit_both[g]) for g in range(len(idx_both.ubis))]
oriens_dir = jnp.stack([g.U for g in grains_dir])
oriens_refl = jnp.stack([g.U for g in grains_refl])
oriens_both = jnp.stack([g.U for g in grains_both])
# ---------- match ----------
grains_fz = move_grains_to_fz(grains, ROTATIONS[7])
grains_dir_fz = move_grains_to_fz(grains_dir, ROTATIONS[7])
grains_refl_fz = move_grains_to_fz(grains_refl, ROTATIONS[7])
grains_both_fz = move_grains_to_fz(grains_both, ROTATIONS[7])
dist_dir, fit_dir, gt_dir = match_grains(grains_dir_fz, grains_fz)
dist_refl, fit_refl, gt_refl = match_grains(grains_refl_fz, grains_fz)
dist_both, fit_both, gt_both = match_grains(grains_both_fz, grains_fz)
for tag, fit, gt, n in [('a1', fit_dir, gt_dir, len(grains_dir)),
('a2', fit_refl, gt_refl, len(grains_refl)),
('both', fit_both, gt_both, len(grains_both))]:
print(f"{tag}: {len(fit)}/{n} matched, {len(gt) - len(jnp.unique(gt))} GT grains claimed twice")
# ---------- ground-truth losses ----------
def gt_losses(gt_idx, fit_idx, oriens, packed):
ubi_gt = jax.vmap(gt_ubi_aligned, in_axes=(0, 0, None))(
U_matrices[gt_idx], oriens[fit_idx], struc.B)
return gt_loss_vmap(ubi_gt, translations_sample[gt_idx],
packed["cen"][fit_idx], packed["hkl"][fit_idx],
packed["wave"][fit_idx], packed["kvec"][fit_idx],
packed["mask"][fit_idx])
gt_losses_dir = gt_losses(gt_dir, fit_dir, oriens_dir, compressed_dir)
gt_losses_refl = gt_losses(gt_refl, fit_refl, oriens_refl, compressed_refl)
gt_losses_both = gt_losses(gt_both, fit_both, oriens_both, compressed_both)
# ---------- metrics ----------
pos_diff_dir = jnp.linalg.norm(translations_sample[gt_dir] - origins_sample_fit_dir[fit_dir], axis=1)
pos_diff_refl = jnp.linalg.norm(translations_sample[gt_refl] - origins_sample_fit_refl[fit_refl], axis=1)
pos_diff_both = jnp.linalg.norm(translations_sample[gt_both] - origins_sample_fit_both[fit_both], axis=1)
misorien_dir = jnp.array([jnp.min(Umis(U_matrices[g], oriens_dir[f], 7)[:, 1]) for g, f in zip(gt_dir, fit_dir)])
misorien_refl = jnp.array([jnp.min(Umis(U_matrices[g], oriens_refl[f], 7)[:, 1]) for g, f in zip(gt_refl, fit_refl)])
misorien_both = jnp.array([jnp.min(Umis(U_matrices[g], oriens_both[f], 7)[:, 1]) for g, f in zip(gt_both, fit_both)])
strains_dir = jnp.array([grains_dir[f].eps_sample_matrix(struc.lattice_parameters) for f in fit_dir])
strains_refl = jnp.array([grains_refl[f].eps_sample_matrix(struc.lattice_parameters) for f in fit_refl])
strains_both = jnp.array([grains_both[f].eps_sample_matrix(struc.lattice_parameters) for f in fit_both])
strains_norm_dir = jnp.sqrt((strains_dir**2).sum(axis=(1,2)))
strains_norm_refl = jnp.sqrt((strains_refl**2).sum(axis=(1,2)))
strains_norm_both = jnp.sqrt((strains_both**2).sum(axis=(1,2)))
loss_diff_dir = all_losses_dir[fit_dir, -1] - gt_losses_dir
loss_diff_refl = all_losses_refl[fit_refl, -1] - gt_losses_refl
loss_diff_both = all_losses_both[fit_both, -1] - gt_losses_both
print("refined:", float(all_losses_dir[fit_dir, -1].mean()),
" ground truth:", float(gt_losses_dir.mean()))
a1: 100/100 matched, 0 GT grains claimed twice
a2: 100/100 matched, 0 GT grains claimed twice
both: 100/100 matched, 0 GT grains claimed twice
refined: 0.0012912022846448452 ground truth: 0.0014044625316878255
[30]:
fig, axs = plt.subplots(3,1,sharex=True,sharey=True,constrained_layout=True)
axs[0].hist(pos_diff_dir, bins=20)
axs[1].hist(pos_diff_refl, bins=20)
axs[2].hist(pos_diff_both, bins=20)
axs[0].set_title(r'Just direct beam')
axs[1].set_title(r'Just reflected beam')
axs[2].set_title(r'Direct and reflected beams')
fig.supxlabel(r'Position error to ground truth (μm)')
fig.supylabel('Counts')
plt.show()
[31]:
fig, axs = plt.subplots(3,1,sharex=True,sharey=True,constrained_layout=True)
axs[0].hist(strains_norm_dir*1e3, bins=20)
axs[1].hist(strains_norm_refl*1e3, bins=20)
axs[2].hist(strains_norm_both*1e3, bins=20)
axs[0].set_title(r'Just direct beam')
axs[1].set_title(r'Just reflected beam')
axs[2].set_title(r'Direct and reflected beams')
fig.supxlabel(r'Strain norm (should be 0) (x1e-3)')
fig.supylabel('Counts')
plt.show()
[32]:
fig, axs = plt.subplots(3,1,sharex=True,sharey=True,constrained_layout=True)
axs[0].hist(misorien_dir, bins=20)
axs[1].hist(misorien_refl, bins=20)
axs[2].hist(misorien_both, bins=20)
axs[0].set_title(r'Just direct beam')
axs[1].set_title(r'Just reflected beam')
axs[2].set_title(r'Direct and reflected beams')
fig.supxlabel('Misorientation to ground truth (deg)')
fig.supylabel('Counts')
plt.show()
[33]:
fig, axs = plt.subplots(3,1,sharex=True,sharey=True,constrained_layout=True)
axs[0].hist(all_losses_dir[:, -1], bins=20, alpha=0.5)
axs[0].hist(gt_losses_dir, bins=20, alpha=0.5)
axs[1].hist(all_losses_refl[:, -1], bins=20, alpha=0.5)
axs[1].hist(gt_losses_refl, bins=20, alpha=0.5)
axs[2].hist(all_losses_both[:, -1], bins=20,alpha=0.5)
axs[2].hist(gt_losses_both, bins=20, alpha=0.5)
axs[0].set_title(r'Just direct beam')
axs[1].set_title(r'Just reflected beam')
axs[2].set_title(r'Direct and reflected beams')
fig.supxlabel('Final loss function')
fig.supylabel('Counts')
plt.show()
[34]:
fig, axs = plt.subplots(3,1,sharex=True,sharey=True,constrained_layout=True)
axs[0].hist(loss_diff_dir, bins=20)
axs[1].hist(loss_diff_refl, bins=20)
axs[2].hist(loss_diff_both, bins=20)
axs[0].set_title(r'Just direct beam')
axs[1].set_title(r'Just reflected beam')
axs[2].set_title(r'Direct and reflected beams')
fig.supxlabel('Difference in loss function to ground truth')
fig.supylabel('Counts')
plt.show()
[35]:
def print_grain_metrics(
pos_diff_dir, pos_diff_refl, pos_diff_both,
misorien_dir, misorien_refl, misorien_both,
strains_norm_dir, strains_norm_refl, strains_norm_both,
loss_diff_dir, loss_diff_refl, loss_diff_both
):
# Defining metrics with their specific scaling factors
# (Label, datdir, datrefl, databoth, scale_factor, unit_label)
metrics = [
("Loss Diff", loss_diff_dir, loss_diff_refl, loss_diff_both, 1e6, "(x1e-6)"),
("Positional Diff", pos_diff_dir, pos_diff_refl, pos_diff_both, 1.0, ""),
("Misorientation", misorien_dir, misorien_refl, misorien_both, 1e3, "(x1e-3)"),
("Strain Norm", strains_norm_dir, strains_norm_refl, strains_norm_both, 1e4, "(x1e-4)"),
]
header = f"{'Metric':<25} | {'dir Mean':<12} | {'refl Mean':<12} | {'Both Mean':<12} | {'Comb. Frac':<12}"
print(header)
print("-" * len(header))
for label, d1, d2, db, scale, unit in metrics:
# Apply scaling and calculate means
m1 = jnp.mean(d1).item() * scale
m2 = jnp.mean(d2).item() * scale
mb = jnp.mean(db).item() * scale
m_avg_indiv = (m1 + m2) / 2
# The fraction remains the same regardless of scaling
fraction = mb / m_avg_indiv if m_avg_indiv != 0 else 0
full_label = f"{label} {unit}".strip()
print(f"{full_label:<25} | {m1:>12.6f} | {m2:>12.6f} | {mb:>12.6f} | {fraction:>12.4f}")
print_grain_metrics(
pos_diff_dir, pos_diff_refl, pos_diff_both,
misorien_dir, misorien_refl, misorien_both,
strains_norm_dir, strains_norm_refl, strains_norm_both,
loss_diff_dir, loss_diff_refl, loss_diff_both
)
Metric | dir Mean | refl Mean | Both Mean | Comb. Frac
-------------------------------------------------------------------------------------
Loss Diff (x1e-6) | -113.260247 | -100.020152 | -54.434401 | 0.5104
Positional Diff | 12.322694 | 11.776387 | 9.008790 | 0.7476
Misorientation (x1e-3) | 11.139359 | 12.297468 | 8.298397 | 0.7082
Strain Norm (x1e-4) | 2.666880 | 3.017925 | 2.022237 | 0.7115
[36]:
# total peaks (dir and refl)
mask_dir.sum(), mask_dir.sum()*2, mask_dir.sum()/n_grains, mask_dir.sum()*2/n_grains
[36]:
(Array(2764, dtype=int64),
Array(5528, dtype=int64),
Array(27.64, dtype=float64),
Array(55.28, dtype=float64))
Plots for paper#
[37]:
fig, ax = plt.subplots(figsize=(3.54, 3.54), layout='constrained')
ax.scatter(centroid_with_error[:mask_dir.sum()][:, 1], centroid_with_error[:mask_dir.sum()][:, 0], label=r'Direct peaks', s=.5)
ax.scatter(centroid_with_error[mask_dir.sum():][:, 1], centroid_with_error[mask_dir.sum():][:, 0], label=r'Reflected peaks', s=.5)
ax.set_aspect(1)
ax.set(title='Grazing incidence')
ax.set_xticks([])
ax.set_yticks([])
ax.legend(loc='upper right')
plt.show()
plt.savefig('graz_peaks.png', dpi=600)
<Figure size 640x480 with 0 Axes>
[38]:
end = time.time()
print(f'Took {end-start:.0f} seconds')
Took 24 seconds
[ ]: