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.

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 an Indexer is 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.

as_dict()[source]#

Return the metadata fields whose values are not None.

Returns:

dict[str, object] – A new mapping containing the populated fields.

Return type:

dict[str, object]