pytweezer.analysis.gaussian_fit module¶
Fit a 1-D Gaussian to an incoming data trace and publish the parameters.
- Input:
One data stream carrying either a 1-D array (
yonly, x is the index) or a 2xN[x, y]array – e.g. a profile fromprojections.py.- Output:
A data message (no array) whose header carries the fit parameters:
amplitude,center,sigma,fwhm,offset, plusmethodandsuccess. Published on<name>(the process’s own stream).- Properties:
datastreams: ([str]) input data streams.
method: (str)
'lsq'(default, accurate least-squares fit) or'moments'(a faster closed-form estimate – centre is reliable but the width is biased high by baseline noise in the tails; use only when raw speed matters more than an accurate sigma).
The 'lsq' path seeds scipy.optimize.curve_fit() with the
gaussian_moments() estimate so it converges in a few iterations, and caps
maxfev so a pathological trace cannot stall the analysis loop.
- class pytweezer.analysis.gaussian_fit.GaussianFit(name)[source]¶
Bases:
DataAnalysis