hexrd.fitting.calibration.laue module

class hexrd.fitting.calibration.laue.LaueCalibrator(instr, material, grain_params, default_refinements=None, min_energy=5, max_energy=25, tth_distortion=None, calibration_picks=None, euler_convention=('zxz', False))[source]

Bases: Calibrator

autopick_points(raw_img_dict, tth_tol=5.0, eta_tol=5.0, npdiv=2, do_smoothing=True, smoothing_sigma=2, use_blob_detection=True, blob_threshold=0.25, fit_peaks=True, min_peak_int=1.0, fit_tth_tol=0.1)[source]

Parameters

raw_img_dictTYPE

DESCRIPTION.

tth_tolTYPE, optional

DESCRIPTION. The default is 5..

eta_tolTYPE, optional

DESCRIPTION. The default is 5..

npdivTYPE, optional

DESCRIPTION. The default is 2.

do_smoothingTYPE, optional

DESCRIPTION. The default is True.

smoothing_sigmaTYPE, optional

DESCRIPTION. The default is 2.

use_blob_detectionTYPE, optional

DESCRIPTION. The default is True.

blob_thresholdTYPE, optional

DESCRIPTION. The default is 0.25.

fit_peaksTYPE, optional

DESCRIPTION. The default is True.

Returns

None.

property bmatx
property calibration_picks

A way to retrieve picks in calibration format

Often, the calibrators store the picks in a different format internally. But the calibrators must have a way to set/get from the calibration_picks format. The calibration_picks format looks like this:

{
“det_key1”: {

“hkl1”: picks1, “hkl2”: picks2, …

}, “det_key2”: …

}

Where “det_key” is the detector key. “hkl” is a space-delimited string of the hkl. And “picks” are either a list of points (powder) or a single point (laue). The picks are in cartesian coordinates.

create_lmfit_params(current_params)[source]

Create lmfit parameters that this class will use and return them

current_params is passed only so that this class can ensure that it does not produce any name conflicts with existing parameters.

It is recommended to save the names of the parameters created, for example, self.param_names, to remember them when updating in the future.

For example, the powder calibrator creates lmfit parameters for the lattice parameters. The Laue calibrator creates lmfit parameters for crystal parameters.

property energy_cutoffs
property grain_params_euler
model()[source]
property plane_data
residual()[source]

Compute a residual using the calibration data.

Calibration data may have already been stored as an attribute on the calibration class instead, in which case, calibration_data can be None.

type = 'laue'
update_from_lmfit_params(params_dict)[source]

Update any needed properties based on the params_dict

The entries in the params_dict should have the same names as those that were created via create_lmfit_params(). Update any local parameters based upon the new contents of the params_dict.

For example, the powder calibrator will update the lattice parameters on the material. The Laue calibrator will update crystal parameters.

hexrd.fitting.calibration.laue.gaussian_2d(p, data)[source]
hexrd.fitting.calibration.laue.gaussian_2d_int(y, x, *p)[source]
hexrd.fitting.calibration.laue.sxcal_obj_func(grain_params, instr, meas_xy, hkls_idx, bmat, energy_cutoffs, sim_only=False)[source]

Objective function for Laue-based fitting.

energy_cutoffs are [minEnergy, maxEnergy] where min/maxEnergy can be lists