refine_pattern#

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

Refine detected diffraction streaks by fitting a Gaussian across the line.

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

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

  • dilation (float) – Dilation radius in pixels used for the Gaussian fit.

  • profile (str) –

    Line width profile used for the Gaussian fit. 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

Refined diffraction streaks.

Return type

Dict[int, numpy.ndarray]