laue_dials.diagnostics namespace

Submodules

laue_dials.diagnostics.compare_A_matrices module

laue_dials.diagnostics.diffgeolib module

class laue_dials.diagnostics.diffgeolib.Detector(ax1, ax2, ori)[source]

Bases: object

classmethod from_expt_file(filename, **kwargs)[source]

Return a generator of Detector instances for each panel described in filename

classmethod from_inp_file(filename, **kwargs)[source]

doesn’t account for tilt yet

lab2pix(xyz, D=None)[source]

Map 3d coordinates in the lab frame in mm to pixels

pix2lab(xy, D=None)[source]

Map xy to 3d coordinates in the lab frame in mm

s12pix(s1, D=None)[source]

Project a scattered beam wavevector into pixel coordinates.

class laue_dials.diagnostics.diffgeolib.LaueAssigner(s0, s1, cell, R, lam_min, lam_max, dmin, spacegroup='1')[source]

Bases: object

An object to assign miller indices to a laue still.

property H
property RB
assign()[source]

Assign miller indices to the inlier reflections

This method will update:

self.H – miller indices self.wav – wavelengths self.qpred – predicted scattering vector

property harmonics
property qobs
property qpred
reject_outliers(nstd=10.0)[source]

update the list of inliers

reset_inliers()[source]
property s1
set_H(H)[source]
set_harmonics(harmonics)[source]
set_inliers(inliers)[source]
set_qpred(qpred)[source]
set_wav(wav)[source]
update_rotation()[source]

Update the rotation matrix (self.R) based on the inlying refls

property wav
class laue_dials.diagnostics.diffgeolib.LauePredictor(s0, cell, R, lam_min, lam_max, dmin, spacegroup='1')[source]

Bases: object

An object to predict spots given a Laue experiment.

property RB
predict_s1(delete_harmonics=False)[source]

Predicts all s1 vectors for all feasible spots given some resolution-dependent bandwidth

This method provides:

s1_pred – predicted feasible s1 vectors lams – the wavelengths (in Angstroms) associated with these s1 vectors qall – the q vectors associated with these s1 vectors

laue_dials.diagnostics.diffgeolib.align_hkls(reference, target, spacegroup, anomalous=True)[source]

Use the point group operators in spacegroup to align target hkls to reference.

Parameters:
  • reference (array) – n x 3 array of miller indices

  • target (array) – n x 3 array of miller indices

  • spacegroup (gemmi.Spacegroup) – The space group of reference/target.

  • anomalous (bool(optional)) – If true, test Friedel symmetries too.

Returns:

aligned – n x 3 array of miller indices equivalent to target

Return type:

array

laue_dials.diagnostics.diffgeolib.hkl2ray(hkl, wavelength=None)[source]

Convert a miller index to the shortest member of its central ray. Optionally, adjust its wavelength accordingly.

Parameters:
  • hkl (array) – n x 3 array of miller indices. the dtype must be interpretable as an integeger

  • wavelength (array (optional)) – length n array of wavelengths corresponding to each miller index

Returns:

  • reduced_hkl (array) – The miller index of the shortest vector on the same central ray as hkl

  • reduced_wavelength (array (optional)) – The wavelengths corresponding to reduced_hkl

laue_dials.diagnostics.diffgeolib.indexing_rotation_tril(A)[source]

Convert the reciprocal space indexing matrix, A into the product of an orthogonal matrix U and a lower triangular matrix B

Parameters:

A (np.array) – A 3x3 indexing matrix such that the scattering vector S1-S0=Q=A@h

Returns:

  • U (np.array) – An orthogonal 3x3 matrix

  • B (np.array) – A 3x3 lower triangular matrix

laue_dials.diagnostics.diffgeolib.is_ray_equivalent(hkl1, hkl2)[source]

Test for equivalency between two miller indices in a Laue experiment. Returns a boolean array for each of the n hkls in hkl{1,2}.

laue_dials.diagnostics.diffgeolib.mat_to_rot_xyz(R, deg=True)[source]

Decompose a rotation matrix into euler angles

laue_dials.diagnostics.diffgeolib.normalize(A)[source]

Normalize the last dimension of an array by dividing by its L2 norm

laue_dials.diagnostics.diffgeolib.orthogonalization(a, b, c, alpha, beta, gamma)[source]

Compute the orthogonalization matrix from cell params

laue_dials.diagnostics.diffgeolib.rot_xyz_to_mat(rot_x, rot_y, rot_z, deg=True)[source]

Convert euler angles into a rotation matrix

laue_dials.diagnostics.match_precog_hkls module

laue_dials.diagnostics.quintile_strongs module

laue_dials.diagnostics.viewer module