calamari.simulate.synthetic_chi_peak#

calamari.simulate.synthetic_chi_peak(x, centre, width, height, background=0.0, noise=0.0, rng=None)#

A Gaussian peak on a flat background, for transition-detection tests.

Stands in for a localised feature in a swept quantity – e.g. a chi’(H) peak at a metamagnetic transition, or a chi(T) peak at an ordering temperature – used to plant a known feature location for calamari.transitions.find_transitions() to recover.

Parameters:
  • x (ArrayLike) – Independent variable (field or temperature, in the caller’s units).

  • centre (float) – Peak centre, same units as x.

  • width (float) – Gaussian standard deviation, same units as x.

  • height (float) – Peak height above background.

  • background (float) – Flat background level. Default 0.

  • noise (float) – Standard deviation of additive Gaussian noise, same units as height. Default 0 (no noise, and rng may then be omitted).

  • rng (Generator | None) – Required when noise > 0; see synthetic_mh_curve().

Return type:

ndarray

Returns:

numpy.ndarray – y(x), same shape as x.

Raises:

ValueError – If noise > 0 and rng is None.