Skip to content

Modulation Enhanced Diffraction

import numpy as np

amax = 250  # max temperature amplitude
amin = 200  # min temperature amplitude
n = 50  # number of points
filename = 'name'
func = np.cos  # use cosine function

points = np.linspace(0, 2 * np.pi, n)
temps = (amax + amin) / 2 + func(points) * (amax - amin) / 2

for i, t in enumerate(temps):
    cryostream.ramp(t, 360)
    cryostream.wait()
    # nop=True means the filename pattern will be without _0001p
    # part, i.e. name_001.cbf instead of name_001_0001p.cbf
    diffractometer.scan(filename=f'{filename}_{i:03d}', nop=True)