normalise_pattern#

cbclib.bin.normalise_pattern(inp: numpy.ndarray, lines: Dict[int, numpy.ndarray], dilations: Tuple[float, float, float], profile: str = 'tophat', num_threads: int = 1)[source]#

Perform the normalisation of measured CBC patterns inp based on two-zone masking. The inner and outer zone are defined by a set of dilation radii dilations. The normalised reflection is given by \((inp[i, j] - b) / (c - b)\), where c is the maximum intensity in the inner zone and b is the median intensity in the outer zone.

Parameters
  • inp (numpy.ndarray) – Measured CBC patterns.

  • lines (Dict[int, numpy.ndarray]) – Detected diffraction streaks.

  • dilations (Tuple[float, float, float]) – Dilation radii of two-zone masking in pixels.

  • profile (str) –

    Line width profile used to calculate c and b. The following keyword values are allowed:

    • tophat : Top-hat (rectangular) function profile.

    • linear : Linear (triangular) function profile.

    • quad : Quadratic (parabola) function profile.

    • gauss : Gaussian funtion profile.

  • num_threads (int) – Number of threads used in the calculations.

Returns

Normalised CBC patterns.

Return type

numpy.ndarray