#        Z *= np.exp(1j*(5.*8./360.*2.*np.pi)) #phasing of reference offset
        Z *= np.exp(1j * np.pi / 180. * phas_corr)
        R = np.sqrt(Z.real**2 + Z.imag**2)
        Phi = np.angle(Z, deg=False)

        # Create theoretical curve
        #        if draw_theory:
        #Ttheo = np.linspace(T[0],T[-1], 1000)
        Xtd, Ytd, Xt, Yt = fk.Curve(l_trans, l_ref, harmonic, phi,
                                    a * max(abs(Z)), offset, T[0], T[-1], 1000)

        delay = T

        T_d, X_d, Y_d = fk.CutDataSet(T, Z.real, Z.imag, data_window)
        Z_cut = X_d + 1j * Y_d
        Z_cut = fk.Phasing_TD(Z_cut, T_d, E_r)
        scaling = 1E-4  #max(Z.real)/max(Ttheo)

        # Fourier traffo
        Td = np.mean(np.unique(np.diff(T)))
        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,
E_fano = np.linspace(0,E_r+30,500000)

fano_resonance = fk.fano(E_fano,E_r,q,gamma,1.,-1.)
I_fano_theo = np.conjugate(np.fft.fftshift(np.fft.fft(fano_resonance)))
t_fano_theo = 1e15*spc.h/spc.e* np.fft.fftshift(np.fft.fftfreq(len(fano_resonance),E_fano[1]-E_fano[0]))
#adjusting data window
if data_window[0]==0.:
    low = int(len(t_fano_theo)/2)
else:
    low = np.max(np.argwhere(t_fano_theo<data_window[0]))
high = np.min(np.argwhere(t_fano_theo>data_window[1]))
t_fano_theo = t_fano_theo[low:high] 
t_fano_theo = t_fano_theo[::-1]
I_fano_theo = I_fano_theo[low:high]
I_fano_theo = I_fano_theo[::-1]
I_fano_theo = fk.Phasing_TD(I_fano_theo,data_window,E_r) #time domain phasing of theoretical dipole response so it starts with Im(d(t))=-1 at beginning of data_window in case of a lorenzian line shape

   

#==============================================================================
# ''' Resolution from Data window '''
#==============================================================================
print('The resolution from the data window length is {} eV'.format(spc.h/(abs(data_window[-1]-data_window[0])*1E-15*spc.e)))

#==============================================================================
# ''' i0 correction for different harmonic contents of i0 '''
#==============================================================================
i0_fft = data['LDM']['i0_fft']
i0_0H = np.sum(i0_fft[::,395:405],axis=1)
i0_1H = np.sum(i0_fft[::,443:453],axis=1)
i0_2H = np.sum(i0_fft[::,492:502],axis=1)
示例#3
0
t_theo_seed = np.linspace(-250, 250, 5000)
sl_AC = np.exp(-4.0 * np.log(2) * (t_theo_seed /
                                   (sl_fwhm * np.sqrt(2)))**2)  # seed laser AC
sl_AC /= np.max(sl_AC)

# =============================================================================
# spectrogram
# =============================================================================

#analysing 5H
Z5 = Z[4]
Z5 *= np.exp(1j * np.pi / 180. * phas_corr)  #phasing data

T_d, X_d, Y_d = fk.CutDataSet(T, Z5.real, Z5.imag, data_window)
Z5_cut = X_d + 1j * Y_d
Z5_cut = fk.Phasing_TD(Z5_cut, T_d, E_r - E_undersamp)
scaling = 1E-4  #max(Z.real)/max(Ttheo)

# Fourier traffo
Td = np.mean(np.unique(np.diff(T)))
if gauss:
    Z5g = fk.GaussWindow(T_d, Z5_cut, suscept)
    wn, dft = fk.DFT(T_d,
                     Z5g,
                     Td,
                     l_ref,
                     harmonic,
                     zeroPaddingFactor=zeroPaddingFactor)
else:
    wn, dft = fk.DFT(T_d,
                     Z5_cut,