onedmoments

gaussfitter.onedmoments(Xax, data, vheight=True, estimator=<function median>, negamp=None, veryverbose=False, **kwargs)[source] [edit on github]

Returns (height, amplitude, x, width_x) the gaussian parameters of a 1D distribution by calculating its moments. Depending on the input parameters, will only output a subset of the above.

If using masked arrays, pass estimator=np.ma.median ‘estimator’ is used to measure the background level (height)

negamp can be used to force the peak negative (True), positive (False), or it will be “autodetected” (negamp=None)