I am working on a spectroscopy project in which we adjust the wavelength of a laser and get some counts on the detector from some laser-atom interactions. The data that we have is in the form: $(\lambda$, $dt$, $dN)$, where $dt$ is a time interval, $\lambda$ is the laser wavelength used in that time interval, and $dN$ is the number of events in that time interval.
I need to make a plot of the event rate ($\frac{dN}{dt}$) vs wavelength, and fit it with a Voigt profile. The wavelength is scanned over a long range. However, each individual wavelength is scanned for a short period of time i.e. $dt$ is small, but the difference between 2 consecutive wavelengths is small too. For example, an entry could be $(10000 cm^{-1},0.01 s, 2)$ and the next one could be $(10000.1 cm^{-1},0.01 s,3)$.
I need a bit of help related to how to do the fit properly and get a meaningful number for the peak of the Voigt profile. Given the numbers, it seems that I need to re-bin the data in frequency space (I might use frequency, wavelength or wavenumber interchangeably, what I mean is the x axis which in my case has units of $cm^{-1}$, sorry for that).
Is this a good thing to do? And how should I do the re-binning, as I get slightly different results for each re-binning. Right now I have the value of the peak for several (15) different binnnings, which are quite close, yet a bit different, for example: $11001.5 \pm 0.2$ and $11001.4 \pm 0.3$, where the error is given by the fitting program (I guess it is the standard deviation associated with the best estimate of the parameters, but I can check in more details if needed; I use lmfit in python).
I was thinking to use the mean of these as the reported value, but I am not sure what to use for the error. These numbers are clearly not independent (i.e the value of the peak when I double the bin size is not independent of the value before that, right?) so I can't just use $\sigma/\sqrt{N}$ for the error on mean.
Also how should I take into account the error on each measurement (the $0.2$ and $0.3$ in my examples above)? Or should I try a totally different approach? Any suggestion would be greatly appreciated. Thank you!