OxIonics / ionics_fits

Small python fitting library with an emphasis on Atomic Molecular and Optical Physics
Apache License 2.0
1 stars 0 forks source link

fix spectrum-based estimates #23

Closed hartytp closed 1 year ago

hartytp commented 1 year ago

Re the last point: at some point I'd like to understand the theory around the various ways of calculating spectra for signals. For present-purposes though I spent 10 minutes playing. The tests use regularly-spaced points (np.linspace) so I generated a random sampling according to x = np.sort(random.sample(list(x), int(x.size/3))). Then I looked at the spectra from both the FFT (using the mean spacing between points to generate a frequency axis) and the LS periodogram. The FFT was consistently easier to interpret and the heuristics based on it seemed to work robustly -- they got pretty much everything right so long as I could see a feature by squinting hard!

So, pending some deeper thinking on this front, let's move the heuristics over to an appropriately normalized FFT and move on. The real test will be when people start throwing lab data at this code anyway, so let's not over think things too much until we've seen how that goes!

To fix:

hartytp commented 1 year ago

fixed in 577de0653fbf86e638ebd2b37b24a07b1e254b99