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
inpbased on two-zone masking. The inner and outer zone are defined by a set of dilation radiidilations. The normalised reflection is given by \((inp[i, j] - b) / (c - b)\), wherecis the maximum intensity in the inner zone andbis 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
candb. 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