1

I have a numerically calculated light pulse's temporal shape, stored in a NumPy array. I'd like to find the parameters (specifically, the FWHM) of it's Gaussian envelope function, but for that first I have to fit it.
Is there a built-in SciPy function, or set of functions, for envelope fitting, or I have to write this code myself? (As accuracy is not too important, I'd probably just take the local maxes and fit a Gaussian on them...)

The light pulse looks like this:

The light pulse in question

Neinstein
  • 958
  • 2
  • 11
  • 31

1 Answers1

1

If you just want to find the maxima, I suggest using Scipy's argrelextrema.

It however seems to me that you would want to use Scipy's Hilbert transform in order to find an analytic form for the envelope. You can then generate an array for the envelope to which you can fit a Gaussian.

For the Gaussian fit there is a good answer here.