varyperiod

marxs.design.tolerancing.varyperiod(element, period_mean, period_sigma)[source] [edit on github]

Randomly draw different grating periods for different gratings

This function needs to be called with gratings as parameters, e.g.

>>> from marxs.optics import CATGrating
>>> from marxs.design.tolerancing import varyperiod
>>> grating = CATGrating(order_selector=None, d=0.001)
>>> varyperiod(grating, 2e-4, 1e-5)

and the parameters are expected to have two components: center and sigma of a Gaussian distribution for grating contstant d.

Parameters:
element :`marxs.optics.FlatGrating` or similar (or list of those elements)

Elements where uncertainties will be set

period_meanfloat

Center of Gaussian (in mm)

period_sigmafloat

Sigma of Gaussian (in mm)