gaussian

Contents

gaussian#

abtem.distributions.gaussian(standard_deviation, num_samples, dimension=1, center=0.0, ensemble_mean=True, sampling_limit=3.0, normalize='probability')[source]#

Return a distribution with values weighted according to a (multidimensional) Gaussian distribution. The values are evenly spaced within a given truncation of the Gaussian distribution. As an example, this distribution may be used for simulating focal spread.

Parameters:
  • standard_deviation (float or tuple of float) – The standard deviation of the distribution. The standard deviations may be given for each axis as a tuple, or as a single number, in which case it is equal for all axes.

  • num_samples (int) – Number of samples uniformly spaced samples. The samples may be given for each axis as a tuple, or as a single number, in which case it is equal for all axes.

  • center (float or tuple of float) – The center of the Gaussian distribution (default is 0.0). The center may be given for each axis as a tuple, or as a single number, in which case it is equal for all axes.

  • dimension (int, optional) – Number of dimensions of the Gaussian distribution.

  • ensemble_mean (bool, optional) – If True, the mean of ensemble of measurements defined by the distribution is calculated, otherwise the full ensemble is kept. Default is True.

  • sampling_limit (float, optional) – Truncate the distribution at this many standard deviations (default is 3.0).

  • normalize (str, optional) – Scaling of the stored probability weights: ‘probability’ (default) normalizes them to sum to one. The weights are probabilities applied when the ensemble is reduced (Σ p_i I_i / Σ p_i), so the scaling never changes a reduced result. ‘intensity’ and ‘amplitude’ are deprecated remnants of the former convention in which the weights multiplied the wave amplitude; both now emit a FutureWarning and behave as ‘probability’.

Return type:

MultidimensionalDistribution

Notes

The weights are the probabilities p_i ∝ exp(-x_i² / 2σ²) of the sampled values: each ensemble member is simulated unweighted and the reduced (incoherently averaged) measurement is Σ p_i I(x_i) / Σ p_i, so the parameter seen by the intensity has standard deviation σ (up to the truncation at sampling_limit). For a defocus spread this corresponds to Kirkland’s 1/e focal-spread width Δ = √2·σ used by abtem.transfer.TemporalEnvelope.