X = Z.real X_s = Z_s.real Y = Z.imag Y_s = Z_s.imag T_d, X_d, Y_d = fk.CutDataSet(T, X, Y, data_window) Z = X_d + 1j * Y_d scaling = 1E-4 #max(Z.real)/max(Ttheo) # Fourier traffo Zg = fk.GaussWindow(T_d, Z, suscept) Td = T[1] - T[0] if gauss: wn, dft = fk.DFT(T_d, Zg, Td, l_ref, harmonic, zeroPaddingFactor=zeroPaddingFactor) else: wn, dft = fk.DFT(T_d, Z, Td, l_ref, harmonic, zeroPaddingFactor=zeroPaddingFactor) FWHM, peakFullWidth = fk.PeakWidth(T, 0.1, False, zeroPaddingFactor) FWHM = FWHM # theoretical spectrum center = 1E7 * (1 / l_fel - 1 / l_ref) * mfli_harmonic + harmonic * 1E7 / l_ref
Y_s = Z_s.imag #print T T_d = T[:] X_d = X[:] Y_d = Y[:] T_d, X_d, Y_d = fk.CutDataSet(T, X, Y, data_window) Z = X_d + 1j * Y_d # Fourier traffo Zg = fk.GaussWindow(T_d, Z, False) Td = T[1] - T[0] wn, dft = fk.DFT(T_d, Zg, Td, l_ref, harmonic, zeroPaddingFactor=zeroPaddingFactor) FWHM, peakFullWidth = fk.PeakWidth(T, 0.1, False, zeroPaddingFactor) FWHM = FWHM #print(FWHM) # Plot time domain figTD = plt.figure('scan_{0}_{1}_d{2}_TD_{3}'.format( run, dev, d, i), figsize=(9, 12)) ax = figTD.add_subplot(511) ax.set_title('scan_{0}_{1}_d{2}_TD_{3}'.format(run, dev, d, i)) ax.errorbar(delay, X, yerr=X_s, color='b', linestyle='')
Xtd,Ytd,Xt,Yt = fk.Curve(spc.h*spc.c/(spc.e*l_trans)*1e9, l_ref, harmonic, phi, a*max(abs(Z)), offset, delay[0], delay[-1], 30000) # theo curve for transition Xtd,Ytd,Xt,Yt = fk.Curve(l_fel/harmonic, l_ref, harmonic, phi, a*max(abs(Z)), offset, delay[0], delay[-1], 30000) # theo curve for laser CWL T_d,X_d,Y_d = fk.CutDataSet(delay, Z.real, Z.imag, data_window) Z_cut = X_d + 1j*Y_d Z_plot = Z_cut Z_cut = fk.Phasing_TD(Z_cut,T_d,E_r) #time domain phasing of data set to take into account position of data window scaling = 1 #max(Z.real)/max(Ttheo) # Fourier traffo Td = np.mean(np.unique(np.diff(delay))) if gauss: Zg = fk.GaussWindow(T_d, Z_cut, suscept) wn, dft = fk.DFT(T_d, Zg, Td, l_ref , harmonic, zeroPaddingFactor = zeroPaddingFactor) else: wn, dft = fk.DFT(T_d, Z_cut, Td, l_ref , harmonic, zeroPaddingFactor = zeroPaddingFactor) # dft = dft[::-1] FWHM , peakFullWidth = fk.PeakWidth(T_d, 0.05, False, zeroPaddingFactor) #Fouriert Trafo of the theoretical dataset wn_theo, dft_theo = fk.DFT(t_fano_theo, I_fano_theo, t_fano_theo[1]-t_fano_theo[0], l_ref , harmonic, zeroPaddingFactor = zeroPaddingFactor) ''' Fitting the dephasing for 6th harmonic R''' def decay(t,amp,tau): return amp*np.exp(-t/tau) + 0.001828 def decay_theo(t,amp,tau): return amp*np.exp(-t/tau)
T_d, X_d, Y_d = fk.CutDataSet(delay, Z.real, Z.imag, data_window) Z_cut = X_d + 1j * Y_d Z_cut = fk.Phasing_TD( Z_cut, data_window, E_r ) #time domain phasing of data set to take into account position of data window scaling = 1 #max(Z.real)/max(Ttheo) # Fourier traffo Td = np.mean(np.unique(np.diff(delay))) # print Td if gauss: Zg = fk.GaussWindow(T_d, Z_cut, suscept) wn, dft = fk.DFT(T_d, Zg, Td, l_ref, harmonic, zeroPaddingFactor=zeroPaddingFactor) else: wn, dft = fk.DFT(T_d, Z_cut, Td, l_ref, harmonic, zeroPaddingFactor=zeroPaddingFactor) # dft = dft[::-1] FWHM, peakFullWidth = fk.PeakWidth(T_d, 0.1, False, zeroPaddingFactor) #Fouriert Trafo of the theoretical dataset wn_theo, dft_theo = fk.DFT(t_fano_theo, I_fano_theo,