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 anri.utils
anri.utils.setup() # before any JAX computation: don't grab most of the GPU memory at start-up
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 Dans_Diffraction
import anri.crystal, anri.diffract, anri.geom, anri.fwd, anri.io, anri.maths.rotation
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]:
xtl = Dans_Diffraction.Crystal("../../../tests/data/cif/Si.cif")
lpars = anri.crystal.structure.lattice_parameters(xtl)
sg = anri.crystal.structure.space_group(xtl)
B = anri.crystal.structure.B_matrix(lpars)
lpars, sg
[3]:
(array([ 5.44370237, 5.44370237, 5.44370237, 90. , 90. ,
90. ]),
227)
We generate some HKLs.
[4]:
refl = anri.crystal.structure.reflections(lpars, sg, wavelength, 1.0)
F2 = anri.crystal.structure.structure_factors(xtl, refl["hkl"], wavelength)
strong = F2 > 0.01 # drop the reflections the atom positions extinguish
hkls = refl["hkl"][strong]
len(hkls)
/tmp/ipykernel_3305/2676684211.py:2: UserWarning: No isotropic thermal factors (U_iso or B_iso) for Si: intensities have no Debye-Waller attenuation.
F2 = anri.crystal.structure.structure_factors(xtl, refl["hkl"], wavelength)
[4]:
130
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 @ 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(lpars, symmetry=sg)
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, with ImageD11's parameter names
pars = {
"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
# Change-of-basis from detector to lab space (det_trans, beam_cen_shift, x_distance_shift),
# and the detector's pixel steps (slow, fast) and pixel (0, 0) in the lab frame:
det = anri.io.imaged11.detector_from_pars(pars)
det_trans, beam_cen_shift, x_distance_shift = det["det_trans"], det["beam_cen_shift"], det["x_distance_shift"]
s_step_lab, f_step_lab, det_origin_lab = det["s_step_lab"], det["f_step_lab"], det["det_origin_lab"]
[8]:
# we get both Friedel solutions (etasign = +1 and -1) from one call: centroids are [n_hkls, n_grains, 2, 3]
# 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.maths.rotation.rot_y(2*wedge) @ k_in_direct # reflected beam wavevector
centroid_dir, valid_dir = anri.fwd.box.get_centroid_box_all_both(UBI_matrices, translations_sample,
hkls,
wavelength, k_in_direct, 0, 0,
wedge, chi,
s_step_lab, f_step_lab, det_origin_lab)
centroid_refl, valid_refl = anri.fwd.box.get_centroid_box_all_both(UBI_matrices, translations_sample,
hkls,
wavelength, k_in_refl, 0, 0,
wedge, chi,
s_step_lab, f_step_lab, det_origin_lab)
# keep the valid peaks as (N, 3): first all the etasign = +1 peaks, then all the etasign = -1 peaks
centroid_dir = jnp.concatenate([centroid_dir[:, :, 0][valid_dir], centroid_dir[:, :, 1][valid_dir]])
centroid_refl = jnp.concatenate([centroid_refl[:, :, 0][valid_refl], centroid_refl[:, :, 1][valid_refl]])
# 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.detector.det_to_lab(slow, fast, det_trans, beam_cen_shift, x_distance_shift)
# rotate origin into sample frame
origin_lab = anri.geom.gonio.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.scatter.peak_lab_to_k_out(peak_lab, origin_lab, wavelength)
# normalise k_in by wavelength
k_in_lab_norm = anri.diffract.scatter.scale_norm_k(k_in_lab_hat, wavelength)
# simply q = k_out - k_in
q_lab = anri.diffract.scatter.k_to_q_lab(k_in_lab_norm, k_out_lab_norm)
# rotate into sample frame
q_sample = anri.geom.gonio.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.18676464 0.14040407 0.21874064]
[ 0.09217003 -0.15146426 0.26218343]
[ 0.08218933 -0.09657942 0.28983034]
...
[ 0.02732489 0.61205318 0.72711448]
[ 0.54194862 0.29175217 0.73435282]
[-0.61708137 0.04238235 0.72322817]] (2764, 3) float64
info: Assign to rings, maximum d-spacing considered: 0.958756
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, -1, -5) 32 283 0 283 N/A N/A -57.01
info: Ring 6 ( -4, -2, -2) 24 391 0 391 N/A N/A -53.48
info: Ring 5 ( -1, -3, -3) 24 494 0 494 N/A N/A -47.20
info: Ring 4 ( -4, 0, 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 ( -3, -1, -1) 24 681 0 681 N/A N/A -35.47
info: Ring 1 ( -2, -2, 0) 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 (2762, 3)
info: Assign to rings, maximum d-spacing considered: 0.958756
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, -1, -5) 32 283 0 283 N/A N/A -57.01
info: Ring 6 ( -4, -2, -2) 24 391 0 391 N/A N/A -53.48
info: Ring 5 ( -1, -3, -3) 24 494 0 494 N/A N/A -47.20
info: Ring 4 ( -4, 0, 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 ( -3, -1, -1) 24 681 0 681 N/A N/A -35.47
info: Ring 1 ( -2, -2, 0) 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 (2762, 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: 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.000202 /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: 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 226
info: Time taken 0.000633 /s
info: Scoring 226 potential orientations
info: new grain 26 pks, i 1548 j 2177 UBI 0.746348 4.695715 -2.632038 -3.016733 -1.864111 -4.149025 -4.465994 2.046270 2.340229
info: new grain 24 pks, i 1542 j 793 UBI -5.170256 -1.432222 -0.955246 1.501113 -2.432768 -4.638204 0.807966 -4.665544 2.674911
info: new grain 28 pks, i 1541 j 2155 UBI 2.826634 4.435687 1.398675 -1.619273 2.476436 -4.580025 -4.362692 1.955872 2.588392
info: new grain 21 pks, i 1533 j 778 UBI 0.064770 5.354263 1.003797 -2.163499 0.931899 -4.918150 -4.992862 -0.338000 2.112089
info: new grain 23 pks, i 1526 j 795 UBI 1.677027 -5.168991 0.356955 2.430968 0.459807 -4.860952 4.578541 1.652463 2.421299
info: new grain 30 pks, i 1521 j 2148 UBI 4.516867 0.431652 -3.010999 -2.720991 -1.825647 -4.346974 -1.351705 5.109718 -1.293055
info: new grain 29 pks, i 1516 j 792 UBI 4.687972 2.734494 -0.411901 -1.881625 2.588167 -4.403452 -2.023235 3.933985 3.174905
info: new grain 35 pks, i 1515 j 791 UBI -2.059359 -4.211461 -2.787258 -0.786398 3.210009 -4.308813 4.977436 -1.241954 -1.826203
info: new grain 32 pks, i 1514 j 764 UBI -3.352076 4.053184 -1.401166 -0.533707 -2.177072 -4.963854 -4.256432 -2.912177 1.738414
info: new grain 22 pks, i 1513 j 2145 UBI 5.280665 0.334443 1.293092 1.059314 2.023710 -4.945239 -0.775640 5.041764 1.866786
info: new grain 30 pks, i 1509 j 787 UBI -4.857349 0.985717 -2.231964 2.419717 1.014606 -4.784324 -0.439967 -5.257053 -1.329238
info: new grain 27 pks, i 1506 j 760 UBI -5.069609 0.277059 -1.949509 1.967376 1.260449 -4.922804 0.202311 -5.288000 -1.266051
info: new grain 24 pks, i 1504 j 759 UBI 4.173262 -3.031619 -1.715572 0.131042 2.852948 -4.639030 3.503885 3.503946 2.269728
info: new grain 31 pks, i 1503 j 757 UBI 5.409928 -0.235749 0.595112 0.593099 3.509761 -4.124347 -0.194333 4.153075 3.504754
info: new grain 25 pks, i 1502 j 2138 UBI 2.701933 -3.512842 -3.180064 -2.791550 1.763236 -4.322553 3.818280 3.766765 -0.904869
info: new grain 23 pks, i 1496 j 790 UBI 3.481036 4.053575 1.032514 -1.167298 2.218527 -4.815154 -4.014376 2.881815 2.319963
info: new grain 23 pks, i 1495 j 772 UBI -3.908959 -3.764421 0.378725 2.099628 -2.640107 -4.282597 3.152485 -2.915513 3.338365
info: new grain 26 pks, i 1491 j 786 UBI -0.568346 -4.943628 -2.237973 3.372835 1.412683 -4.023271 4.231560 -1.793514 2.908170
info: new grain 30 pks, i 1490 j 2165 UBI -4.236831 -1.342517 -3.133393 2.331147 2.521044 -4.223494 2.499769 -4.633502 -1.405461
info: new grain 19 pks, i 1485 j 2149 UBI -3.627606 -2.992342 -2.728125 2.093055 1.764927 -4.711616 3.471327 -4.202747 -0.049000
info: new grain 27 pks, i 1482 j 751 UBI 2.775986 4.589093 -0.941469 -3.275289 1.134675 -4.208548 -3.341898 2.698789 3.325227
info: new grain 28 pks, i 1480 j 789 UBI 3.761159 -3.917629 0.361216 2.148148 1.634510 -4.734942 3.299339 3.405158 2.661698
info: new grain 24 pks, i 1476 j 2130 UBI 5.099890 0.273622 -1.858470 -1.838196 2.117594 -4.668171 0.497360 5.004416 2.092578
info: new grain 25 pks, i 1472 j 746 UBI 2.658257 -4.739561 0.189247 2.521888 1.217704 -4.662006 4.017970 2.384929 2.804758
info: new grain 21 pks, i 1468 j 2140 UBI -3.065736 2.620503 -3.651901 1.746129 -3.397976 -3.887157 -4.147291 -3.358685 1.090386
info: new grain 28 pks, i 1464 j 2122 UBI 3.964599 -2.848657 -2.408432 -2.450219 0.657531 -4.818283 2.811142 4.592534 -0.793810
info: new grain 38 pks, i 1463 j 2121 UBI -1.237956 -5.065021 1.586934 2.986034 -1.998059 -4.078038 4.382770 -0.065171 3.237263
info: new grain 36 pks, i 1459 j 773 UBI -3.014032 2.881081 -3.505818 1.029366 -3.658223 -3.886849 -4.416976 -2.817593 1.494382
info: new grain 30 pks, i 1456 j 779 UBI 0.910568 5.106485 1.636197 -2.806452 1.879471 -4.267654 -4.575738 -0.131606 2.956730
info: new grain 25 pks, i 1445 j 741 UBI 5.428347 0.404434 0.138834 -0.082222 2.632572 -4.773916 -0.408709 4.750807 2.611373
info: new grain 28 pks, i 1440 j 782 UBI 3.199598 -4.247795 1.185801 2.701522 0.764621 -4.655552 3.482602 3.313890 2.557625
info: new grain 30 pks, i 1431 j 2120 UBI 4.378670 -0.822721 -3.141127 -3.206976 -1.815372 -3.988578 -0.442307 5.066154 -1.968673
info: new grain 33 pks, i 1426 j 2137 UBI -0.267177 -5.241098 1.460720 1.976273 -1.448246 -4.850675 5.066268 0.281263 1.992398
info: new grain 27 pks, i 1425 j 2124 UBI 5.172138 -1.147421 1.239799 1.594666 1.883227 -4.862807 0.585844 4.979812 2.107647
info: new grain 24 pks, i 1423 j 2156 UBI 2.423046 4.072785 -2.697707 -3.647192 -0.470236 -4.006909 -3.240910 3.576145 2.511139
info: new grain 30 pks, i 1412 j 750 UBI 2.023691 -4.854833 1.424044 3.235689 0.087586 -4.367325 3.882826 2.459655 2.921780
info: new grain 34 pks, i 1409 j 2127 UBI -1.733844 4.001861 -3.271925 3.189580 -1.873735 -3.982866 -4.056314 -3.182652 -1.749309
info: new grain 30 pks, i 1398 j 765 UBI -4.847524 -1.578298 -1.945292 1.281951 2.005882 -4.880639 2.120231 -4.811522 -1.421953
info: new grain 31 pks, i 163 j 2164 UBI 3.817102 -1.675957 -3.510166 -3.782803 -0.531044 -3.852987 0.849390 5.155841 -1.569694
info: new grain 18 pks, i 153 j 2152 UBI 4.870786 0.781336 -2.292722 -2.338190 2.965133 -3.951784 0.700407 4.513320 2.959844
info: new grain 21 pks, i 151 j 788 UBI -3.209404 -3.522071 -2.630458 3.664192 -0.329551 -3.998435 2.427042 -4.133696 2.599798
info: new grain 24 pks, i 147 j 2166 UBI -1.026142 4.653493 -2.647744 -1.725558 -2.832458 -4.327645 -5.057001 0.032086 1.976944
info: new grain 30 pks, i 146 j 2158 UBI -1.249805 5.274371 -0.506288 -3.140856 -1.141850 -4.278412 -4.269957 -0.701385 3.326069
info: new grain 18 pks, i 108 j 2150 UBI -0.767530 5.205121 -1.378120 -2.772633 -1.583883 -4.431673 -4.639296 0.078495 2.841354
info: new grain 28 pks, i 88 j 743 UBI -0.100346 4.812524 -2.549430 -2.115589 -2.376533 -4.419020 -5.013801 0.907924 1.901183
info: new grain 18 pks, i 38 j 752 UBI 5.417267 0.069297 0.568532 0.355534 3.660278 -4.023126 -0.397853 4.026755 3.631060
info: new grain 30 pks, i 29 j 2151 UBI -0.850001 -4.683425 -2.634410 2.747587 1.922578 -4.282653 4.623089 -1.996998 2.088539
info: new grain 30 pks, i 16 j 753 UBI 4.540445 1.335099 -2.677786 -2.984467 1.410484 -4.330574 -0.368623 5.083598 1.926721
info: new grain 28 pks, i 8 j 2131 UBI 4.385722 -1.456904 -2.862183 -2.013805 2.560948 -4.360636 2.516503 4.578220 1.554533
info: Number of orientations with more than 15 peaks is 49
info: Time taken 0.015/s
info: UBI for best fitting
[[-1.23795575 -5.06502051 1.58693385]
[ 2.98603439 -1.99805865 -4.078038 ]
[ 4.38277042 -0.06517138 3.23726252]]
info: Unit cell: (5.450259285736179, 5.434982399733378, 5.449109329750564, 89.96974260057277, 89.91947465542503, 90.09274021881306)
info: Indexes 38 peaks, with <drlv2>=0.006568
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 1330
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: 21
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.000057 /s
info: Scoring 17 potential orientations
info: new grain 29 pks, i 2161 j 1517 UBI 5.211307 -0.369076 1.514432 -1.524616 -2.454354 4.621852 0.378897 -4.846638 -2.445134
info: new grain 24 pks, i 2143 j 1 UBI 1.424026 -5.250906 0.258747 -2.984769 -0.610212 4.516942 -4.325299 -1.305296 -3.028238
info: new grain 28 pks, i 747 j 1474 UBI 4.568102 0.537986 2.891959 -2.827993 -0.809205 4.592774 0.880533 -5.355969 -0.429532
info: Number of orientations with more than 15 peaks is 52
info: Time taken 0.004/s
info: UBI for best fitting
[[-1.23795575 -5.06502051 1.58693385]
[ 2.98603439 -1.99805865 -4.078038 ]
[ 4.38277042 -0.06517138 3.23726252]]
info: Unit cell: (5.450259285736179, 5.434982399733378, 5.449109329750564, 89.96974260057277, 89.91947465542503, 90.09274021881306)
info: Indexes 38 peaks, with <drlv2>=0.006568
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 1252
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 99
info: Time taken 0.000290 /s
info: Scoring 99 potential orientations
info: new grain 34 pks, i 1543 j 118 UBI 0.440616 -0.371920 5.413369 -5.207560 1.497699 0.524024 -1.524465 -5.220855 -0.226044
info: new grain 24 pks, i 1539 j 1461 UBI 1.315195 0.834520 5.215408 -3.056947 -4.263038 1.454453 4.306869 -3.281285 -0.561059
info: new grain 23 pks, i 1536 j 113 UBI 1.729596 0.671738 5.123659 -3.237437 -4.067003 1.627788 4.018885 -3.558686 -0.860313
info: new grain 20 pks, i 1535 j 76 UBI 5.389438 0.410004 0.684484 -0.694083 0.244601 5.388553 0.361259 -5.431662 0.325343
info: new grain 19 pks, i 1530 j 126 UBI 1.396499 -1.227048 5.125766 -2.366193 4.581236 1.739302 -4.695519 -2.667397 0.605475
info: new grain 36 pks, i 1508 j 47 UBI -2.860060 4.613134 0.370082 0.157917 -0.359228 5.430859 4.628812 2.868507 0.073048
info: new grain 26 pks, i 1479 j 131 UBI 4.965687 -1.098241 1.951178 -1.909064 0.320368 5.082868 -1.141321 -5.322559 -0.101040
info: new grain 28 pks, i 1478 j 9 UBI -1.405220 5.096291 1.303678 0.874813 -1.096487 5.259322 5.187198 1.567050 -0.529727
info: new grain 20 pks, i 1473 j 6 UBI -2.003208 -0.403361 5.039381 3.998115 3.193315 1.844000 -3.099670 4.389671 -0.909391
info: new grain 36 pks, i 1467 j 1400 UBI 1.637896 5.177961 0.441567 5.169375 -1.584603 -0.602527 -0.462143 0.575987 -5.390159
info: new grain 30 pks, i 1462 j 1395 UBI 1.746056 5.086417 0.843525 5.118537 -1.604498 -0.913094 -0.629582 1.082712 -5.300207
info: new grain 21 pks, i 1441 j 15 UBI -0.479495 5.169817 1.665889 1.055541 -1.524664 5.116587 5.318782 0.773526 -0.846840
info: new grain 30 pks, i 1432 j 129 UBI -2.081302 4.973435 0.781668 0.100579 -0.787795 5.384334 5.028785 2.072851 0.198230
info: new grain 22 pks, i 1406 j 68 UBI 1.210219 3.708549 3.797475 1.260702 -3.985542 3.469105 5.157477 0.104358 -1.777504
info: new grain 17 pks, i 85 j 1545 UBI 1.258694 -4.923760 1.967354 -1.225231 1.692685 5.031155 -5.148028 -1.598278 -0.682865
info: new grain 29 pks, i 66 j 22 UBI 3.872582 0.760544 3.722930 -3.751652 1.762874 3.537089 -0.725416 -5.090693 1.805656
info: Number of orientations with more than 15 peaks is 68
info: Time taken 0.007/s
info: UBI for best fitting
[[-1.23795575 -5.06502051 1.58693385]
[ 2.98603439 -1.99805865 -4.078038 ]
[ 4.38277042 -0.06517138 3.23726252]]
info: Unit cell: (5.450259285736179, 5.434982399733378, 5.449109329750564, 89.96974260057277, 89.91947465542503, 90.09274021881306)
info: Indexes 38 peaks, with <drlv2>=0.006568
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 796
info: Tried r1=0 r2=0 attempt 3 of 49, got 68 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-2, -2, 0), (0, -2, -2), (0, -2, 2), (-2, 0, -2), (2, -2, 0), (-2, 0, 2), (2, 0, -2), (-2, 2, 0), (2, 0, 2), (0, 2, -2), (0, 2, 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: 164
info: Number of peaks in ring 2: 14
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 25
info: Time taken 0.000261 /s
info: Scoring 25 potential orientations
info: new grain 22 pks, i 1772 j 2175 UBI -1.869078 -2.510560 -4.436375 4.781476 0.802075 -2.492291 1.791715 -4.764561 1.941528
info: new grain 27 pks, i 1769 j 781 UBI -1.782216 1.214739 -5.005417 0.720779 -5.183138 -1.517581 -5.095186 -1.158179 1.504999
info: new grain 28 pks, i 1753 j 776 UBI -0.689591 -2.744145 -4.637021 2.469586 -4.332601 2.198879 -4.802882 -1.834289 1.816291
info: new grain 30 pks, i 1670 j 762 UBI -0.358985 -2.244054 -4.957118 4.190315 3.036804 -1.671863 3.459665 -3.915324 1.506919
info: new grain 18 pks, i 1661 j 2136 UBI -2.976855 -0.169710 -4.566521 -2.594310 -4.419894 1.822779 -3.751635 3.175803 2.336945
info: new grain 19 pks, i 1615 j 737 UBI 2.065727 -1.428660 -4.846466 -0.940252 5.012897 -1.862189 4.949292 1.560141 1.646424
info: new grain 26 pks, i 251 j 2126 UBI -0.809649 -3.221702 -4.303739 2.835044 3.452025 -3.108188 4.580486 -2.706655 1.204518
info: Number of orientations with more than 15 peaks is 75
info: Time taken 0.006/s
info: UBI for best fitting
[[-1.23795575 -5.06502051 1.58693385]
[ 2.98603439 -1.99805865 -4.078038 ]
[ 4.38277042 -0.06517138 3.23726252]]
info: Unit cell: (5.450259285736179, 5.434982399733378, 5.449109329750564, 89.96974260057277, 89.91947465542503, 90.09274021881306)
info: Indexes 38 peaks, with <drlv2>=0.006568
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 604
info: Tried r1=1 r2=4 attempt 4 of 49, got 75 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), (0, -2, -2), (0, -2, 2), (-2, 0, -2), (2, -2, 0), (-2, 0, 2), (2, 0, -2), (-2, 2, 0), (2, 0, 2), (0, 2, -2), (0, 2, 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: 56
info: Number of peaks in ring 2: 140
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 55
info: Time taken 0.000123 /s
info: Scoring 55 potential orientations
info: new grain 18 pks, i 1547 j 1699 UBI 1.282475 1.373119 5.115917 4.523377 -3.006655 -0.308763 2.742503 4.320693 -1.834621
info: new grain 27 pks, i 1529 j 1735 UBI -0.522134 5.401280 0.430838 1.246452 0.556515 -5.266981 -5.270908 -0.400574 -1.312632
info: new grain 18 pks, i 1519 j 347 UBI 2.119744 5.036543 -0.041253 0.551572 -0.277487 -5.417666 -4.993423 2.087603 -0.626644
info: new grain 25 pks, i 1511 j 1636 UBI -4.427837 -3.072296 -0.793761 -2.672953 4.336011 -1.939589 1.697593 -1.182139 -5.024993
info: new grain 28 pks, i 1481 j 260 UBI 0.738476 -1.289238 5.237728 0.265088 -5.269685 -1.342699 5.387863 0.441758 -0.638773
info: new grain 23 pks, i 1460 j 1692 UBI -0.687593 1.206939 5.265110 3.321298 4.280692 -0.526039 -4.263362 3.138204 -1.267288
info: new grain 19 pks, i 1455 j 217 UBI -1.599096 0.943576 5.109676 -5.092306 -1.387164 -1.358531 1.076743 -5.179966 1.315372
info: new grain 18 pks, i 1453 j 235 UBI 1.491343 1.312878 5.065866 4.904793 1.518289 -1.868260 -1.853699 5.049466 -0.728053
info: new grain 17 pks, i 1418 j 1605 UBI -5.015486 2.103208 -0.055148 0.628698 1.400396 -5.216276 -2.013487 -4.823552 -1.565318
info: new grain 31 pks, i 1417 j 1658 UBI -3.373109 -2.320026 3.597951 -4.117767 2.967129 -1.966873 -1.110378 -3.937417 -3.577839
info: new grain 27 pks, i 1416 j 1603 UBI 3.074407 3.939439 2.152091 3.837808 -0.936175 -3.743155 -2.342222 3.636784 -3.313691
info: new grain 21 pks, i 1404 j 212 UBI -3.030821 2.834508 3.549655 2.354324 4.608345 -1.666534 -3.864686 0.586431 -3.776203
info: new grain 23 pks, i 120 j 1715 UBI 3.054987 -3.890014 2.302721 -1.942934 -3.618102 -3.561400 4.069209 1.203253 -3.416770
info: new grain 24 pks, i 77 j 219 UBI 1.250487 -0.176218 5.288607 -2.502425 -4.817392 0.437708 4.671829 -2.536153 -1.214104
info: Number of orientations with more than 15 peaks is 89
info: Time taken 0.009/s
info: UBI for best fitting
[[-1.23795575 -5.06502051 1.58693385]
[ 2.98603439 -1.99805865 -4.078038 ]
[ 4.38277042 -0.06517138 3.23726252]]
info: Unit cell: (5.450259285736179, 5.434982399733378, 5.449109329750564, 89.96974260057277, 89.91947465542503, 90.09274021881306)
info: Indexes 38 peaks, with <drlv2>=0.006568
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 239
info: Tried r1=0 r2=1 attempt 5 of 49, got 89 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-2, -2, 0), (0, -2, -2), (0, -2, 2), (-2, 0, -2), (2, -2, 0), (-2, 0, 2), (2, 0, -2), (-2, 2, 0), (2, 0, 2), (0, 2, -2), (0, 2, 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: 64
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.000103 /s
info: Scoring 6 potential orientations
info: new grain 17 pks, i 1613 j 26 UBI 4.527795 -2.431674 -1.768940 2.955366 2.871491 3.564687 -0.636408 -3.959876 3.714697
info: new grain 22 pks, i 395 j 1525 UBI -4.410383 2.601353 -1.847990 1.019344 -1.794506 -5.025299 -3.014380 -4.427722 0.977328
info: Number of orientations with more than 15 peaks is 91
info: Time taken 0.006/s
info: UBI for best fitting
[[-1.23795575 -5.06502051 1.58693385]
[ 2.98603439 -1.99805865 -4.078038 ]
[ 4.38277042 -0.06517138 3.23726252]]
info: Unit cell: (5.450259285736179, 5.434982399733378, 5.449109329750564, 89.96974260057277, 89.91947465542503, 90.09274021881306)
info: Indexes 38 peaks, with <drlv2>=0.006568
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 193
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), (0, -2, -2), (0, -2, 2), (-2, 0, -2), (2, -2, 0), (-2, 0, 2), (2, 0, -2), (-2, 2, 0), (2, 0, 2), (0, 2, -2), (0, 2, 2), (2, 2, 0)]
info: Ring 2: [(-2, -2, 0), (0, -2, -2), (0, -2, 2), (-2, 0, -2), (2, -2, 0), (-2, 0, 2), (2, 0, -2), (-2, 2, 0), (2, 0, 2), (0, 2, -2), (0, 2, 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: 56
info: Number of peaks in ring 2: 56
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 52
info: Time taken 0.000104 /s
info: Scoring 52 potential orientations
info: new grain 20 pks, i 1744 j 272 UBI 1.755556 3.867522 3.403586 -4.116354 -1.108581 3.366976 3.097379 -3.662192 2.599416
info: new grain 18 pks, i 1742 j 270 UBI 1.600187 4.297003 2.930671 -3.996915 -0.960626 3.549943 3.334938 -3.213687 2.903299
info: new grain 20 pks, i 1722 j 324 UBI 3.546286 -2.280617 3.467189 -0.069047 4.508756 3.028149 -4.129004 -2.020559 2.906747
info: new grain 17 pks, i 1674 j 199 UBI 3.423562 -2.226777 3.611760 0.058100 4.656095 2.793127 -4.225869 -1.736981 2.967164
info: new grain 19 pks, i 1663 j 227 UBI 1.749201 -3.900065 3.347541 1.994789 3.794953 3.366355 -4.752757 0.156547 2.666604
info: new grain 18 pks, i 1576 j 258 UBI -4.401819 1.556527 2.786737 1.115952 -3.726801 3.797754 3.012110 3.640757 2.729314
info: new grain 17 pks, i 1561 j 1642 UBI 4.185102 1.463643 3.137371 -3.474964 2.189206 3.594632 -0.303536 -4.759275 2.630632
info: new grain 24 pks, i 210 j 190 UBI -1.466939 0.998907 5.155719 0.392933 -5.306482 1.116770 5.223836 0.684396 1.348650
info: Number of orientations with more than 15 peaks is 99
info: Time taken 0.009/s
info: UBI for best fitting
[[-1.23795575 -5.06502051 1.58693385]
[ 2.98603439 -1.99805865 -4.078038 ]
[ 4.38277042 -0.06517138 3.23726252]]
info: Unit cell: (5.450259285736179, 5.434982399733378, 5.449109329750564, 89.96974260057277, 89.91947465542503, 90.09274021881306)
info: Indexes 38 peaks, with <drlv2>=0.006568
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 36
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), (0, -2, -2), (0, -2, 2), (-2, 0, -2), (2, -2, 0), (-2, 0, 2), (2, 0, -2), (-2, 2, 0), (2, 0, 2), (0, 2, -2), (0, 2, 2), (2, 2, 0)]
info: Ring 2: [(-4, -2, -2), (-2, -4, -2), (-4, -2, 2), (-2, -4, 2), (-2, -2, -4), (-4, 2, -2), (-2, -2, 4), (2, -4, -2), (-4, 2, 2), (-2, 2, -4), (2, -4, 2), (2, -2, -4), (-2, 2, 4), (-2, 4, -2), (2, -2, 4), (4, -2, -2), (-2, 4, 2), (2, 2, -4), (4, -2, 2), (2, 2, 4), (2, 4, -2), (4, 2, -2), (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: 10
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.000032 /s
info: Scoring 3 potential orientations
info: Number of orientations with more than 15 peaks is 99
info: Time taken 0.016/s
info: UBI for best fitting
[[-1.23795575 -5.06502051 1.58693385]
[ 2.98603439 -1.99805865 -4.078038 ]
[ 4.38277042 -0.06517138 3.23726252]]
info: Unit cell: (5.450259285736179, 5.434982399733378, 5.449109329750564, 89.96974260057277, 89.91947465542503, 90.09274021881306)
info: Indexes 38 peaks, with <drlv2>=0.006568
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 36
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), (-4, -2, 2), (-2, -4, 2), (-2, -2, -4), (-4, 2, -2), (-2, -2, 4), (2, -4, -2), (-4, 2, 2), (-2, 2, -4), (2, -4, 2), (2, -2, -4), (-2, 2, 4), (-2, 4, -2), (2, -2, 4), (4, -2, -2), (-2, 4, 2), (2, 2, -4), (4, -2, 2), (2, 2, 4), (2, 4, -2), (4, 2, -2), (2, 4, 2), (4, 2, 2)]
info: Ring 2: [(-2, -2, 0), (0, -2, -2), (0, -2, 2), (-2, 0, -2), (2, -2, 0), (-2, 0, 2), (2, 0, -2), (-2, 2, 0), (2, 0, 2), (0, 2, -2), (0, 2, 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: 7
info: Number of peaks in ring 2: 10
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 5
info: Time taken 0.000030 /s
info: Scoring 5 potential orientations
info: Number of orientations with more than 15 peaks is 99
info: Time taken 0.017/s
info: UBI for best fitting
[[-1.23795575 -5.06502051 1.58693385]
[ 2.98603439 -1.99805865 -4.078038 ]
[ 4.38277042 -0.06517138 3.23726252]]
info: Unit cell: (5.450259285736179, 5.434982399733378, 5.449109329750564, 89.96974260057277, 89.91947465542503, 90.09274021881306)
info: Indexes 38 peaks, with <drlv2>=0.006568
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 36
info: Tried r1=6 r2=1 attempt 9 of 49, got 99 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-2, -2, 0), (0, -2, -2), (0, -2, 2), (-2, 0, -2), (2, -2, 0), (-2, 0, 2), (2, 0, -2), (-2, 2, 0), (2, 0, 2), (0, 2, -2), (0, 2, 2), (2, 2, 0)]
info: Ring 2: [(-1, -3, -3), (1, -3, -3), (-3, -3, -1), (-3, -1, -3), (3, -3, -1), (-3, -3, 1), (3, -1, -3), (3, -3, 1), (-3, 1, -3), (-1, -3, 3), (1, -3, 3), (3, 1, -3), (-3, -1, 3), (-1, 3, -3), (1, 3, -3), (3, -1, 3), (-3, 3, -1), (-3, 1, 3), (3, 3, -1), (-3, 3, 1), (3, 1, 3), (3, 3, 1), (-1, 3, 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: 10
info: Number of peaks in ring 2: 8
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 9
info: Time taken 0.000033 /s
info: Scoring 9 potential orientations
info: Number of orientations with more than 15 peaks is 99
info: Time taken 0.017/s
info: UBI for best fitting
[[-1.23795575 -5.06502051 1.58693385]
[ 2.98603439 -1.99805865 -4.078038 ]
[ 4.38277042 -0.06517138 3.23726252]]
info: Unit cell: (5.450259285736179, 5.434982399733378, 5.449109329750564, 89.96974260057277, 89.91947465542503, 90.09274021881306)
info: Indexes 38 peaks, with <drlv2>=0.006568
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 36
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), (1, -3, -3), (-3, -3, -1), (-3, -1, -3), (3, -3, -1), (-3, -3, 1), (3, -1, -3), (3, -3, 1), (-3, 1, -3), (-1, -3, 3), (1, -3, 3), (3, 1, -3), (-3, -1, 3), (-1, 3, -3), (1, 3, -3), (3, -1, 3), (-3, 3, -1), (-3, 1, 3), (3, 3, -1), (-3, 3, 1), (3, 1, 3), (3, 3, 1), (-1, 3, 3), (1, 3, 3)]
info: Ring 2: [(-2, -2, 0), (0, -2, -2), (0, -2, 2), (-2, 0, -2), (2, -2, 0), (-2, 0, 2), (2, 0, -2), (-2, 2, 0), (2, 0, 2), (0, 2, -2), (0, 2, 2), (2, 2, 0)]
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: 10
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 7
info: Time taken 0.000030 /s
info: Scoring 7 potential orientations
info: Number of orientations with more than 15 peaks is 99
info: Time taken 0.016/s
info: UBI for best fitting
[[-1.23795575 -5.06502051 1.58693385]
[ 2.98603439 -1.99805865 -4.078038 ]
[ 4.38277042 -0.06517138 3.23726252]]
info: Unit cell: (5.450259285736179, 5.434982399733378, 5.449109329750564, 89.96974260057277, 89.91947465542503, 90.09274021881306)
info: Indexes 38 peaks, with <drlv2>=0.006568
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 36
info: Tried r1=5 r2=1 attempt 11 of 49, got 99 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-2, -2, 0), (0, -2, -2), (0, -2, 2), (-2, 0, -2), (2, -2, 0), (-2, 0, 2), (2, 0, -2), (-2, 2, 0), (2, 0, 2), (0, 2, -2), (0, 2, 2), (2, 2, 0)]
info: Ring 2: [(-3, -1, -1), (-1, -3, -1), (-1, -1, -3), (-3, -1, 1), (-1, -3, 1), (-3, 1, -1), (1, -3, -1), (-1, 1, -3), (1, -1, -3), (-3, 1, 1), (1, -3, 1), (1, 1, -3), (-1, -1, 3), (-1, 3, -1), (3, -1, -1), (-1, 1, 3), (1, -1, 3), (-1, 3, 1), (3, -1, 1), (1, 3, -1), (3, 1, -1), (1, 1, 3), (1, 3, 1), (3, 1, 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: 10
info: Number of peaks in ring 2: 8
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 10
info: Time taken 0.000035 /s
info: Scoring 10 potential orientations
info: Number of orientations with more than 15 peaks is 99
info: Time taken 0.017/s
info: UBI for best fitting
[[-1.23795575 -5.06502051 1.58693385]
[ 2.98603439 -1.99805865 -4.078038 ]
[ 4.38277042 -0.06517138 3.23726252]]
info: Unit cell: (5.450259285736179, 5.434982399733378, 5.449109329750564, 89.96974260057277, 89.91947465542503, 90.09274021881306)
info: Indexes 38 peaks, with <drlv2>=0.006568
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 36
info: Tried r1=1 r2=2 attempt 12 of 49, got 99 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-3, -1, -1), (-1, -3, -1), (-1, -1, -3), (-3, -1, 1), (-1, -3, 1), (-3, 1, -1), (1, -3, -1), (-1, 1, -3), (1, -1, -3), (-3, 1, 1), (1, -3, 1), (1, 1, -3), (-1, -1, 3), (-1, 3, -1), (3, -1, -1), (-1, 1, 3), (1, -1, 3), (-1, 3, 1), (3, -1, 1), (1, 3, -1), (3, 1, -1), (1, 1, 3), (1, 3, 1), (3, 1, 1)]
info: Ring 2: [(-2, -2, 0), (0, -2, -2), (0, -2, 2), (-2, 0, -2), (2, -2, 0), (-2, 0, 2), (2, 0, -2), (-2, 2, 0), (2, 0, 2), (0, 2, -2), (0, 2, 2), (2, 2, 0)]
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: 10
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 8
info: Time taken 0.000030 /s
info: Scoring 8 potential orientations
info: new grain 16 pks, i 678 j 1693 UBI 2.843176 -2.844576 3.646093 -0.489722 -4.478384 -3.082492 4.621169 1.261468 -2.607958
info: Number of orientations with more than 15 peaks is 100
info: Time taken 0.017/s
info: UBI for best fitting
[[-1.23795575 -5.06502051 1.58693385]
[ 2.98603439 -1.99805865 -4.078038 ]
[ 4.38277042 -0.06517138 3.23726252]]
info: Unit cell: (5.450259285736179, 5.434982399733378, 5.449109329750564, 89.96974260057277, 89.91947465542503, 90.09274021881306)
info: Indexes 38 peaks, with <drlv2>=0.006568
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 18
info: Tried r1=2 r2=1 attempt 13 of 49, got 100 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-2, -2, 0), (0, -2, -2), (0, -2, 2), (-2, 0, -2), (2, -2, 0), (-2, 0, 2), (2, 0, -2), (-2, 2, 0), (2, 0, 2), (0, 2, -2), (0, 2, 2), (2, 2, 0)]
info: Ring 2: [(-1, -1, -5), (-1, -5, -1), (1, -1, -5), (1, -5, -1), (-1, 1, -5), (-1, -5, 1), (-5, -1, -1), (1, 1, -5), (1, -5, 1), (-5, 1, -1), (-5, -1, 1), (-5, 1, 1), (5, -1, -1), (5, 1, -1), (5, -1, 1), (-1, 5, -1), (-1, -1, 5), (5, 1, 1), (1, 5, -1), (1, -1, 5), (-1, 5, 1), (-1, 1, 5), (1, 5, 1), (1, 1, 5), (-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: 4
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.000022 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -1, -5), (-1, -5, -1), (1, -1, -5), (1, -5, -1), (-1, 1, -5), (-1, -5, 1), (-5, -1, -1), (1, 1, -5), (1, -5, 1), (-5, 1, -1), (-5, -1, 1), (-5, 1, 1), (5, -1, -1), (5, 1, -1), (5, -1, 1), (-1, 5, -1), (-1, -1, 5), (5, 1, 1), (1, 5, -1), (1, -1, 5), (-1, 5, 1), (-1, 1, 5), (1, 5, 1), (1, 1, 5), (-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, 0), (0, -2, -2), (0, -2, 2), (-2, 0, -2), (2, -2, 0), (-2, 0, 2), (2, 0, -2), (-2, 2, 0), (2, 0, 2), (0, 2, -2), (0, 2, 2), (2, 2, 0)]
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: 1
info: Number of peaks in ring 2: 4
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: [(-4, -2, -2), (-2, -4, -2), (-4, -2, 2), (-2, -4, 2), (-2, -2, -4), (-4, 2, -2), (-2, -2, 4), (2, -4, -2), (-4, 2, 2), (-2, 2, -4), (2, -4, 2), (2, -2, -4), (-2, 2, 4), (-2, 4, -2), (2, -2, 4), (4, -2, -2), (-2, 4, 2), (2, 2, -4), (4, -2, 2), (2, 2, 4), (2, 4, -2), (4, 2, -2), (2, 4, 2), (4, 2, 2)]
info: Ring 2: [(-4, -2, -2), (-2, -4, -2), (-4, -2, 2), (-2, -4, 2), (-2, -2, -4), (-4, 2, -2), (-2, -2, 4), (2, -4, -2), (-4, 2, 2), (-2, 2, -4), (2, -4, 2), (2, -2, -4), (-2, 2, 4), (-2, 4, -2), (2, -2, 4), (4, -2, -2), (-2, 4, 2), (2, 2, -4), (4, -2, 2), (2, 2, 4), (2, 4, -2), (4, 2, -2), (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: 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 4
info: Time taken 0.000029 /s
info: Scoring 4 potential orientations
info: Number of orientations with more than 15 peaks is 100
info: Time taken 0.031/s
info: UBI for best fitting
[[-1.23795575 -5.06502051 1.58693385]
[ 2.98603439 -1.99805865 -4.078038 ]
[ 4.38277042 -0.06517138 3.23726252]]
info: Unit cell: (5.450259285736179, 5.434982399733378, 5.449109329750564, 89.96974260057277, 89.91947465542503, 90.09274021881306)
info: Indexes 38 peaks, with <drlv2>=0.006568
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 18
info: Tried r1=6 r2=6 attempt 14 of 49, got 100 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -3, -3), (1, -3, -3), (-3, -3, -1), (-3, -1, -3), (3, -3, -1), (-3, -3, 1), (3, -1, -3), (3, -3, 1), (-3, 1, -3), (-1, -3, 3), (1, -3, 3), (3, 1, -3), (-3, -1, 3), (-1, 3, -3), (1, 3, -3), (3, -1, 3), (-3, 3, -1), (-3, 1, 3), (3, 3, -1), (-3, 3, 1), (3, 1, 3), (3, 3, 1), (-1, 3, 3), (1, 3, 3)]
info: Ring 2: [(-4, -2, -2), (-2, -4, -2), (-4, -2, 2), (-2, -4, 2), (-2, -2, -4), (-4, 2, -2), (-2, -2, 4), (2, -4, -2), (-4, 2, 2), (-2, 2, -4), (2, -4, 2), (2, -2, -4), (-2, 2, 4), (-2, 4, -2), (2, -2, 4), (4, -2, -2), (-2, 4, 2), (2, 2, -4), (4, -2, 2), (2, 2, 4), (2, 4, -2), (4, 2, -2), (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: 4
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.000024 /s
info: Scoring 3 potential orientations
info: Number of orientations with more than 15 peaks is 100
info: Time taken 0.033/s
info: UBI for best fitting
[[-1.23795575 -5.06502051 1.58693385]
[ 2.98603439 -1.99805865 -4.078038 ]
[ 4.38277042 -0.06517138 3.23726252]]
info: Unit cell: (5.450259285736179, 5.434982399733378, 5.449109329750564, 89.96974260057277, 89.91947465542503, 90.09274021881306)
info: Indexes 38 peaks, with <drlv2>=0.006568
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 18
info: Tried r1=5 r2=6 attempt 15 of 49, got 100 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-4, -2, -2), (-2, -4, -2), (-4, -2, 2), (-2, -4, 2), (-2, -2, -4), (-4, 2, -2), (-2, -2, 4), (2, -4, -2), (-4, 2, 2), (-2, 2, -4), (2, -4, 2), (2, -2, -4), (-2, 2, 4), (-2, 4, -2), (2, -2, 4), (4, -2, -2), (-2, 4, 2), (2, 2, -4), (4, -2, 2), (2, 2, 4), (2, 4, -2), (4, 2, -2), (2, 4, 2), (4, 2, 2)]
info: Ring 2: [(-1, -3, -3), (1, -3, -3), (-3, -3, -1), (-3, -1, -3), (3, -3, -1), (-3, -3, 1), (3, -1, -3), (3, -3, 1), (-3, 1, -3), (-1, -3, 3), (1, -3, 3), (3, 1, -3), (-3, -1, 3), (-1, 3, -3), (1, 3, -3), (3, -1, 3), (-3, 3, -1), (-3, 1, 3), (3, 3, -1), (-3, 3, 1), (3, 1, 3), (3, 3, 1), (-1, 3, 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: 7
info: Number of peaks in ring 2: 4
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 5
info: Time taken 0.000028 /s
info: Scoring 5 potential orientations
info: Number of orientations with more than 15 peaks is 100
info: Time taken 0.033/s
info: UBI for best fitting
[[-1.23795575 -5.06502051 1.58693385]
[ 2.98603439 -1.99805865 -4.078038 ]
[ 4.38277042 -0.06517138 3.23726252]]
info: Unit cell: (5.450259285736179, 5.434982399733378, 5.449109329750564, 89.96974260057277, 89.91947465542503, 90.09274021881306)
info: Indexes 38 peaks, with <drlv2>=0.006568
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 18
info: Tried r1=6 r2=5 attempt 16 of 49, got 100 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -3, -3), (1, -3, -3), (-3, -3, -1), (-3, -1, -3), (3, -3, -1), (-3, -3, 1), (3, -1, -3), (3, -3, 1), (-3, 1, -3), (-1, -3, 3), (1, -3, 3), (3, 1, -3), (-3, -1, 3), (-1, 3, -3), (1, 3, -3), (3, -1, 3), (-3, 3, -1), (-3, 1, 3), (3, 3, -1), (-3, 3, 1), (3, 1, 3), (3, 3, 1), (-1, 3, 3), (1, 3, 3)]
info: Ring 2: [(-1, -3, -3), (1, -3, -3), (-3, -3, -1), (-3, -1, -3), (3, -3, -1), (-3, -3, 1), (3, -1, -3), (3, -3, 1), (-3, 1, -3), (-1, -3, 3), (1, -3, 3), (3, 1, -3), (-3, -1, 3), (-1, 3, -3), (1, 3, -3), (3, -1, 3), (-3, 3, -1), (-3, 1, 3), (3, 3, -1), (-3, 3, 1), (3, 1, 3), (3, 3, 1), (-1, 3, 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: 4
info: Number of peaks in ring 2: 4
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 0
info: Time taken 0.000023 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-3, -1, -1), (-1, -3, -1), (-1, -1, -3), (-3, -1, 1), (-1, -3, 1), (-3, 1, -1), (1, -3, -1), (-1, 1, -3), (1, -1, -3), (-3, 1, 1), (1, -3, 1), (1, 1, -3), (-1, -1, 3), (-1, 3, -1), (3, -1, -1), (-1, 1, 3), (1, -1, 3), (-1, 3, 1), (3, -1, 1), (1, 3, -1), (3, 1, -1), (1, 1, 3), (1, 3, 1), (3, 1, 1)]
info: Ring 2: [(-4, -2, -2), (-2, -4, -2), (-4, -2, 2), (-2, -4, 2), (-2, -2, -4), (-4, 2, -2), (-2, -2, 4), (2, -4, -2), (-4, 2, 2), (-2, 2, -4), (2, -4, 2), (2, -2, -4), (-2, 2, 4), (-2, 4, -2), (2, -2, 4), (4, -2, -2), (-2, 4, 2), (2, 2, -4), (4, -2, 2), (2, 2, 4), (2, 4, -2), (4, 2, -2), (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: 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 1
info: Time taken 0.000019 /s
info: Scoring 1 potential orientations
info: Number of orientations with more than 15 peaks is 100
info: Time taken 0.030/s
info: UBI for best fitting
[[-1.23795575 -5.06502051 1.58693385]
[ 2.98603439 -1.99805865 -4.078038 ]
[ 4.38277042 -0.06517138 3.23726252]]
info: Unit cell: (5.450259285736179, 5.434982399733378, 5.449109329750564, 89.96974260057277, 89.91947465542503, 90.09274021881306)
info: Indexes 38 peaks, with <drlv2>=0.006568
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 18
info: Tried r1=2 r2=6 attempt 17 of 49, got 100 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-4, -2, -2), (-2, -4, -2), (-4, -2, 2), (-2, -4, 2), (-2, -2, -4), (-4, 2, -2), (-2, -2, 4), (2, -4, -2), (-4, 2, 2), (-2, 2, -4), (2, -4, 2), (2, -2, -4), (-2, 2, 4), (-2, 4, -2), (2, -2, 4), (4, -2, -2), (-2, 4, 2), (2, 2, -4), (4, -2, 2), (2, 2, 4), (2, 4, -2), (4, 2, -2), (2, 4, 2), (4, 2, 2)]
info: Ring 2: [(-3, -1, -1), (-1, -3, -1), (-1, -1, -3), (-3, -1, 1), (-1, -3, 1), (-3, 1, -1), (1, -3, -1), (-1, 1, -3), (1, -1, -3), (-3, 1, 1), (1, -3, 1), (1, 1, -3), (-1, -1, 3), (-1, 3, -1), (3, -1, -1), (-1, 1, 3), (1, -1, 3), (-1, 3, 1), (3, -1, 1), (1, 3, -1), (3, 1, -1), (1, 1, 3), (1, 3, 1), (3, 1, 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: 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 4
info: Time taken 0.000029 /s
info: Scoring 4 potential orientations
info: Number of orientations with more than 15 peaks is 100
info: Time taken 0.030/s
info: UBI for best fitting
[[-1.23795575 -5.06502051 1.58693385]
[ 2.98603439 -1.99805865 -4.078038 ]
[ 4.38277042 -0.06517138 3.23726252]]
info: Unit cell: (5.450259285736179, 5.434982399733378, 5.449109329750564, 89.96974260057277, 89.91947465542503, 90.09274021881306)
info: Indexes 38 peaks, with <drlv2>=0.006568
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 18
info: Tried r1=6 r2=2 attempt 18 of 49, got 100 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-3, -1, -1), (-1, -3, -1), (-1, -1, -3), (-3, -1, 1), (-1, -3, 1), (-3, 1, -1), (1, -3, -1), (-1, 1, -3), (1, -1, -3), (-3, 1, 1), (1, -3, 1), (1, 1, -3), (-1, -1, 3), (-1, 3, -1), (3, -1, -1), (-1, 1, 3), (1, -1, 3), (-1, 3, 1), (3, -1, 1), (1, 3, -1), (3, 1, -1), (1, 1, 3), (1, 3, 1), (3, 1, 1)]
info: Ring 2: [(-1, -3, -3), (1, -3, -3), (-3, -3, -1), (-3, -1, -3), (3, -3, -1), (-3, -3, 1), (3, -1, -3), (3, -3, 1), (-3, 1, -3), (-1, -3, 3), (1, -3, 3), (3, 1, -3), (-3, -1, 3), (-1, 3, -3), (1, 3, -3), (3, -1, 3), (-3, 3, -1), (-3, 1, 3), (3, 3, -1), (-3, 3, 1), (3, 1, 3), (3, 3, 1), (-1, 3, 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: 2
info: Number of peaks in ring 2: 4
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 2
info: Time taken 0.000023 /s
info: Scoring 2 potential orientations
info: Number of orientations with more than 15 peaks is 100
info: Time taken 0.033/s
info: UBI for best fitting
[[-1.23795575 -5.06502051 1.58693385]
[ 2.98603439 -1.99805865 -4.078038 ]
[ 4.38277042 -0.06517138 3.23726252]]
info: Unit cell: (5.450259285736179, 5.434982399733378, 5.449109329750564, 89.96974260057277, 89.91947465542503, 90.09274021881306)
info: Indexes 38 peaks, with <drlv2>=0.006568
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 18
info: Tried r1=2 r2=5 attempt 19 of 49, got 100 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -3, -3), (1, -3, -3), (-3, -3, -1), (-3, -1, -3), (3, -3, -1), (-3, -3, 1), (3, -1, -3), (3, -3, 1), (-3, 1, -3), (-1, -3, 3), (1, -3, 3), (3, 1, -3), (-3, -1, 3), (-1, 3, -3), (1, 3, -3), (3, -1, 3), (-3, 3, -1), (-3, 1, 3), (3, 3, -1), (-3, 3, 1), (3, 1, 3), (3, 3, 1), (-1, 3, 3), (1, 3, 3)]
info: Ring 2: [(-3, -1, -1), (-1, -3, -1), (-1, -1, -3), (-3, -1, 1), (-1, -3, 1), (-3, 1, -1), (1, -3, -1), (-1, 1, -3), (1, -1, -3), (-3, 1, 1), (1, -3, 1), (1, 1, -3), (-1, -1, 3), (-1, 3, -1), (3, -1, -1), (-1, 1, 3), (1, -1, 3), (-1, 3, 1), (3, -1, 1), (1, 3, -1), (3, 1, -1), (1, 1, 3), (1, 3, 1), (3, 1, 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: 4
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.000023 /s
info: Scoring 3 potential orientations
info: Number of orientations with more than 15 peaks is 100
info: Time taken 0.033/s
info: UBI for best fitting
[[-1.23795575 -5.06502051 1.58693385]
[ 2.98603439 -1.99805865 -4.078038 ]
[ 4.38277042 -0.06517138 3.23726252]]
info: Unit cell: (5.450259285736179, 5.434982399733378, 5.449109329750564, 89.96974260057277, 89.91947465542503, 90.09274021881306)
info: Indexes 38 peaks, with <drlv2>=0.006568
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 18
info: Tried r1=5 r2=2 attempt 20 of 49, got 100 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-3, -1, -1), (-1, -3, -1), (-1, -1, -3), (-3, -1, 1), (-1, -3, 1), (-3, 1, -1), (1, -3, -1), (-1, 1, -3), (1, -1, -3), (-3, 1, 1), (1, -3, 1), (1, 1, -3), (-1, -1, 3), (-1, 3, -1), (3, -1, -1), (-1, 1, 3), (1, -1, 3), (-1, 3, 1), (3, -1, 1), (1, 3, -1), (3, 1, -1), (1, 1, 3), (1, 3, 1), (3, 1, 1)]
info: Ring 2: [(-3, -1, -1), (-1, -3, -1), (-1, -1, -3), (-3, -1, 1), (-1, -3, 1), (-3, 1, -1), (1, -3, -1), (-1, 1, -3), (1, -1, -3), (-3, 1, 1), (1, -3, 1), (1, 1, -3), (-1, -1, 3), (-1, 3, -1), (3, -1, -1), (-1, 1, 3), (1, -1, 3), (-1, 3, 1), (3, -1, 1), (1, 3, -1), (3, 1, -1), (1, 1, 3), (1, 3, 1), (3, 1, 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: 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.000021 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-4, -2, -2), (-2, -4, -2), (-4, -2, 2), (-2, -4, 2), (-2, -2, -4), (-4, 2, -2), (-2, -2, 4), (2, -4, -2), (-4, 2, 2), (-2, 2, -4), (2, -4, 2), (2, -2, -4), (-2, 2, 4), (-2, 4, -2), (2, -2, 4), (4, -2, -2), (-2, 4, 2), (2, 2, -4), (4, -2, 2), (2, 2, 4), (2, 4, -2), (4, 2, -2), (2, 4, 2), (4, 2, 2)]
info: Ring 2: [(-1, -1, -5), (-1, -5, -1), (1, -1, -5), (1, -5, -1), (-1, 1, -5), (-1, -5, 1), (-5, -1, -1), (1, 1, -5), (1, -5, 1), (-5, 1, -1), (-5, -1, 1), (-5, 1, 1), (5, -1, -1), (5, 1, -1), (5, -1, 1), (-1, 5, -1), (-1, -1, 5), (5, 1, 1), (1, 5, -1), (1, -1, 5), (-1, 5, 1), (-1, 1, 5), (1, 5, 1), (1, 1, 5), (-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: 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 0
info: Time taken 0.000026 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -1, -5), (-1, -5, -1), (1, -1, -5), (1, -5, -1), (-1, 1, -5), (-1, -5, 1), (-5, -1, -1), (1, 1, -5), (1, -5, 1), (-5, 1, -1), (-5, -1, 1), (-5, 1, 1), (5, -1, -1), (5, 1, -1), (5, -1, 1), (-1, 5, -1), (-1, -1, 5), (5, 1, 1), (1, 5, -1), (1, -1, 5), (-1, 5, 1), (-1, 1, 5), (1, 5, 1), (1, 1, 5), (-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), (-4, -2, 2), (-2, -4, 2), (-2, -2, -4), (-4, 2, -2), (-2, -2, 4), (2, -4, -2), (-4, 2, 2), (-2, 2, -4), (2, -4, 2), (2, -2, -4), (-2, 2, 4), (-2, 4, -2), (2, -2, 4), (4, -2, -2), (-2, 4, 2), (2, 2, -4), (4, -2, 2), (2, 2, 4), (2, 4, -2), (4, 2, -2), (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: 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 0
info: Time taken 0.000018 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -3, -3), (1, -3, -3), (-3, -3, -1), (-3, -1, -3), (3, -3, -1), (-3, -3, 1), (3, -1, -3), (3, -3, 1), (-3, 1, -3), (-1, -3, 3), (1, -3, 3), (3, 1, -3), (-3, -1, 3), (-1, 3, -3), (1, 3, -3), (3, -1, 3), (-3, 3, -1), (-3, 1, 3), (3, 3, -1), (-3, 3, 1), (3, 1, 3), (3, 3, 1), (-1, 3, 3), (1, 3, 3)]
info: Ring 2: [(-1, -1, -5), (-1, -5, -1), (1, -1, -5), (1, -5, -1), (-1, 1, -5), (-1, -5, 1), (-5, -1, -1), (1, 1, -5), (1, -5, 1), (-5, 1, -1), (-5, -1, 1), (-5, 1, 1), (5, -1, -1), (5, 1, -1), (5, -1, 1), (-1, 5, -1), (-1, -1, 5), (5, 1, 1), (1, 5, -1), (1, -1, 5), (-1, 5, 1), (-1, 1, 5), (1, 5, 1), (1, 1, 5), (-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: 1
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 0
info: Time taken 0.000024 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -1, -5), (-1, -5, -1), (1, -1, -5), (1, -5, -1), (-1, 1, -5), (-1, -5, 1), (-5, -1, -1), (1, 1, -5), (1, -5, 1), (-5, 1, -1), (-5, -1, 1), (-5, 1, 1), (5, -1, -1), (5, 1, -1), (5, -1, 1), (-1, 5, -1), (-1, -1, 5), (5, 1, 1), (1, 5, -1), (1, -1, 5), (-1, 5, 1), (-1, 1, 5), (1, 5, 1), (1, 1, 5), (-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), (1, -3, -3), (-3, -3, -1), (-3, -1, -3), (3, -3, -1), (-3, -3, 1), (3, -1, -3), (3, -3, 1), (-3, 1, -3), (-1, -3, 3), (1, -3, 3), (3, 1, -3), (-3, -1, 3), (-1, 3, -3), (1, 3, -3), (3, -1, 3), (-3, 3, -1), (-3, 1, 3), (3, 3, -1), (-3, 3, 1), (3, 1, 3), (3, 3, 1), (-1, 3, 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: 1
info: Number of peaks in ring 2: 4
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 0
info: Time taken 0.000019 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-3, -1, -1), (-1, -3, -1), (-1, -1, -3), (-3, -1, 1), (-1, -3, 1), (-3, 1, -1), (1, -3, -1), (-1, 1, -3), (1, -1, -3), (-3, 1, 1), (1, -3, 1), (1, 1, -3), (-1, -1, 3), (-1, 3, -1), (3, -1, -1), (-1, 1, 3), (1, -1, 3), (-1, 3, 1), (3, -1, 1), (1, 3, -1), (3, 1, -1), (1, 1, 3), (1, 3, 1), (3, 1, 1)]
info: Ring 2: [(-1, -1, -5), (-1, -5, -1), (1, -1, -5), (1, -5, -1), (-1, 1, -5), (-1, -5, 1), (-5, -1, -1), (1, 1, -5), (1, -5, 1), (-5, 1, -1), (-5, -1, 1), (-5, 1, 1), (5, -1, -1), (5, 1, -1), (5, -1, 1), (-1, 5, -1), (-1, -1, 5), (5, 1, 1), (1, 5, -1), (1, -1, 5), (-1, 5, 1), (-1, 1, 5), (1, 5, 1), (1, 1, 5), (-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: 1
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 0
info: Time taken 0.000035 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -1, -5), (-1, -5, -1), (1, -1, -5), (1, -5, -1), (-1, 1, -5), (-1, -5, 1), (-5, -1, -1), (1, 1, -5), (1, -5, 1), (-5, 1, -1), (-5, -1, 1), (-5, 1, 1), (5, -1, -1), (5, 1, -1), (5, -1, 1), (-1, 5, -1), (-1, -1, 5), (5, 1, 1), (1, 5, -1), (1, -1, 5), (-1, 5, 1), (-1, 1, 5), (1, 5, 1), (1, 1, 5), (-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, -1), (-1, -3, -1), (-1, -1, -3), (-3, -1, 1), (-1, -3, 1), (-3, 1, -1), (1, -3, -1), (-1, 1, -3), (1, -1, -3), (-3, 1, 1), (1, -3, 1), (1, 1, -3), (-1, -1, 3), (-1, 3, -1), (3, -1, -1), (-1, 1, 3), (1, -1, 3), (-1, 3, 1), (3, -1, 1), (1, 3, -1), (3, 1, -1), (1, 1, 3), (1, 3, 1), (3, 1, 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: 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.000016 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -1, -5), (-1, -5, -1), (1, -1, -5), (1, -5, -1), (-1, 1, -5), (-1, -5, 1), (-5, -1, -1), (1, 1, -5), (1, -5, 1), (-5, 1, -1), (-5, -1, 1), (-5, 1, 1), (5, -1, -1), (5, 1, -1), (5, -1, 1), (-1, 5, -1), (-1, -1, 5), (5, 1, 1), (1, 5, -1), (1, -1, 5), (-1, 5, 1), (-1, 1, 5), (1, 5, 1), (1, 1, 5), (-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, -5), (-1, -5, -1), (1, -1, -5), (1, -5, -1), (-1, 1, -5), (-1, -5, 1), (-5, -1, -1), (1, 1, -5), (1, -5, 1), (-5, 1, -1), (-5, -1, 1), (-5, 1, 1), (5, -1, -1), (5, 1, -1), (5, -1, 1), (-1, 5, -1), (-1, -1, 5), (5, 1, 1), (1, 5, -1), (1, -1, 5), (-1, 5, 1), (-1, 1, 5), (1, 5, 1), (1, 1, 5), (-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: 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.000018 /s
info:
Tested 20 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.18647144 0.14050209 0.21875713]
[ 0.09202499 -0.15149466 0.26191129]
[ 0.08181282 -0.09646549 0.28982354]
...
[ 0.02685697 0.61178542 0.7270337 ]
[ 0.54167857 0.29214237 0.7343513 ]
[-0.61705348 0.042535 0.72309205]] (2764, 3) float64
info: Assign to rings, maximum d-spacing considered: 0.958948
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 494 0 494 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 (2761, 3)
info: Assign to rings, maximum d-spacing considered: 0.958948
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 494 0 494 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 (2761, 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.000198 /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 219
info: Time taken 0.000583 /s
info: Scoring 219 potential orientations
info: new grain 26 pks, i 1548 j 2177 UBI 0.747131 4.694103 -2.630644 -3.021835 -1.865312 -4.146195 -4.465930 2.045819 2.341489
info: new grain 28 pks, i 1541 j 2155 UBI 2.827709 4.436335 1.397973 -1.619070 2.477135 -4.580588 -4.363000 1.955693 2.587113
info: new grain 19 pks, i 1537 j 2171 UBI 4.019337 -2.876548 -2.319148 -1.150695 2.228646 -4.815929 3.478542 4.055054 1.035860
info: new grain 19 pks, i 1533 j 778 UBI 0.063525 5.354449 1.006204 -2.169332 0.934145 -4.915935 -4.992869 -0.341293 2.110997
info: new grain 25 pks, i 1526 j 795 UBI 1.672947 -5.169834 0.355447 2.426380 0.458838 -4.863688 4.579473 1.649130 2.420857
info: new grain 30 pks, i 1521 j 766 UBI 4.517153 0.431683 -3.010916 -2.720994 -1.826106 -4.346985 -1.352768 5.110369 -1.292669
info: new grain 29 pks, i 1516 j 792 UBI 4.689605 2.733734 -0.412665 -1.881526 2.589415 -4.403880 -2.023249 3.935014 3.174765
info: new grain 34 pks, i 1515 j 791 UBI -2.057372 -4.212817 -2.786996 -0.785715 3.207819 -4.307879 4.977002 -1.243693 -1.826054
info: new grain 32 pks, i 1514 j 764 UBI -3.352064 4.051773 -1.401243 -0.533288 -2.177618 -4.964055 -4.256385 -2.912898 1.738791
info: new grain 22 pks, i 1513 j 2145 UBI 5.280576 0.332390 1.293388 1.054376 2.015871 -4.948300 -0.774958 5.046236 1.868000
info: new grain 30 pks, i 1509 j 787 UBI -4.857118 0.985236 -2.231568 2.419870 1.015087 -4.784230 -0.440564 -5.256421 -1.329657
info: new grain 27 pks, i 1506 j 760 UBI -5.068904 0.277678 -1.949219 1.967185 1.259106 -4.923330 0.203949 -5.288071 -1.265934
info: new grain 31 pks, i 1503 j 757 UBI 5.412451 -0.235031 0.595965 0.592261 3.509435 -4.124488 -0.194864 4.150700 3.504582
info: new grain 25 pks, i 1502 j 2138 UBI 2.700903 -3.514275 -3.180530 -2.790354 1.762987 -4.321985 3.818182 3.768037 -0.904188
info: new grain 21 pks, i 1495 j 772 UBI -3.910958 -3.763902 0.377395 2.101574 -2.640083 -4.284702 3.153351 -2.916252 3.338236
info: new grain 28 pks, i 1492 j 2170 UBI -3.299305 -3.405351 -2.660857 2.148165 1.634649 -4.735407 3.761661 -3.918562 0.361688
info: new grain 26 pks, i 1491 j 2167 UBI -0.567836 -4.944334 -2.238724 3.372978 1.411494 -4.023460 4.232416 -1.793544 2.906893
info: new grain 30 pks, i 1490 j 2165 UBI -4.236354 -1.342770 -3.133518 2.330893 2.521356 -4.223385 2.499099 -4.634090 -1.405498
info: new grain 22 pks, i 1485 j 2149 UBI -3.628758 -2.990828 -2.728058 2.093942 1.767681 -4.710637 3.471729 -4.200554 -0.048424
info: new grain 27 pks, i 1482 j 751 UBI 2.776505 4.588328 -0.942128 -3.275529 1.134573 -4.208336 -3.342865 2.697313 3.325075
info: new grain 23 pks, i 1477 j 749 UBI 2.514103 4.579011 1.555942 -2.005466 2.559807 -4.357790 -4.397090 1.438342 2.850689
info: new grain 24 pks, i 1476 j 2130 UBI 5.099673 0.273860 -1.858252 -1.838740 2.117559 -4.668324 0.498078 5.004434 2.092754
info: new grain 27 pks, i 1474 j 747 UBI 0.878330 -5.357819 -0.430386 2.831366 0.811728 -4.591648 4.567062 0.536818 2.891075
info: new grain 25 pks, i 1472 j 746 UBI 2.659985 -4.739494 0.188048 2.522865 1.217358 -4.661468 4.019278 2.384375 2.805732
info: new grain 23 pks, i 1468 j 2140 UBI -3.063837 2.620797 -3.650192 1.742502 -3.390263 -3.890698 -4.150053 -3.360302 1.090216
info: new grain 28 pks, i 1464 j 2122 UBI 3.964355 -2.848725 -2.408977 -2.450734 0.657854 -4.817802 2.813237 4.592526 -0.792802
info: new grain 38 pks, i 1463 j 2121 UBI -1.236602 -5.065862 1.587224 2.985224 -1.997175 -4.077173 4.381647 -0.066207 3.237812
info: new grain 36 pks, i 1459 j 773 UBI -3.013768 2.881080 -3.506069 1.029650 -3.658107 -3.886387 -4.414669 -2.818757 1.494786
info: new grain 30 pks, i 1456 j 779 UBI 0.912556 5.107981 1.636132 -2.805834 1.879940 -4.268007 -4.576639 -0.132464 2.957047
info: new grain 22 pks, i 1445 j 741 UBI 5.428267 0.401564 0.139923 -0.084195 2.630159 -4.771802 -0.409059 4.754410 2.609228
info: new grain 27 pks, i 1440 j 2163 UBI 3.199006 -4.247233 1.185733 2.701792 0.764334 -4.654470 3.484160 3.314856 2.558347
info: new grain 30 pks, i 1431 j 738 UBI 4.378077 -0.821751 -3.141760 -3.206459 -1.815065 -3.987626 -0.442101 5.065690 -1.969230
info: new grain 20 pks, i 1427 j 759 UBI -3.501937 -3.503746 -2.270225 0.132576 2.852614 -4.639871 4.174906 -3.032708 -1.714788
info: new grain 32 pks, i 1426 j 2137 UBI -0.266041 -5.241335 1.459870 1.975610 -1.446762 -4.850156 5.068326 0.281029 1.992561
info: new grain 27 pks, i 1425 j 742 UBI 5.171044 -1.147473 1.237904 1.595057 1.882773 -4.863379 0.585134 4.977413 2.107334
info: new grain 24 pks, i 1423 j 2156 UBI 2.422796 4.072492 -2.698670 -3.647875 -0.471299 -4.006202 -3.241585 3.574588 2.511322
info: new grain 30 pks, i 1412 j 2132 UBI 2.025766 -4.855539 1.423088 3.234937 0.089155 -4.367761 3.882718 2.458783 2.922300
info: new grain 34 pks, i 1409 j 745 UBI -1.734036 4.002319 -3.272013 3.189497 -1.872370 -3.982808 -4.055074 -3.184549 -1.749845
info: new grain 30 pks, i 1398 j 765 UBI -4.848538 -1.578724 -1.946878 1.281760 2.004681 -4.879686 2.118746 -4.810839 -1.422337
info: new grain 23 pks, i 147 j 2166 UBI -1.022087 4.652237 -2.649464 -1.730964 -2.830608 -4.326418 -5.059225 0.034522 1.978150
info: new grain 28 pks, i 146 j 2158 UBI -1.246928 5.276668 -0.506315 -3.142329 -1.140561 -4.278177 -4.269270 -0.699573 3.326412
info: new grain 16 pks, i 142 j 2164 UBI 0.859127 5.145998 -1.573459 -3.779521 -0.520966 -3.855815 -3.803986 1.681475 3.506208
info: new grain 17 pks, i 108 j 2150 UBI -0.765753 5.205385 -1.377168 -2.771140 -1.583870 -4.432216 -4.639603 0.079893 2.839425
info: new grain 28 pks, i 88 j 743 UBI -0.102052 4.812957 -2.550200 -2.116427 -2.375754 -4.418609 -5.015624 0.906485 1.901591
info: new grain 17 pks, i 38 j 752 UBI 5.414602 0.068563 0.569949 0.358976 3.660544 -4.025478 -0.398636 4.026430 3.631507
info: new grain 30 pks, i 29 j 770 UBI -0.850060 -4.683225 -2.634234 2.747117 1.922609 -4.282073 4.623255 -1.998547 2.088707
info: new grain 30 pks, i 16 j 753 UBI 4.539701 1.336254 -2.677515 -2.983760 1.409398 -4.330697 -0.366934 5.086075 1.927221
info: Number of orientations with more than 15 peaks is 47
info: Time taken 0.011/s
info: UBI for best fitting
[[-1.23660244 -5.06586214 1.5872243 ]
[ 2.98522422 -1.99717539 -4.07717303]
[ 4.38164745 -0.06620687 3.237812 ]]
info: Unit cell: (5.4508188172221566, 5.433563574411231, 5.448545152838135, 89.97811696918744, 89.89163050620428, 90.08803764446569)
info: Indexes 38 peaks, with <drlv2>=0.006307
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 1381
info: Tried r1=0 r2=4 attempt 1 of 49, got 47 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: 25
info: Number of peaks in ring 2: 154
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 21
info: Time taken 0.000067 /s
info: Scoring 21 potential orientations
info: new grain 28 pks, i 2161 j 1517 UBI 5.213561 -0.369312 1.513655 -1.526077 -2.453700 4.622258 0.378740 -4.845457 -2.444420
info: new grain 24 pks, i 2143 j 1 UBI 1.422157 -5.250115 0.258872 -2.984550 -0.609931 4.517056 -4.325513 -1.304730 -3.028753
info: new grain 21 pks, i 793 j 1542 UBI 0.804601 -4.666531 2.673093 -1.503640 2.431740 4.638569 -5.162272 -1.434671 -0.953926
info: new grain 27 pks, i 781 j 1540 UBI -0.718124 5.181621 1.517526 1.783546 -1.215052 5.005178 5.095484 1.156976 -1.504509
info: Number of orientations with more than 15 peaks is 51
info: Time taken 0.001/s
info: UBI for best fitting
[[-1.23660244 -5.06586214 1.5872243 ]
[ 2.98522422 -1.99717539 -4.07717303]
[ 4.38164745 -0.06620687 3.237812 ]]
info: Unit cell: (5.4508188172221566, 5.433563574411231, 5.448545152838135, 89.97811696918744, 89.89163050620428, 90.08803764446569)
info: Indexes 38 peaks, with <drlv2>=0.006307
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 1278
info: Tried r1=4 r2=0 attempt 2 of 49, got 51 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: 142
info: Number of peaks in ring 2: 142
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 100
info: Time taken 0.000273 /s
info: Scoring 100 potential orientations
info: new grain 19 pks, i 1545 j 85 UBI -1.227281 1.691646 5.031497 1.260760 -4.917555 1.968857 5.151579 1.606356 0.685167
info: new grain 34 pks, i 1543 j 118 UBI 0.439745 -0.372968 5.413282 -5.206588 1.497221 0.525178 -1.523855 -5.221574 -0.225678
info: new grain 24 pks, i 1539 j 80 UBI 1.315264 0.834830 5.216087 -3.058366 -4.264210 1.454194 4.306277 -3.282251 -0.561609
info: new grain 20 pks, i 1535 j 76 UBI 5.391295 0.409524 0.683592 -0.694732 0.243510 5.388372 0.360797 -5.430770 0.324516
info: new grain 17 pks, i 1530 j 126 UBI 1.390508 -1.215779 5.123837 -2.369612 4.588671 1.735985 -4.692506 -2.670193 0.605014
info: new grain 17 pks, i 1511 j 1475 UBI 2.670322 -4.335051 1.937725 -1.706609 1.184215 5.024334 -4.428670 -3.073345 -0.795788
info: new grain 36 pks, i 1508 j 47 UBI -2.860672 4.613161 0.369297 0.159102 -0.359847 5.430848 4.629085 2.870899 0.072309
info: new grain 17 pks, i 1494 j 155 UBI -3.234245 -4.064764 1.629520 1.728046 0.676840 5.125041 -4.018733 3.557387 0.859261
info: new grain 26 pks, i 1479 j 131 UBI 4.966468 -1.098876 1.951785 -1.908458 0.320921 5.082736 -1.141506 -5.322014 -0.101582
info: new grain 28 pks, i 1478 j 9 UBI -1.406396 5.096718 1.303615 0.875482 -1.096973 5.259486 5.186980 1.567521 -0.530052
info: new grain 21 pks, i 1473 j 6 UBI -2.001013 -0.402639 5.038481 4.000328 3.195372 1.842561 -3.101782 4.386991 -0.908280
info: new grain 36 pks, i 1467 j 1400 UBI 1.638758 5.177008 0.441382 5.169817 -1.585172 -0.603281 -0.462168 0.575299 -5.390154
info: new grain 30 pks, i 1462 j 1395 UBI 1.746634 5.085214 0.843950 5.117892 -1.604081 -0.913355 -0.629812 1.081821 -5.299452
info: new grain 28 pks, i 1441 j 1481 UBI -0.262755 5.268792 1.343257 0.738694 -1.289839 5.237905 5.388296 0.441032 -0.638328
info: new grain 30 pks, i 1432 j 129 UBI -2.082696 4.972868 0.781315 0.100430 -0.787833 5.384812 5.028630 2.072102 0.197623
info: new grain 19 pks, i 1406 j 68 UBI 1.210825 3.705782 3.795437 1.260298 -3.982993 3.471844 5.156678 0.106637 -1.777030
info: new grain 28 pks, i 148 j 1505 UBI -1.244987 -0.558117 5.267903 5.272103 0.401574 1.312490 -0.523395 5.399688 0.430599
info: new grain 29 pks, i 66 j 22 UBI 3.870988 0.759513 3.722308 -3.751227 1.762079 3.536841 -0.726035 -5.091223 1.806136
info: Number of orientations with more than 15 peaks is 69
info: Time taken 0.004/s
info: UBI for best fitting
[[-1.23660244 -5.06586214 1.5872243 ]
[ 2.98522422 -1.99717539 -4.07717303]
[ 4.38164745 -0.06620687 3.237812 ]]
info: Unit cell: (5.4508188172221566, 5.433563574411231, 5.448545152838135, 89.97811696918744, 89.89163050620428, 90.08803764446569)
info: Indexes 38 peaks, with <drlv2>=0.006307
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 768
info: Tried r1=0 r2=0 attempt 3 of 49, got 69 grains
info: hkls of rings being used for indexing
info: Ring 1: [(0, -2, -2), (-2, 0, -2), (2, 0, -2), (0, 2, -2), (-2, -2, 0), (2, -2, 0), (-2, 2, 0), (2, 2, 0), (0, -2, 2), (-2, 0, 2), (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: 163
info: Number of peaks in ring 2: 16
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 40
info: Time taken 0.000259 /s
info: Scoring 40 potential orientations
info: new grain 25 pks, i 1772 j 794 UBI -1.869556 -2.510327 -4.435484 4.785404 0.803081 -2.493746 1.792994 -4.763755 1.941945
info: new grain 24 pks, i 1762 j 771 UBI -2.337243 2.953899 -3.955818 4.866149 0.762083 -2.298723 -0.710068 -4.501697 -2.953048
info: new grain 24 pks, i 1761 j 788 UBI 3.669005 -0.329398 -3.995916 3.210930 3.518241 2.628915 2.428383 -4.134882 2.602123
info: new grain 28 pks, i 1753 j 776 UBI -0.688553 -2.743778 -4.636673 2.469696 -4.332954 2.199337 -4.802882 -1.834648 1.817156
info: new grain 29 pks, i 1670 j 762 UBI -0.359683 -2.243158 -4.956988 4.191826 3.034574 -1.673163 3.457405 -3.916738 1.505756
info: new grain 16 pks, i 1661 j 2136 UBI -2.968041 -0.172002 -4.569272 -2.584207 -4.419374 1.817979 -3.758340 3.182710 2.336883
info: new grain 17 pks, i 1615 j 737 UBI 2.065428 -1.429218 -4.844439 -0.939905 5.009482 -1.863253 4.948100 1.563564 1.646158
info: new grain 26 pks, i 251 j 2126 UBI -0.811062 -3.221123 -4.303299 2.835277 3.450661 -3.108779 4.580252 -2.708016 1.205494
info: Number of orientations with more than 15 peaks is 77
info: Time taken 0.002/s
info: UBI for best fitting
[[-1.23660244 -5.06586214 1.5872243 ]
[ 2.98522422 -1.99717539 -4.07717303]
[ 4.38164745 -0.06620687 3.237812 ]]
info: Unit cell: (5.4508188172221566, 5.433563574411231, 5.448545152838135, 89.97811696918744, 89.89163050620428, 90.08803764446569)
info: Indexes 38 peaks, with <drlv2>=0.006307
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 551
info: Tried r1=1 r2=4 attempt 4 of 49, got 77 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, 0, -2), (0, 2, -2), (-2, -2, 0), (2, -2, 0), (-2, 2, 0), (2, 2, 0), (0, -2, 2), (-2, 0, 2), (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: 48
info: Number of peaks in ring 2: 130
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 47
info: Time taken 0.000107 /s
info: Scoring 47 potential orientations
info: new grain 17 pks, i 1547 j 1699 UBI 1.282179 1.372953 5.116098 4.521801 -3.009006 -0.308029 2.744745 4.319906 -1.834125
info: new grain 29 pks, i 1519 j 1728 UBI 2.093112 5.023896 -0.028911 0.528234 -0.266256 -5.409944 -4.999452 2.074339 -0.618617
info: new grain 18 pks, i 1455 j 217 UBI -1.602952 0.946961 5.106646 -5.091718 -1.388560 -1.358430 1.078600 -5.179165 1.315220
info: new grain 19 pks, i 1453 j 235 UBI 1.489841 1.316407 5.065159 4.906260 1.506196 -1.864010 -1.852227 5.052176 -0.728267
info: new grain 23 pks, i 1417 j 1604 UBI 4.110535 -2.969464 1.970009 -1.112138 -3.942813 -3.574070 3.370017 2.315352 -3.596368
info: new grain 26 pks, i 1416 j 222 UBI 3.074555 3.937805 2.152330 3.834945 -0.932747 -3.743816 -2.344580 3.640956 -3.313668
info: new grain 29 pks, i 1415 j 1656 UBI 3.316468 4.281849 -0.526756 0.698220 -1.210917 -5.265934 -4.261786 3.133878 -1.270217
info: new grain 27 pks, i 1404 j 1647 UBI 3.867283 -0.583334 3.771746 3.028311 -2.839689 -3.550810 2.350126 4.607820 -1.665065
info: new grain 25 pks, i 1396 j 203 UBI 1.067386 -1.528379 5.115975 0.479139 -5.168775 -1.665974 5.314309 0.781948 -0.849649
info: new grain 28 pks, i 77 j 219 UBI 1.248341 -0.175931 5.288954 -2.506231 -4.817129 0.438460 4.671019 -2.536418 -1.214582
info: new grain 24 pks, i 37 j 1605 UBI -5.022683 2.099829 -0.057049 0.627193 1.393350 -5.217507 -2.005298 -4.826745 -1.560982
info: Number of orientations with more than 15 peaks is 88
info: Time taken 0.002/s
info: UBI for best fitting
[[-1.23660244 -5.06586214 1.5872243 ]
[ 2.98522422 -1.99717539 -4.07717303]
[ 4.38164745 -0.06620687 3.237812 ]]
info: Unit cell: (5.4508188172221566, 5.433563574411231, 5.448545152838135, 89.97811696918744, 89.89163050620428, 90.08803764446569)
info: Indexes 38 peaks, with <drlv2>=0.006307
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 252
info: Tried r1=0 r2=1 attempt 5 of 49, got 88 grains
info: hkls of rings being used for indexing
info: Ring 1: [(0, -2, -2), (-2, 0, -2), (2, 0, -2), (0, 2, -2), (-2, -2, 0), (2, -2, 0), (-2, 2, 0), (2, 2, 0), (0, -2, 2), (-2, 0, 2), (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: 68
info: Number of peaks in ring 2: 8
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 13
info: Time taken 0.000126 /s
info: Scoring 13 potential orientations
info: new grain 21 pks, i 1715 j 120 UBI 4.066940 1.204921 -3.415323 -3.056167 3.893237 -2.302135 1.943147 3.617495 3.562020
info: new grain 17 pks, i 395 j 1525 UBI -4.408417 2.599320 -1.849790 1.019030 -1.797466 -5.026062 -3.008155 -4.428047 0.981050
info: Number of orientations with more than 15 peaks is 90
info: Time taken 0.001/s
info: UBI for best fitting
[[-1.23660244 -5.06586214 1.5872243 ]
[ 2.98522422 -1.99717539 -4.07717303]
[ 4.38164745 -0.06620687 3.237812 ]]
info: Unit cell: (5.4508188172221566, 5.433563574411231, 5.448545152838135, 89.97811696918744, 89.89163050620428, 90.08803764446569)
info: Indexes 38 peaks, with <drlv2>=0.006307
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 206
info: Tried r1=1 r2=0 attempt 6 of 49, got 90 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, 0, -2), (0, 2, -2), (-2, -2, 0), (2, -2, 0), (-2, 2, 0), (2, 2, 0), (0, -2, 2), (-2, 0, 2), (2, 0, 2), (0, 2, 2)]
info: Ring 2: [(0, -2, -2), (-2, 0, -2), (2, 0, -2), (0, 2, -2), (-2, -2, 0), (2, -2, 0), (-2, 2, 0), (2, 2, 0), (0, -2, 2), (-2, 0, 2), (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: 58
info: Number of peaks in ring 2: 58
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 54
info: Time taken 0.000110 /s
info: Scoring 54 potential orientations
info: new grain 20 pks, i 1744 j 272 UBI 1.757088 3.867727 3.402888 -4.117874 -1.108017 3.366524 3.097098 -3.665085 2.601108
info: new grain 18 pks, i 1742 j 270 UBI 1.601416 4.296354 2.929567 -3.998193 -0.963969 3.550040 3.337430 -3.211154 2.904365
info: new grain 20 pks, i 1722 j 324 UBI 3.546755 -2.282584 3.468188 -0.068264 4.510892 3.027910 -4.129103 -2.022036 2.906088
info: new grain 17 pks, i 1674 j 199 UBI 3.423046 -2.229611 3.612630 0.059712 4.655127 2.791547 -4.224323 -1.736619 2.967485
info: new grain 19 pks, i 1663 j 227 UBI 1.748341 -3.901349 3.347153 1.990038 3.799497 3.364741 -4.754187 0.158361 2.667489
info: new grain 17 pks, i 1639 j 1557 UBI 1.116963 -3.729803 3.795902 3.012568 3.639727 2.730282 -4.403137 1.553938 2.785595
info: new grain 17 pks, i 1561 j 1642 UBI 4.186486 1.459653 3.137238 -3.472520 2.175924 3.593678 -0.301640 -4.766432 2.630170
info: new grain 24 pks, i 210 j 190 UBI -1.466374 0.999011 5.155090 0.392244 -5.306476 1.116150 5.223201 0.682258 1.348588
info: Number of orientations with more than 15 peaks is 98
info: Time taken 0.003/s
info: UBI for best fitting
[[-1.23660244 -5.06586214 1.5872243 ]
[ 2.98522422 -1.99717539 -4.07717303]
[ 4.38164745 -0.06620687 3.237812 ]]
info: Unit cell: (5.4508188172221566, 5.433563574411231, 5.448545152838135, 89.97811696918744, 89.89163050620428, 90.08803764446569)
info: Indexes 38 peaks, with <drlv2>=0.006307
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 98 grains
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, -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, -2, -2), (-4, 2, -2), (-2, -2, -4), (-4, -2, 2), (-2, -4, -2), (-2, 2, -4), (-4, 2, 2), (-2, -4, 2), (-2, 4, -2), (-2, -2, 4), (-2, 4, 2), (-2, 2, 4), (2, -2, -4), (2, -4, -2), (2, 2, -4), (2, -4, 2), (2, 4, -2), (4, -2, -2), (2, -2, 4), (2, 4, 2), (4, 2, -2), (2, 2, 4), (4, -2, 2), (4, 2, 2)]
info: Possible angles and cosines between peaks in rings:
info: 19.471221 0.942809
info: 61.874494 0.471405
info: 90.000000 0.000000
info: 118.125506 -0.471405
info: 160.528779 -0.942809
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 15
info: Number of trial orientations generated 1
info: Time taken 0.000023 /s
info: Scoring 1 potential orientations
info: Number of orientations with more than 15 peaks is 98
info: Time taken 0.011/s
info: UBI for best fitting
[[-1.23660244 -5.06586214 1.5872243 ]
[ 2.98522422 -1.99717539 -4.07717303]
[ 4.38164745 -0.06620687 3.237812 ]]
info: Unit cell: (5.4508188172221566, 5.433563574411231, 5.448545152838135, 89.97811696918744, 89.89163050620428, 90.08803764446569)
info: Indexes 38 peaks, with <drlv2>=0.006307
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 50
info: Tried r1=0 r2=6 attempt 8 of 49, got 98 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-4, -2, -2), (-4, 2, -2), (-2, -2, -4), (-4, -2, 2), (-2, -4, -2), (-2, 2, -4), (-4, 2, 2), (-2, -4, 2), (-2, 4, -2), (-2, -2, 4), (-2, 4, 2), (-2, 2, 4), (2, -2, -4), (2, -4, -2), (2, 2, -4), (2, -4, 2), (2, 4, -2), (4, -2, -2), (2, -2, 4), (2, 4, 2), (4, 2, -2), (2, 2, 4), (4, -2, 2), (4, 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: 19.471221 0.942809
info: 61.874494 0.471405
info: 90.000000 0.000000
info: 118.125506 -0.471405
info: 160.528779 -0.942809
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 15
info: Number of trial orientations generated 1
info: Time taken 0.000024 /s
info: Scoring 1 potential orientations
info: Number of orientations with more than 15 peaks is 98
info: Time taken 0.011/s
info: UBI for best fitting
[[-1.23660244 -5.06586214 1.5872243 ]
[ 2.98522422 -1.99717539 -4.07717303]
[ 4.38164745 -0.06620687 3.237812 ]]
info: Unit cell: (5.4508188172221566, 5.433563574411231, 5.448545152838135, 89.97811696918744, 89.89163050620428, 90.08803764446569)
info: Indexes 38 peaks, with <drlv2>=0.006307
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 50
info: Tried r1=6 r2=0 attempt 9 of 49, got 98 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, -3, -3), (1, -3, -3), (-3, -3, -1), (-3, -3, 1), (3, -3, -1), (3, -3, 1), (-1, -3, 3), (1, -3, 3), (-3, -1, -3), (3, -1, -3), (-3, -1, 3), (-3, 1, -3), (3, -1, 3), (3, 1, -3), (-3, 1, 3), (3, 1, 3), (-1, 3, -3), (1, 3, -3), (-3, 3, -1), (-3, 3, 1), (3, 3, -1), (3, 3, 1), (-1, 3, 3), (1, 3, 3)]
info: Possible angles and cosines between peaks in rings:
info: 22.001714 0.927173
info: 48.527066 0.662266
info: 82.388621 0.132453
info: 97.611379 -0.132453
info: 131.472934 -0.662266
info: 157.998286 -0.927173
info: Number of peaks in ring 1: 4
info: Number of peaks in ring 2: 10
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 4
info: Time taken 0.000079 /s
info: Scoring 4 potential orientations
info: new grain 20 pks, i 26 j 917 UBI -4.519806 2.428552 1.767610 -0.634441 -3.940021 3.721856 2.956687 2.864937 3.557699
info: Number of orientations with more than 15 peaks is 99
info: Time taken 0.011/s
info: UBI for best fitting
[[-1.23660244 -5.06586214 1.5872243 ]
[ 2.98522422 -1.99717539 -4.07717303]
[ 4.38164745 -0.06620687 3.237812 ]]
info: Unit cell: (5.4508188172221566, 5.433563574411231, 5.448545152838135, 89.97811696918744, 89.89163050620428, 90.08803764446569)
info: Indexes 38 peaks, with <drlv2>=0.006307
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 24
info: Tried r1=0 r2=5 attempt 10 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: hkls of rings being used for indexing
info: Ring 1: [(0, -2, -2), (-2, 0, -2), (2, 0, -2), (0, 2, -2), (-2, -2, 0), (2, -2, 0), (-2, 2, 0), (2, 2, 0), (0, -2, 2), (-2, 0, 2), (2, 0, 2), (0, 2, 2)]
info: Ring 2: [(-4, -2, -2), (-4, 2, -2), (-2, -2, -4), (-4, -2, 2), (-2, -4, -2), (-2, 2, -4), (-4, 2, 2), (-2, -4, 2), (-2, 4, -2), (-2, -2, 4), (-2, 4, 2), (-2, 2, 4), (2, -2, -4), (2, -4, -2), (2, 2, -4), (2, -4, 2), (2, 4, -2), (4, -2, -2), (2, -2, 4), (2, 4, 2), (4, 2, -2), (2, 2, 4), (4, -2, 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: 6
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.000028 /s
info: Scoring 1 potential orientations
info: Number of orientations with more than 15 peaks is 99
info: Time taken 0.000/s
info: UBI for best fitting
[[-1.23660244 -5.06586214 1.5872243 ]
[ 2.98522422 -1.99717539 -4.07717303]
[ 4.38164745 -0.06620687 3.237812 ]]
info: Unit cell: (5.4508188172221566, 5.433563574411231, 5.448545152838135, 89.97811696918744, 89.89163050620428, 90.08803764446569)
info: Indexes 38 peaks, with <drlv2>=0.006307
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 24
info: Tried r1=1 r2=6 attempt 11 of 49, got 99 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-4, -2, -2), (-4, 2, -2), (-2, -2, -4), (-4, -2, 2), (-2, -4, -2), (-2, 2, -4), (-4, 2, 2), (-2, -4, 2), (-2, 4, -2), (-2, -2, 4), (-2, 4, 2), (-2, 2, 4), (2, -2, -4), (2, -4, -2), (2, 2, -4), (2, -4, 2), (2, 4, -2), (4, -2, -2), (2, -2, 4), (2, 4, 2), (4, 2, -2), (2, 2, 4), (4, -2, 2), (4, 2, 2)]
info: Ring 2: [(0, -2, -2), (-2, 0, -2), (2, 0, -2), (0, 2, -2), (-2, -2, 0), (2, -2, 0), (-2, 2, 0), (2, 2, 0), (0, -2, 2), (-2, 0, 2), (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: 6
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 1
info: Time taken 0.000041 /s
info: Scoring 1 potential orientations
info: Number of orientations with more than 15 peaks is 99
info: Time taken 0.000/s
info: UBI for best fitting
[[-1.23660244 -5.06586214 1.5872243 ]
[ 2.98522422 -1.99717539 -4.07717303]
[ 4.38164745 -0.06620687 3.237812 ]]
info: Unit cell: (5.4508188172221566, 5.433563574411231, 5.448545152838135, 89.97811696918744, 89.89163050620428, 90.08803764446569)
info: Indexes 38 peaks, with <drlv2>=0.006307
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 24
info: Tried r1=6 r2=1 attempt 12 of 49, got 99 grains
info: hkls of rings being used for indexing
info: Ring 1: [(0, -2, -2), (-2, 0, -2), (2, 0, -2), (0, 2, -2), (-2, -2, 0), (2, -2, 0), (-2, 2, 0), (2, 2, 0), (0, -2, 2), (-2, 0, 2), (2, 0, 2), (0, 2, 2)]
info: Ring 2: [(-1, -3, -3), (1, -3, -3), (-3, -3, -1), (-3, -3, 1), (3, -3, -1), (3, -3, 1), (-1, -3, 3), (1, -3, 3), (-3, -1, -3), (3, -1, -3), (-3, -1, 3), (-3, 1, -3), (3, -1, 3), (3, 1, -3), (-3, 1, 3), (3, 1, 3), (-1, 3, -3), (1, 3, -3), (-3, 3, -1), (-3, 3, 1), (3, 3, -1), (3, 3, 1), (-1, 3, 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: 6
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.000026 /s
info: Scoring 6 potential orientations
info: new grain 17 pks, i 1693 j 2379 UBI -4.626482 -1.261568 2.610434 2.838923 -2.843288 3.646665 0.490154 4.478863 3.082467
info: Number of orientations with more than 15 peaks is 100
info: Time taken 0.000/s
info: UBI for best fitting
[[-1.23660244 -5.06586214 1.5872243 ]
[ 2.98522422 -1.99717539 -4.07717303]
[ 4.38164745 -0.06620687 3.237812 ]]
info: Unit cell: (5.4508188172221566, 5.433563574411231, 5.448545152838135, 89.97811696918744, 89.89163050620428, 90.08803764446569)
info: Indexes 38 peaks, with <drlv2>=0.006307
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 6
info: Tried r1=1 r2=5 attempt 13 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: [(-4, -2, -2), (-4, 2, -2), (-2, -2, -4), (-4, -2, 2), (-2, -4, -2), (-2, 2, -4), (-4, 2, 2), (-2, -4, 2), (-2, 4, -2), (-2, -2, 4), (-2, 4, 2), (-2, 2, 4), (2, -2, -4), (2, -4, -2), (2, 2, -4), (2, -4, 2), (2, 4, -2), (4, -2, -2), (2, -2, 4), (2, 4, 2), (4, 2, -2), (2, 2, 4), (4, -2, 2), (4, 2, 2)]
info: Ring 2: [(-4, -2, -2), (-4, 2, -2), (-2, -2, -4), (-4, -2, 2), (-2, -4, -2), (-2, 2, -4), (-4, 2, 2), (-2, -4, 2), (-2, 4, -2), (-2, -2, 4), (-2, 4, 2), (-2, 2, 4), (2, -2, -4), (2, -4, -2), (2, 2, -4), (2, -4, 2), (2, 4, -2), (4, -2, -2), (2, -2, 4), (2, 4, 2), (4, 2, -2), (2, 2, 4), (4, -2, 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.000024 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -3, -3), (1, -3, -3), (-3, -3, -1), (-3, -3, 1), (3, -3, -1), (3, -3, 1), (-1, -3, 3), (1, -3, 3), (-3, -1, -3), (3, -1, -3), (-3, -1, 3), (-3, 1, -3), (3, -1, 3), (3, 1, -3), (-3, 1, 3), (3, 1, 3), (-1, 3, -3), (1, 3, -3), (-3, 3, -1), (-3, 3, 1), (3, 3, -1), (3, 3, 1), (-1, 3, 3), (1, 3, 3)]
info: Ring 2: [(-4, -2, -2), (-4, 2, -2), (-2, -2, -4), (-4, -2, 2), (-2, -4, -2), (-2, 2, -4), (-4, 2, 2), (-2, -4, 2), (-2, 4, -2), (-2, -2, 4), (-2, 4, 2), (-2, 2, 4), (2, -2, -4), (2, -4, -2), (2, 2, -4), (2, -4, 2), (2, 4, -2), (4, -2, -2), (2, -2, 4), (2, 4, 2), (4, 2, -2), (2, 2, 4), (4, -2, 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: 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 1
info: Time taken 0.000022 /s
info: Scoring 1 potential orientations
info: Number of orientations with more than 15 peaks is 100
info: Time taken 0.000/s
info: UBI for best fitting
[[-1.23660244 -5.06586214 1.5872243 ]
[ 2.98522422 -1.99717539 -4.07717303]
[ 4.38164745 -0.06620687 3.237812 ]]
info: Unit cell: (5.4508188172221566, 5.433563574411231, 5.448545152838135, 89.97811696918744, 89.89163050620428, 90.08803764446569)
info: Indexes 38 peaks, with <drlv2>=0.006307
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 6
info: Tried r1=5 r2=6 attempt 14 of 49, got 100 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-4, -2, -2), (-4, 2, -2), (-2, -2, -4), (-4, -2, 2), (-2, -4, -2), (-2, 2, -4), (-4, 2, 2), (-2, -4, 2), (-2, 4, -2), (-2, -2, 4), (-2, 4, 2), (-2, 2, 4), (2, -2, -4), (2, -4, -2), (2, 2, -4), (2, -4, 2), (2, 4, -2), (4, -2, -2), (2, -2, 4), (2, 4, 2), (4, 2, -2), (2, 2, 4), (4, -2, 2), (4, 2, 2)]
info: Ring 2: [(-1, -3, -3), (1, -3, -3), (-3, -3, -1), (-3, -3, 1), (3, -3, -1), (3, -3, 1), (-1, -3, 3), (1, -3, 3), (-3, -1, -3), (3, -1, -3), (-3, -1, 3), (-3, 1, -3), (3, -1, 3), (3, 1, -3), (-3, 1, 3), (3, 1, 3), (-1, 3, -3), (1, 3, -3), (-3, 3, -1), (-3, 3, 1), (3, 3, -1), (3, 3, 1), (-1, 3, 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: 2
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 1
info: Time taken 0.000022 /s
info: Scoring 1 potential orientations
info: Number of orientations with more than 15 peaks is 100
info: Time taken 0.000/s
info: UBI for best fitting
[[-1.23660244 -5.06586214 1.5872243 ]
[ 2.98522422 -1.99717539 -4.07717303]
[ 4.38164745 -0.06620687 3.237812 ]]
info: Unit cell: (5.4508188172221566, 5.433563574411231, 5.448545152838135, 89.97811696918744, 89.89163050620428, 90.08803764446569)
info: Indexes 38 peaks, with <drlv2>=0.006307
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 6
info: Tried r1=6 r2=5 attempt 15 of 49, got 100 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -3, -3), (1, -3, -3), (-3, -3, -1), (-3, -3, 1), (3, -3, -1), (3, -3, 1), (-1, -3, 3), (1, -3, 3), (-3, -1, -3), (3, -1, -3), (-3, -1, 3), (-3, 1, -3), (3, -1, 3), (3, 1, -3), (-3, 1, 3), (3, 1, 3), (-1, 3, -3), (1, 3, -3), (-3, 3, -1), (-3, 3, 1), (3, 3, -1), (3, 3, 1), (-1, 3, 3), (1, 3, 3)]
info: Ring 2: [(-1, -3, -3), (1, -3, -3), (-3, -3, -1), (-3, -3, 1), (3, -3, -1), (3, -3, 1), (-1, -3, 3), (1, -3, 3), (-3, -1, -3), (3, -1, -3), (-3, -1, 3), (-3, 1, -3), (3, -1, 3), (3, 1, -3), (-3, 1, 3), (3, 1, 3), (-1, 3, -3), (1, 3, -3), (-3, 3, -1), (-3, 3, 1), (3, 3, -1), (3, 3, 1), (-1, 3, 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: 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.000020 /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: [(-4, -2, -2), (-4, 2, -2), (-2, -2, -4), (-4, -2, 2), (-2, -4, -2), (-2, 2, -4), (-4, 2, 2), (-2, -4, 2), (-2, 4, -2), (-2, -2, 4), (-2, 4, 2), (-2, 2, 4), (2, -2, -4), (2, -4, -2), (2, 2, -4), (2, -4, 2), (2, 4, -2), (4, -2, -2), (2, -2, 4), (2, 4, 2), (4, 2, -2), (2, 2, 4), (4, -2, 2), (4, 2, 2)]
info: Ring 2: [(-1, -5, -1), (-1, -1, -5), (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), (-5, 1, 1), (5, -1, -1), (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, 1, 5), (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: 1
info: Minimum number of peaks to identify a grain 15
info: Number of trial orientations generated 0
info: Time taken 0.000022 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -5, -1), (-1, -1, -5), (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), (-5, 1, 1), (5, -1, -1), (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, 1, 5), (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), (-4, 2, -2), (-2, -2, -4), (-4, -2, 2), (-2, -4, -2), (-2, 2, -4), (-4, 2, 2), (-2, -4, 2), (-2, 4, -2), (-2, -2, 4), (-2, 4, 2), (-2, 2, 4), (2, -2, -4), (2, -4, -2), (2, 2, -4), (2, -4, 2), (2, 4, -2), (4, -2, -2), (2, -2, 4), (2, 4, 2), (4, 2, -2), (2, 2, 4), (4, -2, 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: 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 0
info: Time taken 0.000021 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -3, -3), (1, -3, -3), (-3, -3, -1), (-3, -3, 1), (3, -3, -1), (3, -3, 1), (-1, -3, 3), (1, -3, 3), (-3, -1, -3), (3, -1, -3), (-3, -1, 3), (-3, 1, -3), (3, -1, 3), (3, 1, -3), (-3, 1, 3), (3, 1, 3), (-1, 3, -3), (1, 3, -3), (-3, 3, -1), (-3, 3, 1), (3, 3, -1), (3, 3, 1), (-1, 3, 3), (1, 3, 3)]
info: Ring 2: [(-1, -5, -1), (-1, -1, -5), (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), (-5, 1, 1), (5, -1, -1), (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, 1, 5), (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: 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.000021 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -5, -1), (-1, -1, -5), (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), (-5, 1, 1), (5, -1, -1), (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, 1, 5), (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), (1, -3, -3), (-3, -3, -1), (-3, -3, 1), (3, -3, -1), (3, -3, 1), (-1, -3, 3), (1, -3, 3), (-3, -1, -3), (3, -1, -3), (-3, -1, 3), (-3, 1, -3), (3, -1, 3), (3, 1, -3), (-3, 1, 3), (3, 1, 3), (-1, 3, -3), (1, 3, -3), (-3, 3, -1), (-3, 3, 1), (3, 3, -1), (3, 3, 1), (-1, 3, 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: 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.000034 /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, -1, -5), (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), (-5, 1, 1), (5, -1, -1), (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, 1, 5), (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, -1, -5), (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), (-5, 1, 1), (5, -1, -1), (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, 1, 5), (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: 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.000016 /s
info:
Tested 15 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.18676464 0.14040407 0.21874064]
[ 0.09217003 -0.15146426 0.26218343]
[ 0.08218933 -0.09657942 0.28983034]
...
[ 0.02685697 0.61178542 0.7270337 ]
[ 0.54167857 0.29214237 0.7343513 ]
[-0.61705348 0.042535 0.72309205]] (5528, 3) float64
info: Assign to rings, maximum d-spacing considered: 0.958948
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 ( -4, -2, -2) 24 781 0 781 N/A N/A -53.48
info: Ring 5 ( -1, -3, -3) 24 988 0 988 N/A N/A -47.20
info: Ring 4 ( 0, -4, 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, -3, -1) 24 1362 0 1362 N/A N/A -35.47
info: Ring 1 ( 0, -2, -2) 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 (5523, 3)
info: Assign to rings, maximum d-spacing considered: 0.958948
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 ( -4, -2, -2) 24 781 0 781 N/A N/A -53.48
info: Ring 5 ( -1, -3, -3) 24 988 0 988 N/A N/A -47.20
info: Ring 4 ( 0, -4, 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, -3, -1) 24 1362 0 1362 N/A N/A -35.47
info: Ring 1 ( 0, -2, -2) 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 (5523, 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: 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.000453 /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: 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 454
info: Time taken 0.001419 /s
info: Scoring 454 potential orientations
info: new grain 53 pks, i 4312 j 4941 UBI 0.746679 4.694964 -2.631305 -3.020748 -1.864016 -4.146672 -4.466244 2.046180 2.341039
info: new grain 56 pks, i 4305 j 774 UBI 2.827171 4.436011 1.398324 -1.619172 2.476785 -4.580307 -4.362846 1.955783 2.587753
info: new grain 40 pks, i 4301 j 2171 UBI 4.019650 -2.876394 -2.318514 -1.150108 2.227475 -4.815431 3.478118 4.054166 1.035431
info: new grain 38 pks, i 4297 j 778 UBI 0.062422 5.355260 1.005914 -2.168529 0.934619 -4.915898 -4.992953 -0.341030 2.111518
info: new grain 50 pks, i 4290 j 3559 UBI 1.673213 -5.169087 0.355310 2.427355 0.459619 -4.862979 4.579244 1.650727 2.421188
info: new grain 60 pks, i 4285 j 3530 UBI 4.517010 0.431668 -3.010957 -2.720992 -1.825876 -4.346980 -1.352237 5.110044 -1.292862
info: new grain 58 pks, i 4280 j 3556 UBI 4.688788 2.734114 -0.412283 -1.881576 2.588791 -4.403666 -2.023242 3.934500 3.174835
info: new grain 69 pks, i 4279 j 791 UBI -2.058396 -4.212106 -2.787149 -0.786095 3.208956 -4.308373 4.977205 -1.242808 -1.826138
info: new grain 64 pks, i 4278 j 3528 UBI -3.352070 4.052479 -1.401205 -0.533498 -2.177345 -4.963955 -4.256408 -2.912537 1.738602
info: new grain 45 pks, i 4277 j 4909 UBI 5.280100 0.332517 1.292888 1.054723 2.016252 -4.948154 -0.774169 5.045812 1.868102
info: new grain 60 pks, i 4273 j 3551 UBI -4.857233 0.985477 -2.231766 2.419793 1.014846 -4.784277 -0.440266 -5.256737 -1.329448
info: new grain 54 pks, i 4270 j 3524 UBI -5.069256 0.277369 -1.949364 1.967280 1.259777 -4.923067 0.203130 -5.288035 -1.265992
info: new grain 62 pks, i 4267 j 3521 UBI 5.411189 -0.235390 0.595538 0.592680 3.509598 -4.124417 -0.194599 4.151887 3.504668
info: new grain 50 pks, i 4266 j 2138 UBI 2.701418 -3.513558 -3.180297 -2.790952 1.763111 -4.322269 3.818231 3.767401 -0.904529
info: new grain 42 pks, i 4259 j 3536 UBI -3.910441 -3.765029 0.378087 2.101997 -2.638719 -4.283793 3.153061 -2.915749 3.338221
info: new grain 36 pks, i 4257 j 2132 UBI -3.878477 -2.463454 -2.921305 3.237953 0.088094 -4.364956 2.029129 -4.850049 1.425755
info: new grain 56 pks, i 4256 j 4934 UBI -3.299322 -3.405254 -2.661277 2.148157 1.634580 -4.735174 3.761410 -3.918095 0.361452
info: new grain 52 pks, i 4255 j 2167 UBI -0.568091 -4.943981 -2.238348 3.372906 1.412089 -4.023366 4.231988 -1.793529 2.907532
info: new grain 60 pks, i 4254 j 4929 UBI -4.236592 -1.342643 -3.133455 2.331020 2.521200 -4.223440 2.499434 -4.633796 -1.405479
info: new grain 44 pks, i 4249 j 4913 UBI -3.629109 -2.990811 -2.728294 2.094558 1.767326 -4.710058 3.471348 -4.200072 -0.048694
info: new grain 54 pks, i 4246 j 751 UBI 2.776246 4.588710 -0.941798 -3.275409 1.134624 -4.208442 -3.342381 2.698051 3.325151
info: new grain 49 pks, i 4240 j 2130 UBI 5.100064 0.273974 -1.858199 -1.838844 2.117265 -4.668463 0.498120 5.004756 2.092896
info: new grain 54 pks, i 4238 j 3511 UBI 0.878841 -5.357642 -0.430289 2.831000 0.812137 -4.591474 4.567086 0.536773 2.891240
info: new grain 48 pks, i 4236 j 746 UBI 2.658613 -4.738762 0.188516 2.522972 1.217218 -4.661428 4.018720 2.384791 2.805345
info: new grain 44 pks, i 4232 j 4904 UBI -3.064529 2.620948 -3.650445 1.743763 -3.391775 -3.889605 -4.148785 -3.360961 1.090392
info: new grain 56 pks, i 4228 j 4886 UBI 3.964477 -2.848691 -2.408705 -2.450477 0.657692 -4.818043 2.812190 4.592530 -0.793306
info: new grain 76 pks, i 4227 j 2121 UBI -1.237279 -5.065441 1.587079 2.985629 -1.997617 -4.077605 4.382209 -0.065689 3.237537
info: new grain 72 pks, i 4223 j 3537 UBI -3.013900 2.881080 -3.505944 1.029508 -3.658165 -3.886618 -4.415823 -2.818175 1.494584
info: new grain 60 pks, i 4220 j 779 UBI 0.911562 5.107233 1.636165 -2.806143 1.879705 -4.267830 -4.576188 -0.132035 2.956888
info: new grain 46 pks, i 4209 j 741 UBI 5.428542 0.403221 0.139403 -0.082742 2.631618 -4.772669 -0.409495 4.752336 2.610007
info: new grain 54 pks, i 4204 j 4927 UBI 3.199265 -4.247422 1.185725 2.701974 0.763695 -4.654653 3.483503 3.314071 2.558124
info: new grain 60 pks, i 4195 j 2120 UBI 4.378374 -0.822236 -3.141444 -3.206717 -1.815218 -3.988102 -0.442204 5.065922 -1.968951
info: new grain 42 pks, i 4191 j 3523 UBI -3.504347 -3.504485 -2.269874 0.131843 2.851465 -4.638946 4.171787 -3.032842 -1.714570
info: new grain 65 pks, i 4190 j 2137 UBI -0.266673 -5.241181 1.460319 1.976007 -1.447541 -4.850440 5.067246 0.281175 1.992498
info: new grain 54 pks, i 4189 j 2124 UBI 5.171591 -1.147447 1.238851 1.594861 1.883000 -4.863093 0.585489 4.978612 2.107491
info: new grain 48 pks, i 4187 j 4920 UBI 2.422921 4.072639 -2.698189 -3.647534 -0.470768 -4.006555 -3.241247 3.575366 2.511231
info: new grain 68 pks, i 4173 j 3509 UBI -1.733940 4.002090 -3.271969 3.189539 -1.873053 -3.982837 -4.055694 -3.183601 -1.749577
info: new grain 60 pks, i 4162 j 765 UBI -4.848031 -1.578511 -1.946085 1.281856 2.005281 -4.880162 2.119489 -4.811180 -1.422145
info: new grain 46 pks, i 2911 j 4930 UBI -1.022292 4.651823 -2.649398 -1.729644 -2.830743 -4.326429 -5.059999 0.034381 1.978368
info: new grain 55 pks, i 2910 j 4922 UBI -1.248078 5.275554 -0.506347 -3.142017 -1.141157 -4.278232 -4.268458 -0.699627 3.325777
info: new grain 34 pks, i 2906 j 2164 UBI 0.860734 5.147414 -1.575103 -3.781118 -0.525096 -3.854689 -3.802715 1.683545 3.504669
info: new grain 37 pks, i 2872 j 2150 UBI -0.765621 5.206465 -1.378863 -2.769699 -1.581965 -4.433801 -4.633973 0.081807 2.838137
info: new grain 56 pks, i 2852 j 743 UBI -0.101199 4.812741 -2.549815 -2.116008 -2.376144 -4.418815 -5.014712 0.907205 1.901387
info: new grain 35 pks, i 2802 j 3516 UBI 5.416111 0.068946 0.569196 0.357009 3.660389 -4.024241 -0.398189 4.026597 3.631270
info: new grain 60 pks, i 2793 j 770 UBI -0.850030 -4.683325 -2.634322 2.747352 1.922593 -4.282363 4.623172 -1.997773 2.088623
info: new grain 60 pks, i 2780 j 753 UBI 4.540073 1.335676 -2.677651 -2.984114 1.409941 -4.330636 -0.367778 5.084836 1.926971
info: new grain 56 pks, i 2772 j 4895 UBI 4.385857 -1.457437 -2.861976 -2.014953 2.560783 -4.360078 2.517413 4.578007 1.554874
info: new grain 36 pks, i 1520 j 4938 UBI -0.808616 4.675938 -2.673306 1.493136 -2.415781 -4.644427 -5.167273 -1.431974 -0.957194
info: new grain 35 pks, i 153 j 2152 UBI 4.871843 0.779399 -2.294047 -2.339472 2.968657 -3.950039 0.700345 4.513551 2.960577
info: new grain 40 pks, i 151 j 3552 UBI -3.210361 -3.522406 -2.631015 3.664069 -0.328215 -3.998662 2.427204 -4.135414 2.599531
info: Number of orientations with more than 30 peaks is 50
info: Time taken 0.015/s
info: UBI for best fitting
[[-1.23727903 -5.06544128 1.587079 ]
[ 2.98562927 -1.99761699 -4.07760545]
[ 4.38220879 -0.06568907 3.23753729]]
info: Unit cell: (5.450538918695651, 5.4342729009289386, 5.448827088787298, 89.97393032735806, 89.9055524022623, 90.09038766966209)
info: Indexes 76 peaks, with <drlv2>=0.006456
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 2607
info: Tried r1=0 r2=4 attempt 1 of 49, got 50 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: 38
info: Number of peaks in ring 2: 292
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 30
info: Time taken 0.000102 /s
info: Scoring 30 potential orientations
info: new grain 58 pks, i 4925 j 4281 UBI 5.211605 -0.368772 1.514219 -1.524731 -2.454341 4.621925 0.378968 -4.846124 -2.444809
info: new grain 48 pks, i 4907 j 1 UBI 1.423091 -5.250510 0.258810 -2.984660 -0.610071 4.516999 -4.325406 -1.305013 -3.028495
info: new grain 54 pks, i 3545 j 4304 UBI -0.719451 5.182379 1.517554 1.782881 -1.214896 5.005298 5.095335 1.157577 -1.504754
info: Number of orientations with more than 30 peaks is 53
info: Time taken 0.002/s
info: UBI for best fitting
[[-1.23727903 -5.06544128 1.587079 ]
[ 2.98562927 -1.99761699 -4.07760545]
[ 4.38220879 -0.06568907 3.23753729]]
info: Unit cell: (5.450538918695651, 5.4342729009289386, 5.448827088787298, 89.97393032735806, 89.9055524022623, 90.09038766966209)
info: Indexes 76 peaks, with <drlv2>=0.006456
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 2453
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: 276
info: Number of peaks in ring 2: 276
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 205
info: Time taken 0.000628 /s
info: Scoring 205 potential orientations
info: new grain 38 pks, i 4309 j 2849 UBI -1.226240 1.692281 5.031367 1.259982 -4.918818 1.968762 5.150330 1.606117 0.685373
info: new grain 68 pks, i 4307 j 2882 UBI 0.440180 -0.372444 5.413325 -5.207074 1.497460 0.524601 -1.524160 -5.221215 -0.225861
info: new grain 48 pks, i 4303 j 80 UBI 1.315230 0.834675 5.215747 -3.057657 -4.263624 1.454324 4.306573 -3.281768 -0.561334
info: new grain 40 pks, i 4299 j 2840 UBI 5.390366 0.409763 0.684038 -0.694407 0.244055 5.388463 0.361028 -5.431216 0.324930
info: new grain 34 pks, i 4294 j 2890 UBI 1.392085 -1.219944 5.125397 -2.368125 4.585066 1.737706 -4.693127 -2.669311 0.604977
info: new grain 36 pks, i 4275 j 4239 UBI 2.671471 -4.335204 1.938559 -1.704842 1.182823 5.024416 -4.427185 -3.074588 -0.795360
info: new grain 72 pks, i 4272 j 2811 UBI -2.860366 4.613148 0.369690 0.158509 -0.359538 5.430853 4.628948 2.869703 0.072678
info: new grain 35 pks, i 4258 j 155 UBI -3.235042 -4.064185 1.629208 1.727904 0.677290 5.125189 -4.020542 3.557000 0.859144
info: new grain 52 pks, i 4243 j 2895 UBI 4.966078 -1.098559 1.951481 -1.908761 0.320645 5.082802 -1.141414 -5.322287 -0.101311
info: new grain 56 pks, i 4242 j 9 UBI -1.405808 5.096504 1.303647 0.875148 -1.096730 5.259404 5.187089 1.567286 -0.529890
info: new grain 41 pks, i 4237 j 2770 UBI -2.002072 -0.402918 5.038894 3.999282 3.194472 1.843224 -3.100786 4.388202 -0.908778
info: new grain 72 pks, i 4231 j 4164 UBI 1.638327 5.177484 0.441475 5.169596 -1.584887 -0.602904 -0.462155 0.575643 -5.390157
info: new grain 60 pks, i 4226 j 1395 UBI 1.746345 5.085815 0.843738 5.118215 -1.604289 -0.913224 -0.629697 1.082267 -5.299829
info: new grain 56 pks, i 4205 j 4245 UBI -0.263921 5.269239 1.342978 0.738585 -1.289538 5.237817 5.388080 0.441395 -0.638551
info: new grain 60 pks, i 4196 j 129 UBI -2.081999 4.973152 0.781492 0.100504 -0.787814 5.384573 5.028708 2.072477 0.197927
info: new grain 40 pks, i 4170 j 2832 UBI 1.211385 3.705905 3.796114 1.259724 -3.983115 3.470766 5.157043 0.105586 -1.777253
info: new grain 56 pks, i 2912 j 4269 UBI -1.245518 -0.558147 5.267914 5.271374 0.401617 1.312252 -0.522735 5.400359 0.430789
info: new grain 52 pks, i 2907 j 1547 UBI 1.288133 1.378344 5.115539 -2.741595 -4.323253 1.835935 4.524979 -3.006018 -0.308172
info: new grain 58 pks, i 2830 j 22 UBI 3.871785 0.760028 3.722619 -3.751439 1.762477 3.536965 -0.725726 -5.090958 1.805896
info: Number of orientations with more than 30 peaks is 72
info: Time taken 0.006/s
info: UBI for best fitting
[[-1.23727903 -5.06544128 1.587079 ]
[ 2.98562927 -1.99761699 -4.07760545]
[ 4.38220879 -0.06568907 3.23753729]]
info: Unit cell: (5.450538918695651, 5.4342729009289386, 5.448827088787298, 89.97393032735806, 89.9055524022623, 90.09038766966209)
info: Indexes 76 peaks, with <drlv2>=0.006456
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 1381
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, 0, -2), (0, 2, -2), (-2, -2, 0), (2, -2, 0), (-2, 2, 0), (2, 2, 0), (0, -2, 2), (-2, 0, 2), (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: 290
info: Number of peaks in ring 2: 24
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 49
info: Time taken 0.000412 /s
info: Scoring 49 potential orientations
info: new grain 50 pks, i 4536 j 3558 UBI -1.869510 -2.510919 -4.435673 4.784699 0.803395 -2.493780 1.792823 -4.764613 1.941758
info: new grain 56 pks, i 4517 j 776 UBI -0.689072 -2.743962 -4.636847 2.469641 -4.332777 2.199108 -4.802882 -1.834469 1.816724
info: new grain 58 pks, i 4434 j 762 UBI -0.359320 -2.243059 -4.956864 4.191054 3.035046 -1.672735 3.458534 -3.916056 1.506329
info: new grain 33 pks, i 4425 j 2136 UBI -2.973241 -0.171188 -4.567298 -2.590469 -4.419709 1.820996 -3.756771 3.182286 2.335656
info: new grain 35 pks, i 4379 j 737 UBI 2.065612 -1.428824 -4.845573 -0.940887 5.012524 -1.862996 4.948624 1.562093 1.646137
info: new grain 52 pks, i 3015 j 4890 UBI -0.810355 -3.221413 -4.303519 2.835161 3.451343 -3.108484 4.580369 -2.707336 1.205006
info: Number of orientations with more than 30 peaks is 78
info: Time taken 0.001/s
info: UBI for best fitting
[[-1.23727903 -5.06544128 1.587079 ]
[ 2.98562927 -1.99761699 -4.07760545]
[ 4.38220879 -0.06568907 3.23753729]]
info: Unit cell: (5.450538918695651, 5.4342729009289386, 5.448827088787298, 89.97393032735806, 89.9055524022623, 90.09038766966209)
info: Indexes 76 peaks, with <drlv2>=0.006456
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 1051
info: Tried r1=1 r2=4 attempt 4 of 49, got 78 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, 0, -2), (0, 2, -2), (-2, -2, 0), (2, -2, 0), (-2, 2, 0), (2, 2, 0), (0, -2, 2), (-2, 0, 2), (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: 88
info: Number of peaks in ring 2: 248
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 86
info: Time taken 0.000211 /s
info: Scoring 86 potential orientations
info: new grain 58 pks, i 4283 j 4492 UBI 2.092611 5.023220 -0.029070 0.528916 -0.266320 -5.409806 -5.000019 2.074102 -0.618265
info: new grain 37 pks, i 4219 j 217 UBI -1.602039 0.944819 5.106347 -5.092123 -1.387253 -1.358130 1.076972 -5.178898 1.314861
info: new grain 38 pks, i 4217 j 2999 UBI 1.490769 1.313244 5.066167 4.905682 1.511025 -1.865565 -1.852931 5.050567 -0.728041
info: new grain 41 pks, i 4181 j 1604 UBI 4.109711 -2.974079 1.970334 -1.109583 -3.941296 -3.575484 3.373988 2.314562 -3.597349
info: new grain 51 pks, i 4180 j 1603 UBI 3.074367 3.938780 2.152174 3.836728 -0.934950 -3.743372 -2.342596 3.637750 -3.313419
info: new grain 58 pks, i 4179 j 4420 UBI 3.317367 4.281998 -0.527348 0.698015 -1.210460 -5.265888 -4.261431 3.133562 -1.270669
info: new grain 55 pks, i 4168 j 4411 UBI 3.868119 -0.583842 3.771760 3.028468 -2.838511 -3.551222 2.349782 4.607892 -1.665037
info: new grain 49 pks, i 4160 j 203 UBI 1.064464 -1.528155 5.116026 0.477034 -5.169077 -1.665870 5.314979 0.781807 -0.849748
info: new grain 54 pks, i 2841 j 219 UBI 1.249932 -0.177678 5.289705 -2.504842 -4.818255 0.438904 4.670620 -2.536599 -1.214259
info: new grain 48 pks, i 2801 j 1605 UBI -5.023172 2.099764 -0.056889 0.627479 1.392950 -5.217200 -2.005584 -4.826818 -1.560637
info: new grain 46 pks, i 120 j 1715 UBI 3.054907 -3.890252 2.303049 -1.943043 -3.617631 -3.561451 4.068085 1.203737 -3.416580
info: Number of orientations with more than 30 peaks is 89
info: Time taken 0.003/s
info: UBI for best fitting
[[-1.23727903 -5.06544128 1.587079 ]
[ 2.98562927 -1.99761699 -4.07760545]
[ 4.38220879 -0.06568907 3.23753729]]
info: Unit cell: (5.450538918695651, 5.4342729009289386, 5.448827088787298, 89.97393032735806, 89.9055524022623, 90.09038766966209)
info: Indexes 76 peaks, with <drlv2>=0.006456
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 459
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, 0, -2), (0, 2, -2), (-2, -2, 0), (2, -2, 0), (-2, 2, 0), (2, 2, 0), (0, -2, 2), (-2, 0, 2), (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: 124
info: Number of peaks in ring 2: 12
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 13
info: Time taken 0.000204 /s
info: Scoring 13 potential orientations
info: new grain 43 pks, i 4446 j 1525 UBI 3.014623 4.431988 -0.976876 -4.412243 2.607624 -1.849524 -1.030028 1.790666 5.023946
info: Number of orientations with more than 30 peaks is 90
info: Time taken 0.001/s
info: UBI for best fitting
[[-1.23727903 -5.06544128 1.587079 ]
[ 2.98562927 -1.99761699 -4.07760545]
[ 4.38220879 -0.06568907 3.23753729]]
info: Unit cell: (5.450538918695651, 5.4342729009289386, 5.448827088787298, 89.97393032735806, 89.9055524022623, 90.09038766966209)
info: Indexes 76 peaks, with <drlv2>=0.006456
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 415
info: Tried r1=1 r2=0 attempt 6 of 49, got 90 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, 0, -2), (0, 2, -2), (-2, -2, 0), (2, -2, 0), (-2, 2, 0), (2, 2, 0), (0, -2, 2), (-2, 0, 2), (2, 0, 2), (0, 2, 2)]
info: Ring 2: [(0, -2, -2), (-2, 0, -2), (2, 0, -2), (0, 2, -2), (-2, -2, 0), (2, -2, 0), (-2, 2, 0), (2, 2, 0), (0, -2, 2), (-2, 0, 2), (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: 116
info: Number of peaks in ring 2: 116
info: Minimum number of peaks to identify a grain 30
info: Number of trial orientations generated 110
info: Time taken 0.000215 /s
info: Scoring 110 potential orientations
info: new grain 40 pks, i 4508 j 272 UBI 1.756322 3.867625 3.403237 -4.117114 -1.108299 3.366750 3.097239 -3.663638 2.600262
info: new grain 36 pks, i 4506 j 270 UBI 1.600801 4.296678 2.930119 -3.997554 -0.962298 3.549991 3.336184 -3.212421 2.903832
info: new grain 40 pks, i 4486 j 3088 UBI 3.546520 -2.281600 3.467689 -0.068656 4.509824 3.028030 -4.129054 -2.021298 2.906417
info: new grain 34 pks, i 4438 j 199 UBI 3.423305 -2.228194 3.612195 0.058906 4.655611 2.792337 -4.225096 -1.736800 2.967324
info: new grain 37 pks, i 4427 j 227 UBI 1.748892 -3.901165 3.347471 1.991682 3.798085 3.365205 -4.753604 0.157700 2.666965
info: new grain 34 pks, i 4340 j 258 UBI -4.403938 1.557129 2.786628 1.116161 -3.724207 3.798377 3.010850 3.641025 2.729818
info: new grain 34 pks, i 4325 j 4406 UBI 4.186723 1.461296 3.136800 -3.474596 2.176871 3.594008 -0.301155 -4.766155 2.629226
info: new grain 48 pks, i 2974 j 2954 UBI -1.466657 0.998959 5.155404 0.392589 -5.306479 1.116460 5.223519 0.683327 1.348619
info: new grain 31 pks, i 1693 j 367 UBI 0.489471 4.480026 3.082764 -4.622864 -1.259049 2.608937 2.841828 -2.842373 3.646142
info: Number of orientations with more than 30 peaks is 99
info: Time taken 0.004/s
info: UBI for best fitting
[[-1.23727903 -5.06544128 1.587079 ]
[ 2.98562927 -1.99761699 -4.07760545]
[ 4.38220879 -0.06568907 3.23753729]]
info: Unit cell: (5.450538918695651, 5.4342729009289386, 5.448827088787298, 89.97393032735806, 89.9055524022623, 90.09038766966209)
info: Indexes 76 peaks, with <drlv2>=0.006456
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 66
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: 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, -2, -2), (-4, 2, -2), (-2, -2, -4), (-4, -2, 2), (-2, -4, -2), (-2, 2, -4), (-4, 2, 2), (-2, -4, 2), (-2, 4, -2), (-2, -2, 4), (-2, 4, 2), (-2, 2, 4), (2, -2, -4), (2, -4, -2), (2, 2, -4), (2, -4, 2), (2, 4, -2), (4, -2, -2), (2, -2, 4), (2, 4, 2), (4, 2, -2), (2, 2, 4), (4, -2, 2), (4, 2, 2)]
info: Possible angles and cosines between peaks in rings:
info: 19.471221 0.942809
info: 61.874494 0.471405
info: 90.000000 0.000000
info: 118.125506 -0.471405
info: 160.528779 -0.942809
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 30
info: Number of trial orientations generated 2
info: Time taken 0.000029 /s
info: Scoring 2 potential orientations
info: Number of orientations with more than 30 peaks is 99
info: Time taken 0.000/s
info: UBI for best fitting
[[-1.23727903 -5.06544128 1.587079 ]
[ 2.98562927 -1.99761699 -4.07760545]
[ 4.38220879 -0.06568907 3.23753729]]
info: Unit cell: (5.450538918695651, 5.4342729009289386, 5.448827088787298, 89.97393032735806, 89.9055524022623, 90.09038766966209)
info: Indexes 76 peaks, with <drlv2>=0.006456
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 66
info: Tried r1=0 r2=6 attempt 8 of 49, got 99 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-4, -2, -2), (-4, 2, -2), (-2, -2, -4), (-4, -2, 2), (-2, -4, -2), (-2, 2, -4), (-4, 2, 2), (-2, -4, 2), (-2, 4, -2), (-2, -2, 4), (-2, 4, 2), (-2, 2, 4), (2, -2, -4), (2, -4, -2), (2, 2, -4), (2, -4, 2), (2, 4, -2), (4, -2, -2), (2, -2, 4), (2, 4, 2), (4, 2, -2), (2, 2, 4), (4, -2, 2), (4, 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: 19.471221 0.942809
info: 61.874494 0.471405
info: 90.000000 0.000000
info: 118.125506 -0.471405
info: 160.528779 -0.942809
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 30
info: Number of trial orientations generated 3
info: Time taken 0.000028 /s
info: Scoring 3 potential orientations
info: Number of orientations with more than 30 peaks is 99
info: Time taken 0.000/s
info: UBI for best fitting
[[-1.23727903 -5.06544128 1.587079 ]
[ 2.98562927 -1.99761699 -4.07760545]
[ 4.38220879 -0.06568907 3.23753729]]
info: Unit cell: (5.450538918695651, 5.4342729009289386, 5.448827088787298, 89.97393032735806, 89.9055524022623, 90.09038766966209)
info: Indexes 76 peaks, with <drlv2>=0.006456
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 66
info: Tried r1=6 r2=0 attempt 9 of 49, got 99 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, -3, -3), (1, -3, -3), (-3, -3, -1), (-3, -3, 1), (3, -3, -1), (3, -3, 1), (-1, -3, 3), (1, -3, 3), (-3, -1, -3), (3, -1, -3), (-3, -1, 3), (-3, 1, -3), (3, -1, 3), (3, 1, -3), (-3, 1, 3), (3, 1, 3), (-1, 3, -3), (1, 3, -3), (-3, 3, -1), (-3, 3, 1), (3, 3, -1), (3, 3, 1), (-1, 3, 3), (1, 3, 3)]
info: Possible angles and cosines between peaks in rings:
info: 22.001714 0.927173
info: 48.527066 0.662266
info: 82.388621 0.132453
info: 97.611379 -0.132453
info: 131.472934 -0.662266
info: 157.998286 -0.927173
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 30
info: Number of trial orientations generated 8
info: Time taken 0.000030 /s
info: Scoring 8 potential orientations
info: new grain 43 pks, i 2790 j 3681 UBI -4.519967 2.429517 1.768037 -0.634786 -3.938916 3.721959 2.960777 2.863779 3.558657
info: Number of orientations with more than 30 peaks is 100
info: Time taken 0.001/s
info: UBI for best fitting
[[-1.23727903 -5.06544128 1.587079 ]
[ 2.98562927 -1.99761699 -4.07760545]
[ 4.38220879 -0.06568907 3.23753729]]
info: Unit cell: (5.450538918695651, 5.4342729009289386, 5.448827088787298, 89.97393032735806, 89.9055524022623, 90.09038766966209)
info: Indexes 76 peaks, with <drlv2>=0.006456
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 12
info: Tried r1=0 r2=5 attempt 10 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: 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: [(-4, -2, -2), (-4, 2, -2), (-2, -2, -4), (-4, -2, 2), (-2, -4, -2), (-2, 2, -4), (-4, 2, 2), (-2, -4, 2), (-2, 4, -2), (-2, -2, 4), (-2, 4, 2), (-2, 2, 4), (2, -2, -4), (2, -4, -2), (2, 2, -4), (2, -4, 2), (2, 4, -2), (4, -2, -2), (2, -2, 4), (2, 4, 2), (4, 2, -2), (2, 2, 4), (4, -2, 2), (4, 2, 2)]
info: Ring 2: [(-4, -2, -2), (-4, 2, -2), (-2, -2, -4), (-4, -2, 2), (-2, -4, -2), (-2, 2, -4), (-4, 2, 2), (-2, -4, 2), (-2, 4, -2), (-2, -2, 4), (-2, 4, 2), (-2, 2, 4), (2, -2, -4), (2, -4, -2), (2, 2, -4), (2, -4, 2), (2, 4, -2), (4, -2, -2), (2, -2, 4), (2, 4, 2), (4, 2, -2), (2, 2, 4), (4, -2, 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: 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.000023 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -3, -3), (1, -3, -3), (-3, -3, -1), (-3, -3, 1), (3, -3, -1), (3, -3, 1), (-1, -3, 3), (1, -3, 3), (-3, -1, -3), (3, -1, -3), (-3, -1, 3), (-3, 1, -3), (3, -1, 3), (3, 1, -3), (-3, 1, 3), (3, 1, 3), (-1, 3, -3), (1, 3, -3), (-3, 3, -1), (-3, 3, 1), (3, 3, -1), (3, 3, 1), (-1, 3, 3), (1, 3, 3)]
info: Ring 2: [(-4, -2, -2), (-4, 2, -2), (-2, -2, -4), (-4, -2, 2), (-2, -4, -2), (-2, 2, -4), (-4, 2, 2), (-2, -4, 2), (-2, 4, -2), (-2, -2, 4), (-2, 4, 2), (-2, 2, 4), (2, -2, -4), (2, -4, -2), (2, 2, -4), (2, -4, 2), (2, 4, -2), (4, -2, -2), (2, -2, 4), (2, 4, 2), (4, 2, -2), (2, 2, 4), (4, -2, 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: 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 1
info: Time taken 0.000026 /s
info: Scoring 1 potential orientations
info: Number of orientations with more than 30 peaks is 100
info: Time taken 0.000/s
info: UBI for best fitting
[[-1.23727903 -5.06544128 1.587079 ]
[ 2.98562927 -1.99761699 -4.07760545]
[ 4.38220879 -0.06568907 3.23753729]]
info: Unit cell: (5.450538918695651, 5.4342729009289386, 5.448827088787298, 89.97393032735806, 89.9055524022623, 90.09038766966209)
info: Indexes 76 peaks, with <drlv2>=0.006456
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 12
info: Tried r1=5 r2=6 attempt 11 of 49, got 100 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-4, -2, -2), (-4, 2, -2), (-2, -2, -4), (-4, -2, 2), (-2, -4, -2), (-2, 2, -4), (-4, 2, 2), (-2, -4, 2), (-2, 4, -2), (-2, -2, 4), (-2, 4, 2), (-2, 2, 4), (2, -2, -4), (2, -4, -2), (2, 2, -4), (2, -4, 2), (2, 4, -2), (4, -2, -2), (2, -2, 4), (2, 4, 2), (4, 2, -2), (2, 2, 4), (4, -2, 2), (4, 2, 2)]
info: Ring 2: [(-1, -3, -3), (1, -3, -3), (-3, -3, -1), (-3, -3, 1), (3, -3, -1), (3, -3, 1), (-1, -3, 3), (1, -3, 3), (-3, -1, -3), (3, -1, -3), (-3, -1, 3), (-3, 1, -3), (3, -1, 3), (3, 1, -3), (-3, 1, 3), (3, 1, 3), (-1, 3, -3), (1, 3, -3), (-3, 3, -1), (-3, 3, 1), (3, 3, -1), (3, 3, 1), (-1, 3, 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: 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.000024 /s
info: Scoring 2 potential orientations
info: Number of orientations with more than 30 peaks is 100
info: Time taken 0.001/s
info: UBI for best fitting
[[-1.23727903 -5.06544128 1.587079 ]
[ 2.98562927 -1.99761699 -4.07760545]
[ 4.38220879 -0.06568907 3.23753729]]
info: Unit cell: (5.450538918695651, 5.4342729009289386, 5.448827088787298, 89.97393032735806, 89.9055524022623, 90.09038766966209)
info: Indexes 76 peaks, with <drlv2>=0.006456
info: That was the best thing I found so far
info: Number of peaks assigned to rings but not indexed = 12
info: Tried r1=6 r2=5 attempt 12 of 49, got 100 grains
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -3, -3), (1, -3, -3), (-3, -3, -1), (-3, -3, 1), (3, -3, -1), (3, -3, 1), (-1, -3, 3), (1, -3, 3), (-3, -1, -3), (3, -1, -3), (-3, -1, 3), (-3, 1, -3), (3, -1, 3), (3, 1, -3), (-3, 1, 3), (3, 1, 3), (-1, 3, -3), (1, 3, -3), (-3, 3, -1), (-3, 3, 1), (3, 3, -1), (3, 3, 1), (-1, 3, 3), (1, 3, 3)]
info: Ring 2: [(-1, -3, -3), (1, -3, -3), (-3, -3, -1), (-3, -3, 1), (3, -3, -1), (3, -3, 1), (-1, -3, 3), (1, -3, 3), (-3, -1, -3), (3, -1, -3), (-3, -1, 3), (-3, 1, -3), (3, -1, 3), (3, 1, -3), (-3, 1, 3), (3, 1, 3), (-1, 3, -3), (1, 3, -3), (-3, 3, -1), (-3, 3, 1), (3, 3, -1), (3, 3, 1), (-1, 3, 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: 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.000021 /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: [(-4, -2, -2), (-4, 2, -2), (-2, -2, -4), (-4, -2, 2), (-2, -4, -2), (-2, 2, -4), (-4, 2, 2), (-2, -4, 2), (-2, 4, -2), (-2, -2, 4), (-2, 4, 2), (-2, 2, 4), (2, -2, -4), (2, -4, -2), (2, 2, -4), (2, -4, 2), (2, 4, -2), (4, -2, -2), (2, -2, 4), (2, 4, 2), (4, 2, -2), (2, 2, 4), (4, -2, 2), (4, 2, 2)]
info: Ring 2: [(-1, -5, -1), (-1, -1, -5), (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), (-5, 1, 1), (5, -1, -1), (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, 1, 5), (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: 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.000025 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -5, -1), (-1, -1, -5), (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), (-5, 1, 1), (5, -1, -1), (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, 1, 5), (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), (-4, 2, -2), (-2, -2, -4), (-4, -2, 2), (-2, -4, -2), (-2, 2, -4), (-4, 2, 2), (-2, -4, 2), (-2, 4, -2), (-2, -2, 4), (-2, 4, 2), (-2, 2, 4), (2, -2, -4), (2, -4, -2), (2, 2, -4), (2, -4, 2), (2, 4, -2), (4, -2, -2), (2, -2, 4), (2, 4, 2), (4, 2, -2), (2, 2, 4), (4, -2, 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: 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.000025 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -3, -3), (1, -3, -3), (-3, -3, -1), (-3, -3, 1), (3, -3, -1), (3, -3, 1), (-1, -3, 3), (1, -3, 3), (-3, -1, -3), (3, -1, -3), (-3, -1, 3), (-3, 1, -3), (3, -1, 3), (3, 1, -3), (-3, 1, 3), (3, 1, 3), (-1, 3, -3), (1, 3, -3), (-3, 3, -1), (-3, 3, 1), (3, 3, -1), (3, 3, 1), (-1, 3, 3), (1, 3, 3)]
info: Ring 2: [(-1, -5, -1), (-1, -1, -5), (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), (-5, 1, 1), (5, -1, -1), (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, 1, 5), (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: 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.000019 /s
info: hkls of rings being used for indexing
info: Ring 1: [(-1, -5, -1), (-1, -1, -5), (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), (-5, 1, 1), (5, -1, -1), (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, 1, 5), (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), (1, -3, -3), (-3, -3, -1), (-3, -3, 1), (3, -3, -1), (3, -3, 1), (-1, -3, 3), (1, -3, 3), (-3, -1, -3), (3, -1, -3), (-3, -1, 3), (-3, 1, -3), (3, -1, 3), (3, 1, -3), (-3, 1, 3), (3, 1, 3), (-1, 3, -3), (1, 3, -3), (-3, 3, -1), (-3, 3, 1), (3, 3, -1), (3, 3, 1), (-1, 3, 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: 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.000024 /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, -1, -5), (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), (-5, 1, 1), (5, -1, -1), (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, 1, 5), (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, -1, -5), (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), (-5, 1, 1), (5, -1, -1), (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, 1, 5), (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.000026 /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 3.51 s, sys: 47.1 ms, total: 3.55 s
Wall time: 1.62 s
[24]:
Array([[[ 0.75081234, 4.69069977, -2.65953794],
[-3.01894079, -1.85777977, -4.13166811],
[-4.46806786, 2.04671423, 2.34443379]],
[[-5.16905191, -1.43218674, -0.92969206],
[ 1.50475601, -2.4185368 , -4.6383473 ],
[ 0.80844225, -4.66130301, 2.69290728]],
[[ 2.82409376, 4.43655021, 1.40255304],
[-1.61629826, 2.47431493, -4.57080733],
[-4.36178623, 1.9570719 , 2.60151707]],
[[ 0.06512135, 5.35335389, 0.98609018],
[-2.16534023, 0.93180485, -4.9064775 ],
[-4.99336708, -0.33385498, 2.1414745 ]],
[[ 1.67631365, -5.16758576, 0.34528744],
[ 2.42231209, 0.46395943, -4.85303843],
[ 4.57783171, 1.64841631, 2.44187146]],
[[ 4.51592176, 0.43220752, -3.00809543],
[-2.72091 , -1.82495638, -4.34708231],
[-1.35266078, 5.10973848, -1.29740568]],
[[ 4.68950228, 2.73512448, -0.39809164],
[-1.88349721, 2.58796281, -4.40326952],
[-2.02184192, 3.93075438, 3.17563184]],
[[-2.06109321, -4.21350601, -2.76293417],
[-0.78120799, 3.21615618, -4.32221036],
[ 4.97863849, -1.24037081, -1.82208388]],
[[-3.35061039, 4.05317382, -1.41230638],
[-0.53579289, -2.17464624, -4.96221558],
[-4.25660175, -2.91416394, 1.73580086]],
[[ 5.28333873, 0.33761703, 1.26407679],
[ 1.05573617, 2.01191769, -4.94707784],
[-0.77436096, 5.04732411, 1.88765267]],
[[-4.85813677, 0.98343078, -2.25015856],
[ 2.41611135, 1.01418541, -4.77147686],
[-0.44214307, -5.25731922, -1.34160786]],
[[-5.07204971, 0.27494988, -1.95837852],
[ 1.96694923, 1.2597183 , -4.91735059],
[ 0.20335468, -5.28856356, -1.27060755]],
[[ 4.17237631, -3.0283529 , -1.74876542],
[ 0.13754842, 2.86030961, -4.63038949],
[ 3.49607809, 3.50378263, 2.26736587]],
[[ 5.40633549, -0.23901838, 0.57975846],
[ 0.596402 , 3.51136423, -4.11730622],
[-0.19410035, 4.15415364, 3.51350307]],
[[ 2.69952605, -3.50927367, -3.16668252],
[-2.78777541, 1.76360545, -4.33107438],
[ 3.81822471, 3.76818161, -0.92254784]],
[[ 3.48499008, 4.05387766, 1.02633293],
[-1.16394671, 2.22279637, -4.83102821],
[-4.0173363 , 2.87445349, 2.28882029]],
[[-3.91078423, -3.76398351, 0.40027605],
[ 2.09586845, -2.63355842, -4.27946121],
[ 3.15347187, -2.92001973, 3.34123177]],
[[-0.5727514 , -4.93932658, -2.21465875],
[ 3.37481569, 1.41571872, -4.02979324],
[ 4.23347847, -1.79636486, 2.91258916]],
[[-4.23968635, -1.34187262, -3.14069907],
[ 2.33040443, 2.5232015 , -4.22416982],
[ 2.49743338, -4.63338315, -1.39178918]],
[[-3.63122333, -2.98855038, -2.74111266],
[ 2.09684175, 1.76503059, -4.70287299],
[ 3.47132694, -4.19391102, -0.0263311 ]],
[[ 2.77793694, 4.58869742, -0.93025192],
[-3.27652551, 1.13333174, -4.19662359],
[-3.34393038, 2.70175395, 3.33980575]],
[[ 3.76150876, -3.91869086, 0.35208511],
[ 2.14679108, 1.63370487, -4.727609 ],
[ 3.29825846, 3.40559315, 2.67513745]],
[[ 5.09966953, 0.27527875, -1.88242091],
[-1.83716998, 2.1124095 , -4.66783028],
[ 0.49619516, 5.00978057, 2.07375251]],
[[ 2.66640066, -4.74256546, 0.20925592],
[ 2.52398409, 1.21399529, -4.66822135],
[ 4.01862816, 2.38230121, 2.79372557]],
[[-3.06231948, 2.62298265, -3.65773827],
[ 1.73988937, -3.39086658, -3.88675607],
[-4.15054532, -3.35598005, 1.06926397]],
[[ 3.96539341, -2.848379 , -2.40827831],
[-2.44978072, 0.66006433, -4.81600963],
[ 2.81174854, 4.59215636, -0.80124422]],
[[-1.23615902, -5.06307598, 1.57316936],
[ 2.98695318, -2.00045369, -4.0883537 ],
[ 4.38082551, -0.06420108, 3.23172151]],
[[-3.01394432, 2.88032179, -3.50216003],
[ 1.02816549, -3.65996113, -3.89530853],
[-4.41693568, -2.81744295, 1.48171502]],
[[ 0.91285602, 5.10727311, 1.64493312],
[-2.80697596, 1.87797646, -4.26943169],
[-4.57318553, -0.13079084, 2.94832389]],
[[ 5.42708945, 0.40105146, 0.1217865 ],
[-0.08850061, 2.62923428, -4.76517449],
[-0.41032174, 4.74984117, 2.62863339]],
[[ 3.19664198, -4.25005248, 1.1603588 ],
[ 2.70332884, 0.75898931, -4.66406403],
[ 3.47880488, 3.31480303, 2.55630049]],
[[ 4.37718549, -0.82464321, -3.13141227],
[-3.20727606, -1.81883947, -4.00548161],
[-0.43993425, 5.06480418, -1.94750096]],
[[-0.26855133, -5.2402562 , 1.45114615],
[ 1.97851755, -1.44741905, -4.86075258],
[ 5.06338683, 0.28637623, 1.9756807 ]],
[[ 5.17223566, -1.14843897, 1.25307369],
[ 1.59195815, 1.88379794, -4.85255827],
[ 0.59183944, 4.97843616, 2.1251802 ]],
[[ 2.42074048, 4.07501394, -2.67836732],
[-3.64535457, -0.47271289, -4.01536567],
[-3.23817843, 3.57874551, 2.51775787]],
[[ 2.02337037, -4.85487584, 1.40507337],
[ 3.23707075, 0.08374641, -4.37584617],
[ 3.88104648, 2.46094034, 2.9180912 ]],
[[-1.73292444, 3.99895158, -3.26260229],
[ 3.19084769, -1.87458429, -3.99203819],
[-4.05617028, -3.18213621, -1.74659836]],
[[-4.84466669, -1.57443465, -1.91684658],
[ 1.28391636, 2.00731674, -4.8941993 ],
[ 2.12313771, -4.80904514, -1.41502054]],
[[ 3.81499956, -1.67190348, -3.50418141],
[-3.78979472, -0.52976125, -3.87251307],
[ 0.84719384, 5.15364385, -1.53495353]],
[[ 4.8656462 , 0.76858846, -2.31751338],
[-2.33759738, 2.95318855, -3.9299459 ],
[ 0.70527343, 4.50826167, 2.9686517 ]],
[[-3.20754651, -3.5186862 , -2.63992334],
[ 3.66824822, -0.33774252, -4.0072821 ],
[ 2.42636941, -4.14055945, 2.56966634]],
[[-1.02125037, 4.64656125, -2.64655099],
[-1.7257076 , -2.83689493, -4.31379886],
[-5.0614515 , 0.03215047, 2.00552703]],
[[-1.24706833, 5.27397654, -0.49521013],
[-3.14359431, -1.14537763, -4.2931678 ],
[-4.26554489, -0.69629562, 3.30873174]],
[[-0.75288556, 5.20553068, -1.40066287],
[-2.76313606, -1.58666271, -4.41400623],
[-4.63070667, 0.10062751, 2.86103464]],
[[-0.09886471, 4.81180084, -2.54306625],
[-2.11419809, -2.37838849, -4.41706559],
[-5.01436382, 0.90681429, 1.91174763]],
[[ 5.41753355, 0.05333641, 0.53602895],
[ 0.36160609, 3.66243443, -4.01108962],
[-0.39831994, 4.02750721, 3.64150759]],
[[-0.84753464, -4.6853555 , -2.63953749],
[ 2.74963728, 1.91925052, -4.28862184],
[ 4.62132049, -1.99992055, 2.06821384]],
[[ 4.54119042, 1.33761874, -2.68814147],
[-2.98057861, 1.4151254 , -4.33057635],
[-0.36644817, 5.08243467, 1.9114549 ]],
[[ 4.38827044, -1.45436602, -2.87369363],
[-2.00797106, 2.56235236, -4.36311944],
[ 2.51861191, 4.57689157, 1.52804409]],
[[ 5.21237616, -0.36756219, 1.52588928],
[-1.52364461, -2.45254446, 4.61465525],
[ 0.37611225, -4.84664501, -2.45131698]],
[[ 1.42676216, -5.24955349, 0.23494963],
[-2.98408417, -0.60877263, 4.51261762],
[-4.32405336, -1.30927 , -3.03581955]],
[[ 4.56858194, 0.53234528, 2.91177966],
[-2.82562062, -0.81136224, 4.5807017 ],
[ 0.88128909, -5.356834 , -0.40466405]],
[[ 0.44062988, -0.37016558, 5.41317964],
[-5.20730908, 1.49754974, 0.52653113],
[-1.52503751, -5.22120777, -0.23294319]],
[[ 1.31549138, 0.83481121, 5.21592757],
[-3.05711091, -4.26286659, 1.45313136],
[ 4.306744 , -3.28118279, -0.56078242]],
[[ 1.72535147, 0.67429176, 5.11825581],
[-3.23676982, -4.06245516, 1.62794499],
[ 4.02280418, -3.5594438 , -0.88587398]],
[[ 5.3866811 , 0.40851572, 0.67556664],
[-0.69426283, 0.23676564, 5.39407581],
[ 0.37565463, -5.42327879, 0.28684167]],
[[ 1.39201703, -1.2244555 , 5.11830238],
[-2.36852549, 4.58191493, 1.74073821],
[-4.69994029, -2.67140912, 0.63923573]],
[[-2.86382995, 4.61282752, 0.38689071],
[ 0.15224421, -0.35960956, 5.43002978],
[ 4.62603782, 2.86710453, 0.06023286]],
[[ 4.96615913, -1.0988065 , 1.93818324],
[-1.91258869, 0.32066706, 5.08566748],
[-1.14133531, -5.32234867, -0.09257704]],
[[-1.40624709, 5.09623384, 1.29749356],
[ 0.87416447, -1.09787637, 5.26005366],
[ 5.18686089, 1.56756673, -0.53478325]],
[[-1.99889797, -0.39845413, 5.04760804],
[ 4.00294624, 3.20150272, 1.8379512 ],
[-3.10061324, 4.38537934, -0.88134276]],
[[ 1.63583412, 5.17530861, 0.41427741],
[ 5.17045285, -1.58672774, -0.61096815],
[-0.46113001, 0.57654052, -5.39345656]],
[[ 1.74302919, 5.08932077, 0.83365732],
[ 5.11917287, -1.60165176, -0.93236335],
[-0.6267086 , 1.08306679, -5.29834042]],
[[-0.48086367, 5.16679105, 1.64462851],
[ 1.0634122 , -1.53025394, 5.11481949],
[ 5.31672735, 0.77434149, -0.8742265 ]],
[[-2.07958609, 4.9712169 , 0.76934228],
[ 0.10343205, -0.78884979, 5.38528906],
[ 5.03034722, 2.07334027, 0.20739436]],
[[ 1.21028217, 3.69866241, 3.80683104],
[ 1.26080463, -3.99284044, 3.47831748],
[ 5.15500334, 0.10888171, -1.744577 ]],
[[ 1.25711069, -4.9166139 , 1.97213076],
[-1.22792391, 1.70158008, 5.02317688],
[-5.1513895 , -1.60518751, -0.71633523]],
[[ 3.88030505, 0.75972128, 3.7414692 ],
[-3.74906358, 1.76242883, 3.53233433],
[-0.71862879, -5.09493231, 1.77853947]],
[[-1.87560462, -2.50556463, -4.45291641],
[ 4.78240659, 0.80747319, -2.47109445],
[ 1.79939882, -4.76700632, 1.9216486 ]],
[[-1.77553944, 1.21490817, -5.00073289],
[ 0.71942732, -5.1807761 , -1.5146605 ],
[-5.09527816, -1.1548962 , 1.52894446]],
[[-0.69180273, -2.74458956, -4.65035784],
[ 2.47040746, -4.32933666, 2.18829302],
[-4.80162286, -1.83303996, 1.795609 ]],
[[-0.35851175, -2.2434072 , -4.94789528],
[ 4.19067676, 3.03986366, -1.68183359],
[ 3.45657283, -3.91900192, 1.52725737]],
[[-2.96543466, -0.16615183, -4.56337347],
[-2.60012402, -4.41073166, 1.84916859],
[-3.75237822, 3.18708417, 2.32186326]],
[[ 2.07568917, -1.42101091, -4.8277053 ],
[-0.94359536, 5.01996081, -1.88262954],
[ 4.9432282 , 1.55467752, 1.66660201]],
[[-0.80843763, -3.22488049, -4.31059015],
[ 2.83848406, 3.44865796, -3.11217349],
[ 4.57329576, -2.7099551 , 1.16880007]],
[[ 1.28045823, 1.37669964, 5.10887263],
[ 4.5276154 , -3.00521334, -0.32461872],
[ 2.73863865, 4.32548084, -1.85276384]],
[[-0.52421851, 5.40053745, 0.44448817],
[ 1.24959426, 0.55547803, -5.26962622],
[-5.27093866, -0.40513074, -1.29237842]],
[[ 2.09161772, 5.0250715 , -0.04272693],
[ 0.5304846 , -0.2669295 , -5.4111737 ],
[-4.99730791, 2.0743592 , -0.59216497]],
[[-4.42637896, -3.07259712, -0.77408644],
[-2.67309967, 4.33566115, -1.92255056],
[ 1.7021603 , -1.18256745, -5.03372513]],
[[ 0.73584706, -1.29048182, 5.23690412],
[ 0.26953099, -5.26947515, -1.33760472],
[ 5.3878832 , 0.44100614, -0.64855578]],
[[-0.69965194, 1.20756203, 5.26131942],
[ 3.31582286, 4.28461897, -0.54264856],
[-4.26098473, 3.13371338, -1.28684051]],
[[-1.60972923, 0.94344563, 5.11451059],
[-5.09095611, -1.38562929, -1.34627826],
[ 1.06866615, -5.17827653, 1.29155827]],
[[ 1.49924501, 1.31140355, 5.06651611],
[ 4.89619435, 1.51119186, -1.84001757],
[-1.84721665, 5.06220105, -0.7639026 ]],
[[-5.02276717, 2.10008168, -0.04264185],
[ 0.6293074 , 1.39803473, -5.22234078],
[-2.00535535, -4.82281461, -1.53312259]],
[[-3.37482873, -2.31972691, 3.58724476],
[-4.12357328, 2.96048167, -1.96698465],
[-1.11224702, -3.93758092, -3.5924997 ]],
[[ 3.07320613, 3.93990109, 2.1586993 ],
[ 3.83542762, -0.93600804, -3.74759775],
[-2.34182759, 3.63622629, -3.30557729]],
[[-3.02707958, 2.83052972, 3.53167331],
[ 2.34915022, 4.6128691 , -1.68175923],
[-3.8670973 , 0.58869583, -3.78601065]],
[[ 3.05494873, -3.88744876, 2.27944197],
[-1.94219889, -3.62171036, -3.57152181],
[ 4.06651547, 1.19204994, -3.4188441 ]],
[[ 1.25063238, -0.17594674, 5.29393894],
[-2.50486735, -4.81604778, 0.42861058],
[ 4.66952819, -2.53437183, -1.18863139]],
[[ 4.52116824, -2.43269848, -1.81341383],
[ 2.96661432, 2.86244018, 3.55659526],
[-0.63528597, -3.94109346, 3.70180312]],
[[-4.41545155, 2.60562252, -1.82994589],
[ 1.02624699, -1.79540464, -5.03506558],
[-3.01334306, -4.43017516, 0.96453663]],
[[ 1.751129 , 3.86981688, 3.40591424],
[-4.12084567, -1.10828814, 3.37838081],
[ 3.09573547, -3.66343426, 2.57386473]],
[[ 1.58727238, 4.29503775, 2.94490062],
[-3.99816324, -0.96404329, 3.56350629],
[ 3.33266666, -3.20454601, 2.87305994]],
[[ 3.53804055, -2.27851761, 3.45245793],
[-0.06273402, 4.51411436, 3.04191752],
[-4.1355555 , -2.01836567, 2.90716139]],
[[ 3.4216158 , -2.22886898, 3.59723612],
[ 0.06504483, 4.65556431, 2.82133563],
[-4.23336642, -1.72907287, 2.95483681]],
[[ 1.75131318, -3.90246414, 3.36583516],
[ 1.99620125, 3.79071859, 3.3576124 ],
[-4.75153277, 0.1547221 , 2.65076004]],
[[-4.40079862, 1.54403295, 2.80759155],
[ 1.11767718, -3.72970988, 3.80328197],
[ 3.00358777, 3.65142784, 2.69862171]],
[[ 4.18347874, 1.4681009 , 3.1586717 ],
[-3.47144791, 2.16222177, 3.59216105],
[-0.28735655, -4.77586105, 2.59841716]],
[[-1.45607061, 1.00111996, 5.14817982],
[ 0.39427716, -5.30730839, 1.14388293],
[ 5.23056857, 0.67940958, 1.347692 ]],
[[ 2.83840121, -2.84520262, 3.67055853],
[-0.50191685, -4.46539008, -3.07424232],
[ 4.61779454, 1.2623311 , -2.58969557]]], 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 174 ms, sys: 2.5 ms, total: 176 ms
Wall time: 130 ms
[26]:
Array([[[ 0.75209188, 4.68920058, -2.6591028 ],
[-3.01861465, -1.85884347, -4.13068406],
[-4.46745495, 2.04517925, 2.34575613]],
[[ 2.82520803, 4.43753458, 1.40246413],
[-1.61598887, 2.47489475, -4.57239259],
[-4.36267985, 1.95718148, 2.60099625]],
[[ 4.01602434, -2.87384586, -2.29016209],
[-1.16285906, 2.22258454, -4.83097687],
[ 3.48563464, 4.05399679, 1.02480824]],
[[ 0.06641132, 5.35175743, 0.986882 ],
[-2.1660394 , 0.93123166, -4.90686847],
[-4.99438402, -0.33489615, 2.141051 ]],
[[ 1.67719497, -5.16862249, 0.34476174],
[ 2.42219755, 0.4618484 , -4.85331228],
[ 4.57757779, 1.64678397, 2.44167479]],
[[ 4.51624694, 0.43290498, -3.00805271],
[-2.72066383, -1.82491382, -4.34722308],
[-1.35387336, 5.11074186, -1.29800038]],
[[ 4.6909131 , 2.73403659, -0.39877427],
[-1.88354804, 2.58958829, -4.40473481],
[-2.02169073, 3.93190484, 3.17589558]],
[[-2.0604202 , -4.21337682, -2.76260839],
[-0.78133774, 3.215759 , -4.32219173],
[ 4.97767196, -1.24084811, -1.82265352]],
[[-3.35059642, 4.05169609, -1.41254262],
[-0.53557587, -2.17491149, -4.96225152],
[-4.25617608, -2.91513522, 1.73536704]],
[[ 5.28316597, 0.33663964, 1.26404052],
[ 1.05482964, 2.01102298, -4.94653739],
[-0.7759568 , 5.04630444, 1.88706587]],
[[-4.85857006, 0.983001 , -2.25062906],
[ 2.41593548, 1.01440887, -4.77194163],
[-0.44323949, -5.25700041, -1.34287473]],
[[-5.07118836, 0.2753255 , -1.95853193],
[ 1.96690695, 1.25837194, -4.91652814],
[ 0.20430815, -5.28856448, -1.27152819]],
[[ 5.40855188, -0.23818806, 0.5803248 ],
[ 0.59598063, 3.51133417, -4.11722603],
[-0.19448591, 4.15221357, 3.51436361]],
[[ 2.69845221, -3.5100567 , -3.16675007],
[-2.78648242, 1.76306499, -4.3298382 ],
[ 3.81855119, 3.76927525, -0.92262142]],
[[-3.91044094, -3.76599709, 0.40063176],
[ 2.09639104, -2.63429396, -4.28032186],
[ 3.15333264, -2.91989683, 3.34053776]],
[[-3.29841288, -3.40588613, -2.67397627],
[ 2.14685917, 1.63389952, -4.72854097],
[ 3.76201682, -3.91951476, 0.35284271]],
[[-0.5720881 , -4.9399609 , -2.21514144],
[ 3.37468545, 1.41574176, -4.03038191],
[ 4.23449838, -1.79733748, 2.91162215]],
[[-4.23953483, -1.34183426, -3.14159657],
[ 2.32959684, 2.52379002, -4.22341101],
[ 2.49648753, -4.63376864, -1.39094383]],
[[-3.6320168 , -2.98835375, -2.74014466],
[ 2.09720306, 1.76540947, -4.70296885],
[ 3.47030213, -4.19340373, -0.02573491]],
[[ 2.77864246, 4.5878695 , -0.92995128],
[-3.27646373, 1.13289707, -4.19654724],
[-3.34496385, 2.70089625, 3.33997787]],
[[ 2.51982877, 4.57652921, 1.52990699],
[-2.0068593 , 2.56229467, -4.36259134],
[-4.38821325, 1.45571072, 2.87479578]],
[[ 5.09975221, 0.27483087, -1.88308904],
[-1.83714697, 2.11315663, -4.6673766 ],
[ 0.49657386, 5.00916439, 2.07275379]],
[[ 0.88014043, -5.35722282, -0.40423989],
[ 2.82588816, 0.81059308, -4.58172936],
[ 4.56897445, 0.53144404, 2.91190632]],
[[ 2.66735545, -4.74229328, 0.20842699],
[ 2.5245215 , 1.21459623, -4.66756877],
[ 4.01951751, 2.38190293, 2.79432252]],
[[-3.06226569, 2.62313652, -3.65767155],
[ 1.73991486, -3.39074964, -3.88757324],
[-4.1506056 , -3.35540632, 1.06922004]],
[[ 3.96531979, -2.84832872, -2.40850734],
[-2.45006916, 0.66069762, -4.81586466],
[ 2.8138164 , 4.59229205, -0.80029641]],
[[-1.23490476, -5.06361639, 1.57369309],
[ 2.98621788, -1.99986845, -4.08722196],
[ 4.37940478, -0.06505197, 3.23192781]],
[[-3.01343528, 2.88078486, -3.50241408],
[ 1.02840502, -3.65996959, -3.89501 ],
[-4.41453716, -2.81837758, 1.48172936]],
[[ 0.91513485, 5.10893963, 1.64612491],
[-2.8068215 , 1.87795149, -4.26925818],
[-4.574128 , -0.13127371, 2.94912839]],
[[ 5.4278289 , 0.40211736, 0.119954 ],
[-0.08878445, 2.62928172, -4.76510298],
[-0.41087641, 4.74922848, 2.62905927]],
[[ 3.19604339, -4.2496149 , 1.16028255],
[ 2.70354016, 0.75985289, -4.66438204],
[ 3.48014858, 3.31614276, 2.55646088]],
[[ 4.37645706, -0.82406354, -3.13065213],
[-3.20713192, -1.81876467, -4.00470374],
[-0.44010736, 5.06423168, -1.94832553]],
[[-3.4962877 , -3.50317834, -2.26755081],
[ 0.13721241, 2.85975538, -4.6294336 ],
[ 4.1718777 , -3.02948161, -1.74799078]],
[[-0.26820848, -5.23996721, 1.45019725],
[ 1.97841489, -1.44633788, -4.86021286],
[ 5.06321091, 0.28770502, 1.97644162]],
[[ 5.17128307, -1.1475008 , 1.25096901],
[ 1.59188142, 1.882964 , -4.85261098],
[ 0.59125684, 4.97617465, 2.12514508]],
[[ 2.42005566, 4.0745524 , -2.67750462],
[-3.64603574, -0.47452385, -4.01481573],
[-3.23888737, 3.5774497 , 2.51884029]],
[[ 2.02511658, -4.85514784, 1.40308067],
[ 3.23690976, 0.08394442, -4.37610627],
[ 3.88072834, 2.46014042, 2.91770206]],
[[-1.73287094, 3.99880831, -3.26157304],
[ 3.1908801 , -1.8735487 , -3.99220073],
[-4.05480014, -3.18417767, -1.74755538]],
[[-4.84584556, -1.57467955, -1.9184983 ],
[ 1.28434398, 2.00673713, -4.89393608],
[ 2.12271546, -4.80773397, -1.41498365]],
[[-1.02020833, 4.64691158, -2.6468243 ],
[-1.72766901, -2.83586225, -4.31347578],
[-5.06068616, 0.03108402, 2.00644425]],
[[-1.24512482, 5.27639513, -0.49553756],
[-3.1448762 , -1.14487146, -4.29357597],
[-4.26610415, -0.69519747, 3.31002045]],
[[ 0.84802014, 5.15437291, -1.53403401],
[-3.78879371, -0.52988294, -3.87245073],
[-3.81479475, 1.67155506, 3.50511689]],
[[-0.75160161, 5.20559083, -1.4006218 ],
[-2.76297178, -1.58723316, -4.41416766],
[-4.6298079 , 0.10120202, 2.86106387]],
[[-0.10015581, 4.81182171, -2.5431956 ],
[-2.11508869, -2.37758138, -4.41695745],
[-5.01647721, 0.90568544, 1.91215534]],
[[ 5.41727074, 0.052376 , 0.53503047],
[ 0.36093194, 3.66313001, -4.01286371],
[-0.39912243, 4.02803622, 3.64038256]],
[[-0.84741738, -4.68541479, -2.64036454],
[ 2.74980497, 1.91872555, -4.28859838],
[ 4.62130473, -2.00155914, 2.06744404]],
[[ 4.54053946, 1.33896218, -2.68797991],
[-2.9795225 , 1.41449556, -4.3302308 ],
[-0.36488555, 5.08480861, 1.9123953 ]],
[[ 5.21336533, -0.36693518, 1.52548383],
[-1.52384211, -2.4522629 , 4.61549587],
[ 0.37577396, -4.84590805, -2.4515694 ]],
[[ 1.4248227 , -5.24827582, 0.23367972],
[-2.98348948, -0.60884051, 4.51205234],
[-4.32399404, -1.30998769, -3.03677058]],
[[ 0.80872468, -4.66193972, 2.69261188],
[-1.50398559, 2.4181185 , 4.63929089],
[-5.1677454 , -1.43582624, -0.92885771]],
[[-0.71771972, 5.17989043, 1.51462399],
[ 1.77596267, -1.2154105 , 5.00101784],
[ 5.09591751, 1.15358474, -1.52971086]],
[[-1.22889577, 1.70060718, 5.02279699],
[ 1.25878798, -4.91431052, 1.97305097],
[ 5.15322729, 1.60532888, 0.71558392]],
[[ 0.43985009, -0.37087256, 5.41410301],
[-5.20652881, 1.4970093 , 0.52755122],
[-1.52455159, -5.2222393 , -0.23320364]],
[[ 1.31538934, 0.83537015, 5.21586525],
[-3.05862094, -4.26373126, 1.45286733],
[ 4.30639129, -3.28201239, -0.56247137]],
[[ 5.38672177, 0.40823947, 0.67653049],
[-0.69475886, 0.23619036, 5.39396154],
[ 0.37569663, -5.4233312 , 0.28493861]],
[[ 1.39124387, -1.225181 , 5.11856322],
[-2.36710293, 4.58221529, 1.7409477 ],
[-4.70086122, -2.6717554 , 0.63934696]],
[[ 2.67222533, -4.33467646, 1.92274546],
[-1.70208862, 1.18195301, 5.0339019 ],
[-4.42723793, -3.0715794 , -0.77427957]],
[[-2.86525147, 4.61207002, 0.38553639],
[ 0.15283965, -0.36011246, 5.4295353 ],
[ 4.62624341, 2.86954638, 0.05900653]],
[[-3.23619764, -4.06353874, 1.6273643 ],
[ 1.72521421, 0.67514801, 5.11806169],
[-4.02176835, 3.559441 , 0.88622397]],
[[ 4.96677709, -1.09939882, 1.93868491],
[-1.91226262, 0.32110548, 5.08520459],
[-1.1418871 , -5.32198788, -0.09269212]],
[[-1.40707125, 5.09669521, 1.29780844],
[ 0.87558666, -1.09825278, 5.25986227],
[ 5.18697709, 1.56832122, -0.53504223]],
[[-1.99844244, -0.39890189, 5.04772116],
[ 4.00396842, 3.19938415, 1.8367459 ],
[-3.10054396, 4.38606191, -0.88200503]],
[[ 1.63666418, 5.17433537, 0.41274537],
[ 5.17068422, -1.58775576, -0.61222728],
[-0.46072572, 0.57636073, -5.39449118]],
[[ 1.74456857, 5.08753726, 0.83375422],
[ 5.11792061, -1.60113892, -0.9334258 ],
[-0.62582041, 1.08234672, -5.2972535 ]],
[[-0.26709927, 5.26855918, 1.33718178],
[ 0.73569571, -1.29133969, 5.23702977],
[ 5.38830634, 0.44020166, -0.64841526]],
[[-2.08134947, 4.97081415, 0.76881435],
[ 0.10345508, -0.7889907 , 5.38588121],
[ 5.02980993, 2.0733428 , 0.20733945]],
[[ 1.20986424, 3.69872745, 3.80651543],
[ 1.26118469, -3.9924313 , 3.47843439],
[ 5.15565263, 0.10883585, -1.74355474]],
[[-1.24919041, -0.55472067, 5.26891306],
[ 5.27219962, 0.40532297, 1.29176614],
[-0.52541631, 5.39965458, 0.44509007]],
[[ 3.88012244, 0.75966171, 3.74087107],
[-3.7475665 , 1.76210191, 3.53177616],
[-0.71839949, -5.09458454, 1.77899977]],
[[-1.87593361, -2.50543679, -4.45254934],
[ 4.78370486, 0.80670828, -2.47159891],
[ 1.79988143, -4.76551339, 1.92290495]],
[[-2.33746814, 2.95408536, -3.92952784],
[ 4.86536814, 0.76534732, -2.31730839],
[-0.70542532, -4.50593408, -2.97026617]],
[[ 3.66885825, -0.33616863, -4.00840396],
[ 3.20822094, 3.51914848, 2.63963714],
[ 2.42651422, -4.13995987, 2.57027214]],
[[-0.6910409 , -2.74505155, -4.65110965],
[ 2.47053726, -4.32956903, 2.18856404],
[-4.80177632, -1.83306328, 1.79700941]],
[[-0.35956088, -2.24284299, -4.94712458],
[ 4.19200186, 3.0394353 , -1.68206995],
[ 3.45405734, -3.92028441, 1.52712553]],
[[-2.96461204, -0.16674101, -4.5617856 ],
[-2.59921656, -4.41090479, 1.85036845],
[-3.75264552, 3.18656391, 2.32308379]],
[[ 2.0764308 , -1.42081226, -4.82839428],
[-0.94557177, 5.0183479 , -1.88334267],
[ 4.94390797, 1.55576746, 1.66769417]],
[[-0.80937464, -3.22514176, -4.31081301],
[ 2.83873398, 3.44777228, -3.11325444],
[ 4.57334188, -2.71085116, 1.16941094]],
[[ 1.28066929, 1.37620061, 5.10831451],
[ 4.52553801, -3.00654687, -0.32416993],
[ 2.73935589, 4.32444018, -1.85331071]],
[[ 2.09256426, 5.02680764, -0.04272671],
[ 0.53031633, -0.26677932, -5.41156004],
[-4.99668525, 2.07510584, -0.591963 ]],
[[-1.61004734, 0.94324895, 5.1143291 ],
[-5.09008772, -1.38625173, -1.34624302],
[ 1.07016028, -5.17909392, 1.29158249]],
[[ 1.49952001, 1.31053712, 5.06586546],
[ 4.8957766 , 1.51057072, -1.84016738],
[-1.8475732 , 5.06290872, -0.76287896]],
[[ 4.12006791, -2.96028082, 1.96785991],
[-1.11376201, -3.93685913, -3.59010581],
[ 3.37177088, 2.31956397, -3.58682964]],
[[ 3.07081919, 3.94220911, 2.15927401],
[ 3.83502597, -0.93623767, -3.74752432],
[-2.3425764 , 3.63783408, -3.30555587]],
[[ 3.31409614, 4.28435274, -0.54233427],
[ 0.70020645, -1.20792724, -5.26199485],
[-4.26220359, 3.13426784, -1.2864461 ]],
[[ 3.86631355, -0.58845534, 3.78546494],
[ 3.02569552, -2.82923458, -3.53072044],
[ 2.35024311, 4.61212623, -1.68296155]],
[[ 1.0633695 , -1.53055659, 5.11392945],
[ 0.48212638, -5.16658592, -1.64590165],
[ 5.31732636, 0.7738504 , -0.8764399 ]],
[[ 1.25162115, -0.17574782, 5.29351194],
[-2.50387249, -4.81722437, 0.42971585],
[ 4.66937364, -2.53265489, -1.18910873]],
[[-5.02197304, 2.10044919, -0.04241968],
[ 0.62929683, 1.40008479, -5.22304956],
[-2.00476315, -4.82272822, -1.5324997 ]],
[[ 4.06550794, 1.19263077, -3.41801384],
[-3.05507006, 3.88731776, -2.27933075],
[ 1.94164954, 3.62146316, 3.57189289]],
[[-4.41306432, 2.60485388, -1.8289033 ],
[ 1.02583491, -1.79531522, -5.03589011],
[-3.01272816, -4.43061241, 0.96438248]],
[[ 1.75214499, 3.87060527, 3.40523275],
[-4.12338595, -1.10763239, 3.3783938 ],
[ 3.09499123, -3.66598617, 2.57497892]],
[[ 1.58695487, 4.29398352, 2.94413374],
[-4.00077048, -0.96588942, 3.56433385],
[ 3.33410391, -3.20183067, 2.87273927]],
[[ 3.5381107 , -2.28006219, 3.45377241],
[-0.06233671, 4.51606505, 3.04145385],
[-4.13536054, -2.01934107, 2.90622755]],
[[ 3.42170878, -2.22879183, 3.59898158],
[ 0.06660947, 4.65542334, 2.82012434],
[-4.23318091, -1.73018425, 2.95351546]],
[[ 1.75048253, -3.90472135, 3.36658219],
[ 1.99710293, 3.7919101 , 3.35739897],
[-4.75186704, 0.15492892, 2.65182429]],
[[ 1.11887791, -3.72959891, 3.80406147],
[ 3.00331136, 3.65044904, 2.69818264],
[-4.40107943, 1.54182029, 2.80851764]],
[[ 4.18434894, 1.46633489, 3.15972736],
[-3.47359011, 2.16319823, 3.59269289],
[-0.28691491, -4.77490985, 2.5984747 ]],
[[-1.45606998, 1.00107436, 5.14855038],
[ 0.3947044 , -5.30693507, 1.14306908],
[ 5.2311594 , 0.67818981, 1.3481771 ]],
[[-4.51976303, 2.43212543, 1.81459753],
[-0.6361307 , -3.94067718, 3.70151182],
[ 2.96697171, 2.86233968, 3.55550678]],
[[-4.61825776, -1.2647907 , 2.59051078],
[ 2.83690679, -2.84431729, 3.67085516],
[ 0.50294656, 4.4644488 , 3.07311271]]], 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 573 ms, sys: 7.48 ms, total: 581 ms
Wall time: 447 ms
[27]:
Array([[[ 0.75146961, 4.68990566, -2.659321 ],
[-3.01876529, -1.85832116, -4.13098374],
[-4.4677482 , 2.04592078, 2.34514199]],
[[ 2.82462475, 4.43702545, 1.40247853],
[-1.61610493, 2.47458516, -4.57153358],
[-4.36221064, 1.95712229, 2.60133094]],
[[ 4.01669114, -2.87416216, -2.28940115],
[-1.16343891, 2.22265999, -4.83112298],
[ 3.48534647, 4.05396548, 1.02562253]],
[[ 0.06576632, 5.35255904, 0.98644536],
[-2.16568671, 0.93152859, -4.90673005],
[-4.9938702 , -0.33438518, 2.14124392]],
[[ 1.67669701, -5.16810263, 0.34489378],
[ 2.42229752, 0.46289355, -4.85327461],
[ 4.57767561, 1.64761369, 2.4415909 ]],
[[ 4.51609645, 0.43252985, -3.00814511],
[-2.7208063 , -1.82496551, -4.34716993],
[-1.35325737, 5.11022342, -1.29764384]],
[[ 4.69017953, 2.73459641, -0.39856851],
[-1.88350174, 2.58877991, -4.40404714],
[-2.02176029, 3.93130065, 3.17570456]],
[[-2.06077352, -4.21343915, -2.76278227],
[-0.78128696, 3.215979 , -4.32226325],
[ 4.97817169, -1.2405858 , -1.82227564]],
[[-3.35060451, 4.05243092, -1.41236937],
[-0.53568086, -2.17476545, -4.96215916],
[-4.2563638 , -2.91464539, 1.7355846 ]],
[[ 5.28328738, 0.33713691, 1.26411617],
[ 1.05527577, 2.01146008, -4.94683943],
[-0.77514638, 5.04684341, 1.8874281 ]],
[[-4.85836627, 0.98321445, -2.25036923],
[ 2.4160372 , 1.01431065, -4.77176508],
[-0.44264983, -5.25713663, -1.34221865]],
[[-5.0716347 , 0.27514419, -1.95850501],
[ 1.96688104, 1.25907274, -4.91692138],
[ 0.20384974, -5.28855241, -1.27091672]],
[[ 5.4074644 , -0.23860278, 0.58004865],
[ 0.59618967, 3.5113803 , -4.11732388],
[-0.19427308, 4.15317318, 3.51398344]],
[[ 2.69899456, -3.50965433, -3.16670321],
[-2.7871668 , 1.76329725, -4.33049137],
[ 3.81840827, 3.76875433, -0.92256052]],
[[-3.91061924, -3.7650013 , 0.40040576],
[ 2.09612447, -2.63392727, -4.27985628],
[ 3.15341968, -2.91996817, 3.3409672 ]],
[[-3.88090152, -2.46049778, -2.91789902],
[ 3.23695795, 0.08386883, -4.37583572],
[ 2.02424435, -4.85498297, 1.4041141 ]],
[[-3.29833959, -3.40573546, -2.67459527],
[ 2.14681699, 1.63379407, -4.72804421],
[ 3.76176762, -3.91911076, 0.35249609]],
[[-0.57244021, -4.93961738, -2.21481692],
[ 3.37474876, 1.41575034, -4.030145 ],
[ 4.23396781, -1.79683599, 2.91206568]],
[[-4.23961807, -1.34185531, -3.1411615 ],
[ 2.33000725, 2.52349997, -4.22377685],
[ 2.49695876, -4.63357632, -1.39133361]],
[[-3.63162253, -2.98846795, -2.74066376],
[ 2.09702991, 1.76520804, -4.7029444 ],
[ 3.47082865, -4.19366911, -0.0260144 ]],
[[ 2.77830072, 4.58829411, -0.93007913],
[-3.27650542, 1.13312777, -4.19663735],
[-3.34445717, 2.70132707, 3.33996371]],
[[ 5.09969837, 0.27505196, -1.8826463 ],
[-1.83716038, 2.11276584, -4.66753517],
[ 0.4964066 , 5.00945599, 2.0732363 ]],
[[ 0.88072317, -5.35699188, -0.40436511],
[ 2.82577273, 0.81099817, -4.58130182],
[ 4.5687597 , 0.53186442, 2.91174116]],
[[ 2.66687783, -4.74243682, 0.20881103],
[ 2.52424213, 1.21429847, -4.66785298],
[ 4.0190709 , 2.38210931, 2.79407575]],
[[-3.0622751 , 2.62306292, -3.65773012],
[ 1.73989489, -3.3908079 , -3.88718758],
[-4.15058829, -3.35569324, 1.06923648]],
[[ 3.96536597, -2.84836816, -2.40833424],
[-2.44993519, 0.66038929, -4.81607844],
[ 2.8127813 , 4.59227555, -0.80072741]],
[[-1.2355172 , -5.06332452, 1.57336405],
[ 2.98657585, -2.00017142, -4.0877154 ],
[ 4.38011356, -0.06462051, 3.23180714]],
[[-3.01369689, 2.88055933, -3.50232056],
[ 1.02828852, -3.65996891, -3.8951669 ],
[-4.41574345, -2.81791123, 1.48173884]],
[[ 0.91396214, 5.10807921, 1.6454094 ],
[-2.80688581, 1.87798644, -4.26925043],
[-4.57369673, -0.13104614, 2.94887061]],
[[ 5.42747237, 0.40158621, 0.12086956],
[-0.088649 , 2.62925613, -4.7652076 ],
[-0.41059306, 4.74955615, 2.62886426]],
[[ 3.19635586, -4.24981315, 1.1603377 ],
[ 2.70338604, 0.75942981, -4.6641623 ],
[ 3.47947153, 3.31546658, 2.55642741]],
[[ 4.37684285, -0.82435961, -3.1310939 ],
[-3.20720218, -1.8188049 , -4.00507434],
[-0.4400364 , 5.06453836, -1.94798512]],
[[-3.4961967 , -3.50347458, -2.2674408 ],
[ 0.13741188, 2.86001971, -4.62990053],
[ 4.17214524, -3.02893301, -1.74841813]],
[[-0.26837964, -5.24013358, 1.45076204],
[ 1.97846944, -1.44687008, -4.86054362],
[ 5.06332446, 0.28703357, 1.97609972]],
[[ 5.17179746, -1.14795402, 1.25205072],
[ 1.59191063, 1.88337183, -4.85260218],
[ 0.59155792, 4.97731496, 2.12524581]],
[[ 2.42041654, 4.07480643, -2.6779511 ],
[-3.64570575, -0.47362681, -4.01512768],
[-3.23853448, 3.5780979 , 2.51845711]],
[[-1.73290027, 3.9988784 , -3.2620732 ],
[ 3.19085585, -1.87405894, -3.99206022],
[-4.05548401, -3.18315485, -1.74709583]],
[[-4.84524905, -1.57455935, -1.91766862],
[ 1.28417322, 2.00703602, -4.89410932],
[ 2.12291676, -4.80840761, -1.41511602]],
[[-1.02073432, 4.64677524, -2.64680014],
[-1.72669811, -2.83642007, -4.31379976],
[-5.06112258, 0.0316316 , 2.00602599]],
[[-1.24609247, 5.27522197, -0.49536618],
[-3.14428751, -1.14513209, -4.29347552],
[-4.2658258 , -0.6957743 , 3.30949257]],
[[ 0.84760486, 5.15403698, -1.53460178],
[-3.78930456, -0.52980137, -3.87250927],
[-3.81489339, 1.67171785, 3.50464693]],
[[-0.75220254, 5.20552497, -1.40079469],
[-2.76305664, -1.58689302, -4.41391593],
[-4.63022072, 0.10088061, 2.86100235]],
[[-0.09949944, 4.81182723, -2.5432865 ],
[-2.11464133, -2.37797891, -4.41707053],
[-5.01546604, 0.90627275, 1.91191616]],
[[ 5.41739364, 0.05284928, 0.53543044],
[ 0.36135851, 3.66275172, -4.01184456],
[-0.39877003, 4.02780241, 3.6409603 ]],
[[-0.84748421, -4.68538666, -2.63998448],
[ 2.74971376, 1.91899848, -4.28864169],
[ 4.62132631, -2.0007418 , 2.06787979]],
[[ 4.54087257, 1.33830272, -2.68805954],
[-2.98005499, 1.4148236 , -4.33042527],
[-0.36565956, 5.0836252 , 1.91190017]],
[[ 4.38820383, -1.45503922, -2.87415602],
[-2.00743605, 2.56230509, -4.36279985],
[ 2.51919222, 4.5766913 , 1.52907596]],
[[-0.80857442, 4.66156394, -2.69273941],
[ 1.50440699, -2.41826066, -4.63867448],
[-5.16833154, -1.43398035, -0.9292079 ]],
[[ 4.86554796, 0.7670053 , -2.31758008],
[-2.33750216, 2.95362827, -3.92978287],
[ 0.70532314, 4.5071512 , 2.96952643]],
[[-3.20787958, -3.51891445, -2.63976815],
[ 3.66854567, -0.33695762, -4.0078284 ],
[ 2.42643877, -4.14025763, 2.56994152]],
[[ 5.21289263, -0.36723902, 1.52572809],
[-1.52375774, -2.45238244, 4.61511335],
[ 0.37593651, -4.84629782, -2.45159108]],
[[ 1.42580097, -5.24893708, 0.23432317],
[-2.98383016, -0.60881618, 4.51246949],
[-4.32404323, -1.30958798, -3.03628038]],
[[-0.71855179, 5.18030936, 1.51457017],
[ 1.77577891, -1.21517285, 5.0008437 ],
[ 5.09556763, 1.15425245, -1.52923808]],
[[-1.22837798, 1.70110541, 5.02288845],
[ 1.25795531, -4.91544478, 1.97259029],
[ 5.15230857, 1.60524894, 0.71610786]],
[[ 0.44023753, -0.37051812, 5.41371135],
[-5.2069184 , 1.4972995 , 0.52707704],
[-1.52480041, -5.22172796, -0.23313751]],
[[ 1.31536749, 0.83500433, 5.2158303 ],
[-3.05793186, -4.26329198, 1.45286333],
[ 4.30653577, -3.28163606, -0.56179374]],
[[ 5.38670623, 0.40837238, 0.67598162],
[-0.69453176, 0.23649166, 5.3940395 ],
[ 0.37568164, -5.42331293, 0.28582794]],
[[ 1.39165639, -1.22486196, 5.11849631],
[-2.36783658, 4.58206017, 1.74072873],
[-4.70040637, -2.67157684, 0.6392881 ]],
[[ 2.6726581 , -4.33515391, 1.92260686],
[-1.70212846, 1.18225705, 5.03380075],
[-4.42679315, -3.07207733, -0.77416894]],
[[-2.86454783, 4.6124343 , 0.38624997],
[ 0.15251913, -0.35986142, 5.42969186],
[ 4.62611461, 2.86831764, 0.05951244]],
[[-3.23647978, -4.06298838, 1.62753584],
[ 1.72530405, 0.67471954, 5.11812868],
[-4.02226565, 3.55941894, 0.88602438]],
[[ 4.96646647, -1.09910342, 1.93835859],
[-1.9123997 , 0.32088082, 5.08537434],
[-1.14160922, -5.32216411, -0.09262541]],
[[-1.40665083, 5.09645553, 1.2975734 ],
[ 0.87485482, -1.09805167, 5.25982216],
[ 5.18689612, 1.56793188, -0.53497603]],
[[-1.99872422, -0.39866109, 5.04768759],
[ 4.00344292, 3.20045326, 1.83741869],
[-3.10060566, 4.38571555, -0.88163056]],
[[ 1.63625179, 5.17479104, 0.41353378],
[ 5.17061169, -1.58720796, -0.61192515],
[-0.46088735, 0.57644596, -5.3940304 ]],
[[ 1.74381487, 5.0884245 , 0.83377806],
[ 5.11855557, -1.60139779, -0.93286581],
[-0.62628752, 1.08271292, -5.29785492]],
[[-0.26828138, 5.26900737, 1.33755046],
[ 0.73577765, -1.29088313, 5.23696308],
[ 5.38809341, 0.44059917, -0.64838115]],
[[-2.08049646, 4.97105085, 0.76923017],
[ 0.1034313 , -0.788899 , 5.38565474],
[ 5.0301023 , 2.07333574, 0.20739338]],
[[ 1.21007468, 3.69869755, 3.8066582 ],
[ 1.26100644, -3.99265792, 3.4784544 ],
[ 5.15533716, 0.10886175, -1.7440642 ]],
[[-1.24938115, -0.55507136, 5.269173 ],
[ 5.27157256, 0.40524585, 1.29202917],
[-0.52481607, 5.40007946, 0.44489872]],
[[ 1.28052336, 1.37646509, 5.10854165],
[-2.7390127 , -4.32494531, 1.85295452],
[ 4.52659041, -3.00587783, -0.32452108]],
[[ 3.88021371, 0.75969083, 3.74116191],
[-3.74829308, 1.76226889, 3.53203614],
[-0.71853011, -5.09476751, 1.77879386]],
[[-1.87579017, -2.50551608, -4.45277768],
[ 4.78303653, 0.80708916, -2.47118132],
[ 1.79964614, -4.76621586, 1.92218187]],
[[-0.6914036 , -2.74483467, -4.65076775],
[ 2.47046718, -4.32946578, 2.188409 ],
[-4.80170353, -1.83304186, 1.79646792]],
[[-0.35904754, -2.24313978, -4.94753014],
[ 4.19135276, 3.03965026, -1.68187213],
[ 3.45532734, -3.91964081, 1.5271973 ]],
[[-2.96503825, -0.16644662, -4.56261655],
[-2.59966115, -4.41082529, 1.84974079],
[-3.75250702, 3.18683095, 2.32243634]],
[[ 2.07602077, -1.42092587, -4.82809658],
[-0.94461616, 5.01918702, -1.88286824],
[ 4.94352009, 1.55526462, 1.66729438]],
[[-0.80889274, -3.22499341, -4.31066527],
[ 2.83859019, 3.44820368, -3.1126569 ],
[ 4.57329317, -2.71038922, 1.16907274]],
[[ 2.09208677, 5.02593587, -0.04265244],
[ 0.53039232, -0.26687434, -5.41138322],
[-4.99699747, 2.07473424, -0.59206646]],
[[-1.60988977, 0.94335341, 5.11445252],
[-5.090537 , -1.38593925, -1.34632246],
[ 1.06942756, -5.17869702, 1.29160228]],
[[ 1.49934584, 1.31094927, 5.06609571],
[ 4.89597481, 1.51085543, -1.84010562],
[-1.84739479, 5.06253908, -0.76336361]],
[[ 4.12389886, -2.95957922, 1.96681572],
[-1.11219043, -3.93695858, -3.59168893],
[ 3.37465761, 2.32011483, -3.58729269]],
[[ 3.07201126, 3.94102087, 2.15891425],
[ 3.83520736, -0.93609569, -3.74768039],
[-2.34211936, 3.63697809, -3.30545659]],
[[ 3.31494392, 4.28443934, -0.54253567],
[ 0.69994473, -1.20772111, -5.26156937],
[-4.26155459, 3.13400394, -1.28645392]],
[[ 3.86673175, -0.58857684, 3.7858219 ],
[ 3.02638201, -2.82988452, -3.53117928],
[ 2.34969432, 4.61251682, -1.68236226]],
[[ 1.06338284, -1.53039983, 5.11435636],
[ 0.48151095, -5.16667279, -1.64524273],
[ 5.31705613, 0.77408039, -0.87548027]],
[[ 1.25113334, -0.17584431, 5.29372756],
[-2.50437579, -4.81664397, 0.42916282],
[ 4.66945979, -2.53351788, -1.18888471]],
[[-5.02237448, 2.10025972, -0.04246173],
[ 0.62930734, 1.39905648, -5.22272141],
[-2.00505558, -4.82277659, -1.53285059]],
[[ 3.05502163, -3.88738586, 2.27939253],
[-1.94193284, -3.62159607, -3.57172368],
[ 4.06601664, 1.19234072, -3.41842385]],
[[ 3.01304938, 4.43021473, -0.96439063],
[-4.41427259, 2.60529285, -1.8294811 ],
[-1.02598976, 1.79537424, 5.03531979]],
[[ 1.75173587, 3.87029138, 3.40575203],
[-4.12215963, -1.10796236, 3.37841575],
[ 3.0954112 , -3.66472079, 2.57445264]],
[[ 1.58718977, 4.29454331, 2.94486802],
[-3.99940558, -0.96504943, 3.56380197],
[ 3.33358074, -3.20318989, 2.87281605]],
[[ 3.53814495, -2.27932592, 3.45322325],
[-0.06258595, 4.51506752, 3.04156178],
[-4.13544947, -2.0189238 , 2.90690961]],
[[ 3.42187464, -2.2289579 , 3.59850177],
[ 0.0659179 , 4.65549326, 2.82099842],
[-4.23323269, -1.72958552, 2.9543078 ]],
[[ 1.75092123, -3.9035382 , 3.36612605],
[ 1.99664299, 3.79137063, 3.35764453],
[-4.75169447, 0.1548601 , 2.65126082]],
[[-4.40093712, 1.54290153, 2.80806315],
[ 1.11826556, -3.72963151, 3.80364527],
[ 3.00341926, 3.65095083, 2.69832606]],
[[ 4.18389185, 1.46723615, 3.15903614],
[-3.47242341, 2.16268552, 3.59234376],
[-0.28715244, -4.77532492, 2.59841636]],
[[-1.45604152, 1.00110888, 5.14838687],
[ 0.39447663, -5.30711346, 1.14335599],
[ 5.23086041, 0.67880884, 1.34807878]],
[[ 0.50245107, 4.46494223, 3.07362399],
[-4.61799358, -1.263492 , 2.58998425],
[ 2.83766005, -2.84466553, 3.6704951 ]],
[[-4.52046947, 2.43240524, 1.81393469],
[-0.63570181, -3.94090647, 3.70170864],
[ 2.96679678, 2.86237695, 3.55599934]]], 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], 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(lpars) for f in fit_dir])
strains_refl = jnp.array([grains_refl[f].eps_sample_matrix(lpars) for f in fit_refl])
strains_both = jnp.array([grains_both[f].eps_sample_matrix(lpars) 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.0012952178850863807 ground truth: 0.0014038703469459763
[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) | -108.652462 | -110.685074 | -51.277374 | 0.4676
Positional Diff | 11.279836 | 11.804985 | 8.501538 | 0.7365
Misorientation (x1e-3) | 10.029741 | 11.459423 | 7.488381 | 0.6969
Strain Norm (x1e-4) | 2.698354 | 3.062596 | 2.062151 | 0.7159
[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 29 seconds
[ ]: