hexrd.xrdutil.phutil module
Created on Mon May 23 11:29:50 2022
@author: jbernier
- class hexrd.xrdutil.phutil.JHEPinholeDistortion(panel, pinhole_thickness, pinhole_radius)[source]
Bases:
object
- property panel
- property pinhole_radius
- property pinhole_thickness
- hexrd.xrdutil.phutil.PinholeDistortion
alias of
JHEPinholeDistortion
- class hexrd.xrdutil.phutil.RyggPinholeDistortion(panel, absorption_length, pinhole_thickness, pinhole_radius, num_phi_elements=60)[source]
Bases:
object
- class hexrd.xrdutil.phutil.SampleLayerDistortion(panel, layer_standoff, layer_thickness, pinhole_thickness, pinhole_radius)[source]
Bases:
object
- property layer_standoff
- property layer_thickness
- property panel
- property pinhole_radius
- property pinhole_thickness
- hexrd.xrdutil.phutil.azimuth(vv, v0, v1)[source]
Return azimuthal angle btwn vv and v0, with v1 defining phi=0.
Originally written by Ryan Rygg. This is a modified version.
- hexrd.xrdutil.phutil.calc_tth_rygg_pinhole(panels, absorption_length, tth, eta, pinhole_thickness, pinhole_radius, num_phi_elements=60, clip_to_panel=True)[source]
Return pinhole twotheta [rad] and effective scattering volume [mm3].
num_phi_elements: number of pinhole phi elements for integration
- hexrd.xrdutil.phutil.polar_tth_corr_map_rygg_pinhole(tth, eta, instrument, absorption_length, pinhole_thickness, pinhole_radius, num_phi_elements=60)[source]
Generate a polar tth corr map directly for all panels
- hexrd.xrdutil.phutil.tth_corr_map_pinhole(instrument, pinhole_thickness, pinhole_radius)[source]
Compute the Bragg angle distortion fields for pinhole diffraction.
Parameters
- instrumenthexrd.instrument.HEDMInstrument
The pionhole camera instrument object.
- pinhole_thicknessscalar
The thickenss (height) of the pinhole (cylinder) in mm
- pinhole_radiusscalar
The radius of the pinhole in mm
Returns
- tth_corrdict
The Bragg angle correction fields for each detector in instrument as 2θ_pin - 2θ_nom in radians.
Notes
The follows a slightly modified version of Jon Eggert’s pinhole correction.
- hexrd.xrdutil.phutil.tth_corr_map_rygg_pinhole(instrument, absorption_length, pinhole_thickness, pinhole_radius, num_phi_elements=60)[source]
- hexrd.xrdutil.phutil.tth_corr_map_sample_layer(instrument, layer_standoff, layer_thickness, pinhole_thickness, pinhole_radius)[source]
Compute the Bragg angle distortion fields for an instrument associated with a specific sample layer in a pinhole camera.
Parameters
- instrumenthexrd.instrument.HEDMInstrument
The pionhole camera instrument object.
- layer_standoffscalar
The sample layer standoff from the upstream face of the pinhole in mm.
- layer_thicknessscalar
The thickness of the sample layer in mm.
- pinhole_thicknessscalar
The thickenss (height) of the pinhole (cylinder) in mm
- pinhole_radiusscalar
The radius of the pinhole in mm.
Returns
- tth_corrdict
The Bragg angle correction fields for each detector in instrument as 2θ_sam - 2θ_nom in radians.
Notes
- source_distanceThe distance from the pinhole center to
the X-ray source in mm. Comes from the instr attribute of the same name.
- hexrd.xrdutil.phutil.tth_corr_pinhole(panel, xy_pts, pinhole_thickness, pinhole_radius, return_nominal=True)[source]
Compute the Bragg angle distortion associated with the pinhole as a source.
Parameters
- panelhexrd.instrument.Detector
A detector instance.
- xy_ptsarray_like
The (n, 2) array of n (x, y) coordinates to be transformed in the raw detector coordinates (cartesian plane, origin at center).
- pinhole_thicknessscalar
The thickenss (height) of the pinhole (cylinder) in mm
- pinhole_radiusscalar
The radius of the pinhole in mm.
Returns
- TYPE
DESCRIPTION.
Notes
The follows a slightly modified version of Jon Eggert’s pinhole correction.
- hexrd.xrdutil.phutil.tth_corr_rygg_pinhole(panel, absorption_length, xy_pts, pinhole_thickness, pinhole_radius, return_nominal=True, num_phi_elements=60)[source]
- hexrd.xrdutil.phutil.tth_corr_sample_layer(panel, xy_pts, layer_standoff, layer_thickness, pinhole_thickness, pinhole_radius, return_nominal=True)[source]
Compute the Bragg angle distortion associated with a specific sample layer in a pinhole camera.
Parameters
- panelhexrd.instrument.Detector
A panel instance.
- xy_ptsarray_like
The (n, 2) array of n (x, y) coordinates to be transformed in the raw detector coordinates (cartesian plane, origin at center).
- layer_standoffscalar
The sample layer standoff from the upstream face of the pinhole in mm.
- layer_thicknessscalar
The thickness of the sample layer in mm.
- pinhole_thicknessscalar
The thickenss (height) of the pinhole (cylinder) in mm
- pinhole_radiusscalar
The radius of the pinhole in mm.
Returns
- TYPE
DESCRIPTION.