Configuration#
Configuration objects are immutable. Use dataclasses.replace() to derive
new values and construct or replace an Indexer to validate them. See
Processing for the processing API.
Peak Search#
- class lauelab.indexing.PeakParams(boxsize=5, max_rfactor=2.0, min_size=3, min_separation=10, threshold=100.0, threshold_ratio=None, peak_shape='Lorentzian', max_peaks=50, smooth=False)[source]#
Peak-search configuration.
- Parameters:
boxsize (int) – Half-width, in pixels, of the square region used to fit each peak.
max_rfactor (float) – Maximum fit residual factor accepted for a peak. Must be positive.
min_size (int) – Minimum peak size in pixels. Must be positive.
min_separation (int) – Minimum separation between accepted peaks in pixels. Must be positive.
threshold (float | None) – Absolute intensity threshold. If None, derive a threshold from the image statistics and
threshold_ratio.threshold_ratio (float | None) – Scale applied to the image standard deviation when deriving an automatic threshold. None uses the native default of
4.0.peak_shape (Literal['Lorentzian', 'Gaussian']) – Peak model, either
"Lorentzian"or"Gaussian".max_peaks (int) – Maximum number of peaks returned from one frame. Must be positive.
smooth (bool) – Whether to smooth the image before peak detection and fitting.
Notes
Instances are immutable. Use
dataclasses.replace()to derive a configuration with changed values. Parameter validation occurs when anIndexeris constructed.
Orientation Indexing#
- class lauelab.indexing.IndexParams(kev_max_calc=30.0, kev_max_test=35.0, angle_tolerance_deg=0.12, cone_deg=72.0, hkl_prefer=(0, 0, 1), max_data=250)[source]#
Crystal-orientation indexing configuration.
- Parameters:
kev_max_calc (float) – Maximum photon energy in keV used to calculate candidate reflections. Must be positive.
kev_max_test (float) – Maximum photon energy in keV used to test candidate reflections. Must be positive.
angle_tolerance_deg (float) – Angular matching tolerance in degrees. Must be positive.
cone_deg (float) – Search cone angle in degrees. Must be positive.
hkl_prefer (tuple[int, int, int]) – Preferred Miller-index direction as exactly three integers.
max_data (int) – Maximum number of detected peaks supplied to the orientation indexer. Must be at least two.
Notes
Instances are immutable. Use
dataclasses.replace()to derive a configuration with changed values. Parameter validation occurs when anIndexeris constructed.
Frame Metadata#
- class lauelab.indexing.FrameMetadata(title=None, sample_name=None, user_name=None, beamline=None, scan_number=None, date_exposed=None, beam_bad=None, ccd_shutter=None, light_on=None, mono_mode=None, sample_position=None, energy_kev=None, hutch_temperature=None, sample_distance=None, detector_id=None, exposure_seconds=None)[source]#
Optional experiment provenance attached to a frame result.
- Parameters:
title (str | None) – Experiment or scan title.
sample_name (str | None) – Sample name.
user_name (str | None) – User name recorded with the acquisition.
beamline (str | None) – Beamline identifier.
scan_number (int | None) – Scan number.
date_exposed (str | None) – Exposure date or timestamp as recorded by the source file.
beam_bad (int | None) – Source beam-quality flag.
ccd_shutter (str | None) – CCD shutter state.
light_on (int | None) – Illumination-state flag.
mono_mode (str | None) – Monochromator mode.
sample_position (tuple[float, float, float] | None) – Sample
(x, y, z)position in the acquisition coordinate system.energy_kev (float | None) – Incident energy in keV.
hutch_temperature (float | None) – Hutch temperature in the units supplied by the acquisition metadata.
sample_distance (float | None) – Sample distance in the units supplied by the acquisition metadata.
detector_id (str | None) – Detector identifier expected to match the selected geometry detector.
exposure_seconds (float | None) – Detector exposure time in seconds.
Notes
Instances are immutable. Values supplied explicitly to
Indexer.index()override metadata read from an HDF5 frame.