xrheed.preparation.alignment

Functions

find_horizontal_center(image[, n_stripes, ...])

Estimate horizontal (sx) symmetry center of a diffraction image.

find_incident_angle(image[, y_range, prominence])

Find incident angle in degrees using reflection/transmission spots near sx=0.

find_vertical_center(image[, center_x, ...])

Estimate the vertical (sy) center of a RHEED image using the shadow edge.

find_horizontal_center(image, n_stripes=10, prominence=0.1, refinement_tolerance=1.0)[source]

Estimate horizontal (sx) symmetry center of a diffraction image.

Parameters:
  • image (xr.DataArray) – 2D image with ‘sx’ and ‘sy’ coordinates.

  • n_stripes (int, optional) – Number of horizontal stripes along ‘sy’ to analyze (default 10).

  • prominence (float, optional) – Minimum prominence for peak detection (relative to normalized profile).

  • refinement_tolerance (float, optional) – Maximum allowed deviation from global center (in sx units, default 0.2 mm).

Returns:

Estimated sx coordinate of symmetry center.

Return type:

float

find_incident_angle(image, y_range=(-30, 30), prominence=0.1)[source]

Find incident angle in degrees using reflection/transmission spots near sx=0.

find_vertical_center(image, center_x=0.0, n_stripes=10, prominence=0.1)[source]

Estimate the vertical (sy) center of a RHEED image using the shadow edge. The image is divided into vertical stripes along ‘sx’; for each stripe, a profile along ‘sy’ is extracted and a linear+sigmoid model is fitted to locate the shadow edge. The final center is the median of valid fits.

Parameters:
  • image (xr.DataArray) – 2D RHEED image with ‘sx’ and ‘sy’ coordinates.

  • center_x (float, optional) – Horizontal center (sx) to subtract from coordinates before analysis (default 0.0). Useful to align profiles to a previously estimated horizontal center.

  • n_stripes (int, optional) – Number of vertical stripes along ‘sx’ to analyze (default 10).

  • prominence (float, optional) – Minimum prominence for peak detection (relative to normalized profile).

Returns:

Estimated sy coordinate of the vertical center.

Return type:

float