def test_est_disp(): ds = TimeResSpec(wl, t, data) ds.auto_plot = False for s in ['abs', 'diff', 'gauss_diff', 'max']: ds.estimate_dispersion(heuristic=s)
# Evidently, the dataset is not corrected for dispersion. Since it is easier to # work with a dispersion corrected dataset, we try to estimate the # dispersion using the data directly. # # Dispersion estimation and correction # ------------------------------------ # *skultrafast* does this by first using a simple heuristic for determining the time- # zero for each transient. The resulting dispersion curve is then fitted with a poly- # nominal, using a robust fitting method. More details are given in the documentation. # # To estimate the dispersion just call the function. It will plot two colormaps, one # with the original dataset, the time-zeros found by the heuristic and the robust # polynomial fit of these values. The bottom color map shows the dispersion corrected # data. res = ds.estimate_dispersion(heuristic_args=(1.5,), deg=3) # %% # By default, *skultrafast* uses a very simple heuristic to find the time-zero. # It looks for the earliest value above a given limit in each transient, and # therefore underestimates the time-zero systematically. Therefore we slightly # shift the time-zero. # # This generally works surprisingly well. But if the exact time-zero is # necessary, I recommend to try other methods or measure the dispersion # directly. # # **WARNING**: The cell below changes the dataset inplace. Therefore repeated # calls to the cell will shift the time-zero again and again. The shifting # can also be applied setting the `shift_result` parameter in the call # to `ds.estimate_dispersio`.