Beispiel #1
0
 def strain_DW(self, pars=None):
     a = P4Rm()
     self.Data4f_Refl = []
     if pars is None:
         strain = f_strain(a.ParamDict['z'],
                           a.ParamDict['_fp_min'][:self.len_sp:],
                           a.AllDataDict['damaged_depth'],
                           a.splinenumber[0])
         DW = f_DW(a.ParamDict['z'],
                   a.ParamDict['_fp_min'][self.len_sp:self.len_sp +
                   self.len_dwp:],
                   a.AllDataDict['damaged_depth'], a.splinenumber[1])
     else:
         if a.AllDataDict['model'] == 0:
             spline_DW = 5
             spline_strain = 5
         elif a.AllDataDict['model'] == 1:
             spline_DW = 6
             spline_strain = 6
         elif a.AllDataDict['model'] == 2:
             spline_DW = 4
             spline_strain = 4
         self.pars4numba(pars)
         strain = f_strain(a.ParamDict['z'], self.pars_value,
                           a.AllDataDict['damaged_depth'], spline_strain)
         DW = f_DW(a.ParamDict['z'], self.pars_value,
                   a.AllDataDict['damaged_depth'], spline_DW)
     strain.astype(np.float64)
     DW.astype(np.float64)
     self.Data4f_Refl.append(strain)
     self.Data4f_Refl.append(DW)
     self.Data4f_Refl.append(self.const)
Beispiel #2
0
 def strain_DW(self, pars=None):
     a = P4Rm()
     self.Data4f_Refl = []
     if pars is None:
         strain = f_strain(
             a.ParamDict["z"],
             a.ParamDict["_fp_min"][: self.len_sp :],
             a.AllDataDict["damaged_depth"],
             a.splinenumber[0],
         )
         DW = f_DW(
             a.ParamDict["z"],
             a.ParamDict["_fp_min"][self.len_sp : self.len_sp + self.len_dwp :],
             a.AllDataDict["damaged_depth"],
             a.splinenumber[1],
         )
     else:
         if a.AllDataDict["model"] == 0:
             spline_DW = 5
             spline_strain = 5
         elif a.AllDataDict["model"] == 1:
             spline_DW = 6
             spline_strain = 6
         elif a.AllDataDict["model"] == 2:
             spline_DW = 4
             spline_strain = 4
         self.pars4numba(pars)
         strain = f_strain(a.ParamDict["z"], self.pars_value, a.AllDataDict["damaged_depth"], spline_strain)
         DW = f_DW(a.ParamDict["z"], self.pars_value, a.AllDataDict["damaged_depth"], spline_DW)
     strain.astype(np.float64)
     DW.astype(np.float64)
     self.Data4f_Refl.append(strain)
     self.Data4f_Refl.append(DW)
     self.Data4f_Refl.append(self.const)
Beispiel #3
0
def f_Refl_Thick_Film():
    a = P4Rm()

    wl = a.AllDataDict['wavelength']
    t = a.AllDataDict['damaged_depth']
    N = a.AllDataDict['number_slices']
    t_film = a.AllDataDict['film_thick']

    G = a.ParamDict['G']
    thB_S = a.ParamDict['thB_S']
    resol = a.ParamDict['resol']
    phi = a.ConstDict['phi']
    t_l = a.ParamDict['t_l']
    z = a.ParamDict['z']
    FH = a.ParamDict['FH']
    FmH = a.ParamDict['FmH']
    F0 = a.ParamDict['F0']
    sp = a.ParamDict['sp']
    dwp = a.ParamDict['dwp']
    th = a.ParamDict['th']
    spline_DW = a.splinenumber[1]
    spline_strain = a.splinenumber[0]
    param = a.ParamDict['par']
    delta_t = t_film - t

    strain = f_strain(z, param[:len(sp):], t, spline_strain)
    DW = f_DW(z, param[len(sp):len(sp) + len(dwp):], t, spline_DW)
    thB = thB_S - strain * tan(thB_S)  # angle de Bragg dans chaque lamelle

    eta = 0
    res = 0

    g0 = sin(thB[0] - phi)  # gamma 0
    gH = -sin(thB[0] + phi)  # gamma H
    b = g0 / gH
    T = pi * G * ((FH[0] * FmH[0])**0.5) * delta_t / (wl * (abs(g0 * gH)**0.5))
    eta = (-b * (th - thB[0]) * sin(2 * thB_S) - 0.5 * G * F0[0] *
           (1 - b)) / ((abs(b)**0.5) * G * (FH[0] * FmH[0])**0.5)
    S1 = (res - eta + (eta * eta - 1)**0.5) * exp(-1j * T *
                                                  (eta * eta - 1)**0.5)
    S2 = (res - eta - (eta * eta - 1)**0.5) * exp(1j * T *
                                                  (eta * eta - 1)**0.5)
    res = (eta + ((eta * eta - 1)**0.5) * ((S1 + S2) / (S1 - S2)))

    n = 1
    while (n <= N):
        g0 = sin(thB[n] - phi)  # gamma 0
        gH = -sin(thB[n] + phi)  # gamma H
        b = g0 / gH
        T = pi * G * (
            (FH[n] * FmH[n])**0.5) * t_l * DW[n] / (wl * (abs(g0 * gH)**0.5))
        eta = (-b * (th - thB[n]) * sin(2 * thB_S) - 0.5 * G * F0[n] *
               (1 - b)) / ((abs(b)**0.5) * G * DW[n] * (FH[n] * FmH[n])**0.5)
        S1 = (res - eta + (eta * eta - 1)**0.5) * exp(-1j * T *
                                                      (eta * eta - 1)**0.5)
        S2 = (res - eta - (eta * eta - 1)**0.5) * exp(1j * T *
                                                      (eta * eta - 1)**0.5)
        res = (eta + ((eta * eta - 1)**0.5) * ((S1 + S2) / (S1 - S2)))
        n += 1
    return convolve(abs(res)**2, resol, mode='same')
Beispiel #4
0
def f_Refl_Thick_Film():
    a = P4Rm()

    wl = a.AllDataDict['wavelength']
    t = a.AllDataDict['damaged_depth']
    N = a.AllDataDict['number_slices']
    t_film = a.AllDataDict['film_thick']

    G = a.ParamDict['G']
    thB_S = a.ParamDict['thB_S']
    resol = a.ParamDict['resol']
    phi = a.ConstDict['phi']
    t_l = a.ParamDict['t_l']
    z = a.ParamDict['z']
    FH = a.ParamDict['FH']
    FmH = a.ParamDict['FmH']
    F0 = a.ParamDict['F0']
    sp = a.ParamDict['sp']
    dwp = a.ParamDict['dwp']
    th = a.ParamDict['th']
    spline_DW = a.splinenumber[1]
    spline_strain = a.splinenumber[0]
    param = a.ParamDict['par']
    delta_t = t_film - t

    strain = f_strain(z, param[:len(sp):], t, spline_strain)
    DW = f_DW(z, param[len(sp):len(sp)+len(dwp):], t, spline_DW)
    thB = thB_S - strain * tan(thB_S)  # angle de Bragg dans chaque lamelle

    eta = 0
    res = 0

    g0 = sin(thB[0] - phi)  # gamma 0
    gH = -sin(thB[0] + phi)  # gamma H
    b = g0 / gH
    T = pi * G * ((FH[0]*FmH[0])**0.5) * delta_t / (wl * (abs(g0*gH)**0.5))
    eta = (-b*(th-thB[0])*sin(2*thB_S) - 0.5*G*F0[0]*(1-b)) / ((abs(b)**0.5) * G  * (FH[0]*FmH[0])**0.5)
    S1 = (res - eta + (eta*eta-1)**0.5)*exp(-1j*T*(eta*eta-1)**0.5)
    S2 = (res - eta - (eta*eta-1)**0.5)*exp(1j*T*(eta*eta-1)**0.5)
    res = (eta + ((eta*eta-1)**0.5) * ((S1+S2)/(S1-S2)))

    n = 1
    while (n <= N):
        g0 = sin(thB[n] - phi)  # gamma 0
        gH = -sin(thB[n] + phi)  # gamma H
        b = g0 / gH
        T = pi * G * ((FH[n]*FmH[n])**0.5) * t_l * DW[n] / (wl * (abs(g0*gH)**0.5))
        eta = (-b*(th-thB[n])*sin(2*thB_S) - 0.5*G*F0[n]*(1-b)) / ((abs(b)**0.5) * G * DW[n] * (FH[n]*FmH[n])**0.5)
        S1 = (res - eta + (eta*eta-1)**0.5)*exp(-1j*T*(eta*eta-1)**0.5)
        S2 = (res - eta - (eta*eta-1)**0.5)*exp(1j*T*(eta*eta-1)**0.5)
        res = (eta + ((eta*eta-1)**0.5) * ((S1+S2)/(S1-S2)))
        n += 1
    return convolve(abs(res)**2, resol, mode='same')
Beispiel #5
0
    def f_strain_DW(self):
        a = P4Rm()
        P4Rm.ParamDict["sp"] = a.ParamDict["_fp_min"][: int(a.AllDataDict["strain_basis_func"])]
        P4Rm.ParamDict["dwp"] = a.ParamDict["_fp_min"][-1 * int(a.AllDataDict["dw_basis_func"]) :]

        P4Rm.ParamDict["DW_i"] = f_DW(
            a.ParamDict["z"], a.ParamDict["dwp"], a.AllDataDict["damaged_depth"], a.AllDataDict["model"]
        )
        P4Rm.ParamDict["strain_i"] = f_strain(
            a.ParamDict["z"], a.ParamDict["sp"], a.AllDataDict["damaged_depth"], a.AllDataDict["model"]
        )

        t = a.AllDataDict["damaged_depth"]
        self.on_shifted_sp_curves(t)
        self.on_shifted_dwp_curves(t)
Beispiel #6
0
    def f_strain_DW(self):
        a = P4Rm()
        P4Rm.ParamDict['sp'] = a.ParamDict['_fp_min'][:int(a.AllDataDict['strain_basis_func'])]
        P4Rm.ParamDict['dwp'] = a.ParamDict['_fp_min'][-1 * int(a.AllDataDict['dw_basis_func']):]

        P4Rm.ParamDict['DW_i'] = f_DW(
            a.ParamDict['z'], a.ParamDict['dwp'],
            a.AllDataDict['damaged_depth'],
            a.AllDataDict['model'])
        P4Rm.ParamDict['strain_i'] = f_strain(
            a.ParamDict['z'], a.ParamDict['sp'],
            a.AllDataDict['damaged_depth'],
            a.AllDataDict['model'])

        t = a.AllDataDict['damaged_depth']
        self.on_shifted_sp_curves(t)
        self.on_shifted_dwp_curves(t)
Beispiel #7
0
    def f_strain_DW(self):
        a = P4Rm()
        P4Rm.ParamDict['sp'] = a.ParamDict['_fp_min'][:int(a.AllDataDict['strain_basis_func'])]
        P4Rm.ParamDict['dwp'] = a.ParamDict['_fp_min'][-1*int(a.AllDataDict['dw_basis_func']):]

        P4Rm.ParamDict['DW_i'] = f_DW(
                                     a.ParamDict['z'], a.ParamDict['dwp'],
                                     a.AllDataDict['damaged_depth'],
                                     a.spline_DW)
        P4Rm.ParamDict['strain_i'] = f_strain(
                                         a.ParamDict['z'], a.ParamDict['sp'],
                                         a.AllDataDict['damaged_depth'],
                                         a.spline_strain)

        t = a.AllDataDict['damaged_depth']
        self.on_shifted_sp_curves(t)
        self.on_shifted_dwp_curves(t)
        self.draw_curves()
Beispiel #8
0
 def calc_DW(self, paths=None, choice=None):
     """
     Reading and calcul DW coefficient
     """
     if paths:
         P4Rm.DefaultDict['DW_folder'] = os.path.split(paths[0])[0]
         self.on_update_config_file('DW_folder')
     a = P4Rm()
     b = ReadFile()
     c = SaveFile4Diff()
     spline_DW = a.spline_DW
     if choice == 0:
         data = b.read_dw_xy_file(paths[0])
         if spline_DW == 2:
             t = data[0].max()
             P4Rm.ParamDict['t_l'] = t/a.AllDataDict['number_slices']
             P4Rm.ParamDict['z'] = (arange(a.AllDataDict['number_slices'] +
                                    1) * a.ParamDict['t_l'])
             P4Rm.ParamDict['depth'] = t - a.ParamDict['z']
         else:
             t = a.AllDataDict['damaged_depth']
         P4Rm.ParamDict['dwp'] = fit_input_DW(data,
                                              a.AllDataDict['dw_basis_func'],
                                              a.AllDataDict['damaged_depth'],
                                              spline_DW)
     else:
         t = a.AllDataDict['damaged_depth']
     P4Rm.ParamDictbackup['dwp'] = a.ParamDict['dwp']
     P4Rm.ParamDict['dw_basis'] = float(a.AllDataDict['strain_basis_func'])
     P4Rm.ParamDict['DW_i'] = f_strain(a.ParamDict['z'],
                                       a.ParamDict['dwp'],
                                       t, spline_DW)
     self.on_shifted_dwp_curves(t)
     P4Rm.from_calc_DW = 1
     self.draw_curves()
     if choice == 0:
         c.save_deformation('DW_file', 'DW', a.ParamDict['dwp'])
Beispiel #9
0
 def calc_DW(self, paths=None, choice=None):
     """
     Reading and calcul DW coefficient
     """
     if paths:
         P4Rm.DefaultDict['DW_folder'] = os.path.split(paths[0])[0]
         self.on_update_config_file('DW_folder')
     a = P4Rm()
     b = ReadFile()
     c = SaveFile4Diff()
     spline_DW = a.spline_DW
     if choice == 0:
         data = b.read_dw_xy_file(paths[0])
         if spline_DW == 2:
             t = data[0].max()
             P4Rm.ParamDict['t_l'] = t/a.AllDataDict['number_slices']
             P4Rm.ParamDict['z'] = (arange(a.AllDataDict['number_slices'] +
                                    1) * a.ParamDict['t_l'])
             P4Rm.ParamDict['depth'] = t - a.ParamDict['z']
         else:
             t = a.AllDataDict['damaged_depth']
         P4Rm.ParamDict['dwp'] = fit_input_DW(data,
                                              a.AllDataDict['dw_basis_func'],
                                              a.AllDataDict['damaged_depth'],
                                              spline_DW)
     else:
         t = a.AllDataDict['damaged_depth']
     P4Rm.ParamDictbackup['dwp'] = a.ParamDict['dwp']
     P4Rm.ParamDict['dw_basis'] = float(a.AllDataDict['strain_basis_func'])
     P4Rm.ParamDict['DW_i'] = f_strain(a.ParamDict['z'],
                                       a.ParamDict['dwp'],
                                       t, spline_DW)
     self.on_shifted_dwp_curves(t)
     P4Rm.from_calc_DW = 1
     self.draw_curves()
     if choice == 0:
         c.save_deformation('DW_file', 'DW', a.ParamDict['dwp'])
Beispiel #10
0
    def on_calcul_parameters(self):
        a = P4Rm()
        name = a.PathDict['Compound_name']
        name_s = a.PathDict['substrate_name']

        self.on_test_substrate()

        spline_strain = a.spline_strain
        spline_DW = a.spline_DW
        temp = [spline_strain, spline_DW]
        P4Rm.splinenumber = temp

        if a.AllDataDict['model'] != 2:
            nb_slice, dw_func = self.OnChangeBasisFunction(
                                a.AllDataDict['strain_basis_func'],
                                a.AllDataDict['dw_basis_func'],
                                spline_strain, spline_DW,
                                a.AllDataDict['number_slices'])
            a.AllDataDict['dw_basis_func'] = dw_func
            a.AllDataDict['number_slices'] = nb_slice

        if name != []:
            self.on_make_param_func()
            P4Rm.ParamDict['par'] = np.concatenate((a.ParamDict['sp'],
                                                    a.ParamDict['dwp']),
                                                   axis=0)
            x_ = a.ParamDict['th']
            param = a.ParamDict['param_func_profile']
            P4Rm.ParamDict['resol'] = a.ParamDict['func_profile'](x_, param)

            P4Rm.ParamDict['t_l'] = (a.AllDataDict['damaged_depth'] /
                                     a.AllDataDict['number_slices'])
            P4Rm.ParamDict['z'] = (arange(a.AllDataDict['number_slices']+1) *
                                   a.ParamDict['t_l'])

# =============================================================================
# Material Data
# =============================================================================
            P4Rm.ParamDict['d'], P4Rm.ParamDict['Vol'] = f_dhkl_V(
                                        a.AllDataDict['h'], a.AllDataDict['k'],
                                        a.AllDataDict['l'], a.AllDataDict['a'],
                                        a.AllDataDict['b'], a.AllDataDict['c'],
                                        a.AllDataDict['alpha'],
                                        a.AllDataDict['beta'],
                                        a.AllDataDict['gamma'])
            temp_1 = (a.ConstDict['re'] * a.AllDataDict['wavelength'] *
                      a.AllDataDict['wavelength'])
            P4Rm.ParamDict['G'] = temp_1 / (np.pi * a.ParamDict['Vol'])
            temp_2 = arcsin(a.AllDataDict['wavelength'] / (2*a.ParamDict['d']))
            P4Rm.ParamDict['thB_S'] = temp_2
            temp_3 = a.ConstDict['phi']
            P4Rm.ParamDict['g0'] = sin(a.ParamDict['thB_S'] - temp_3)
            P4Rm.ParamDict['gH'] = -sin(a.ParamDict['thB_S'] + temp_3)
            P4Rm.ParamDict['b_S'] = a.ParamDict['g0'] / a.ParamDict['gH']
            temp_4 = f_FH(a.AllDataDict['h'], a.AllDataDict['k'],
                          a.AllDataDict['l'], a.AllDataDict['wavelength'],
                          a.ParamDict['thB_S'], a.ParamDict['z'], name)
            P4Rm.ParamDict['FH'] = temp_4[0]
            P4Rm.ParamDict['FmH'] = temp_4[1]
            P4Rm.ParamDict['F0'] = temp_4[2]

# =============================================================================
# Substrate Data
# =============================================================================
            P4Rm.ParamDict['d_s'], P4Rm.ParamDict['Vol_s'] = f_dhkl_V(
                                        a.AllDataDict['h_s'],
                                        a.AllDataDict['k_s'],
                                        a.AllDataDict['l_s'],
                                        a.AllDataDict['a_s'],
                                        a.AllDataDict['b_s'],
                                        a.AllDataDict['c_s'],
                                        a.AllDataDict['alpha_s'],
                                        a.AllDataDict['beta_s'],
                                        a.AllDataDict['gamma_s'])
            temp_1 = (a.ConstDict['re'] * a.AllDataDict['wavelength'] *
                      a.AllDataDict['wavelength'])
            P4Rm.ParamDict['G_s'] = temp_1 / (np.pi * a.ParamDict['Vol_s'])
            temp_2 = arcsin(a.AllDataDict['wavelength'] /
                            (2*a.ParamDict['d_s']))
            P4Rm.ParamDict['thB_S_s'] = temp_2
            temp_3 = a.ConstDict['phi_s']
            P4Rm.ParamDict['g0_s'] = sin(a.ParamDict['thB_S_s'] - temp_3)
            P4Rm.ParamDict['gH_s'] = -sin(a.ParamDict['thB_S_s'] + temp_3)
            P4Rm.ParamDict['b_S_s'] = a.ParamDict['g0_s'] / a.ParamDict['gH_s']
            temp_4 = f_FH(a.AllDataDict['h_s'], a.AllDataDict['k_s'],
                          a.AllDataDict['l_s'],
                          a.AllDataDict['wavelength'],
                          a.ParamDict['thB_S_s'],
                          a.ParamDict['z'], name_s)
            P4Rm.ParamDict['FH_s'] = temp_4[0]
            P4Rm.ParamDict['FmH_s'] = temp_4[1]
            P4Rm.ParamDict['F0_s'] = temp_4[2]

# =============================================================================
            P4Rm.ParamDict['Ical'] = f_Refl(a.AllDataDict['geometry'])

            P4Rm.ParamDict['I_i'] = (a.ParamDict['Ical'] /
                                     a.ParamDict['Ical'].max() +
                                     a.AllDataDict['background'])
            P4Rm.ParamDict['depth'] = (a.AllDataDict['damaged_depth'] -
                                       a.ParamDict['z'])

            P4Rm.ParamDict['DW_i'] = f_DW(
                                         a.ParamDict['z'],
                                         a.ParamDict['dwp'],
                                         a.AllDataDict['damaged_depth'],
                                         spline_DW)
            P4Rm.ParamDict['strain_i'] = f_strain(
                                             a.ParamDict['z'],
                                             a.ParamDict['sp'],
                                             a.AllDataDict['damaged_depth'],
                                             spline_strain)
            t = a.AllDataDict['damaged_depth']

            if a.AllDataDict['damaged_depth'] > 0:
                self.on_shifted_sp_curves(t)
                self.on_shifted_dwp_curves(t)
            self.draw_curves()
        else:
            msg_ = "check if the structure file really exists"
            logger.log(logging.WARNING, msg_)
Beispiel #11
0
    def on_calcul_parameters(self):
        a = P4Rm()
        name = a.PathDict['Compound_name']
        name_s = a.PathDict['substrate_name']

        self.on_test_substrate()

        spline_strain = a.spline_strain
        spline_DW = a.spline_DW
        temp = [spline_strain, spline_DW]
        P4Rm.splinenumber = temp

        if a.AllDataDict['model'] != 2:
            nb_slice, dw_func = self.OnChangeBasisFunction(
                                a.AllDataDict['strain_basis_func'],
                                a.AllDataDict['dw_basis_func'],
                                spline_strain, spline_DW,
                                a.AllDataDict['number_slices'])
            a.AllDataDict['dw_basis_func'] = dw_func
            a.AllDataDict['number_slices'] = nb_slice

        if name != []:
            self.on_make_param_func()
            P4Rm.ParamDict['par'] = np.concatenate((a.ParamDict['sp'],
                                                    a.ParamDict['dwp']),
                                                   axis=0)
            x_ = a.ParamDict['th']
            param = a.ParamDict['param_func_profile']
            P4Rm.ParamDict['resol'] = a.ParamDict['func_profile'](x_, param)

            P4Rm.ParamDict['t_l'] = (a.AllDataDict['damaged_depth'] /
                                     a.AllDataDict['number_slices'])
            P4Rm.ParamDict['z'] = (arange(a.AllDataDict['number_slices']+1) *
                                   a.ParamDict['t_l'])

# =============================================================================
# Material Data
# =============================================================================
            P4Rm.ParamDict['d'], P4Rm.ParamDict['Vol'] = f_dhkl_V(
                                        a.AllDataDict['h'], a.AllDataDict['k'],
                                        a.AllDataDict['l'], a.AllDataDict['a'],
                                        a.AllDataDict['b'], a.AllDataDict['c'],
                                        a.AllDataDict['alpha'],
                                        a.AllDataDict['beta'],
                                        a.AllDataDict['gamma'])
            temp_1 = (a.ConstDict['re'] * a.AllDataDict['wavelength'] *
                      a.AllDataDict['wavelength'])
            P4Rm.ParamDict['G'] = temp_1 / (np.pi * a.ParamDict['Vol'])
            temp_2 = arcsin(a.AllDataDict['wavelength'] / (2*a.ParamDict['d']))
            P4Rm.ParamDict['thB_S'] = temp_2
            temp_3 = a.ConstDict['phi']
            P4Rm.ParamDict['g0'] = sin(a.ParamDict['thB_S'] - temp_3)
            P4Rm.ParamDict['gH'] = -sin(a.ParamDict['thB_S'] + temp_3)
            P4Rm.ParamDict['b_S'] = a.ParamDict['g0'] / a.ParamDict['gH']
            temp_4 = f_FH(a.AllDataDict['h'], a.AllDataDict['k'],
                          a.AllDataDict['l'], a.AllDataDict['wavelength'],
                          a.ParamDict['thB_S'], a.ParamDict['z'], name)
            P4Rm.ParamDict['FH'] = temp_4[0]
            P4Rm.ParamDict['FmH'] = temp_4[1]
            P4Rm.ParamDict['F0'] = temp_4[2]

# =============================================================================
# Substrate Data
# =============================================================================
            P4Rm.ParamDict['d_s'], P4Rm.ParamDict['Vol_s'] = f_dhkl_V(
                                        a.AllDataDict['h_s'],
                                        a.AllDataDict['k_s'],
                                        a.AllDataDict['l_s'],
                                        a.AllDataDict['a_s'],
                                        a.AllDataDict['b_s'],
                                        a.AllDataDict['c_s'],
                                        a.AllDataDict['alpha_s'],
                                        a.AllDataDict['beta_s'],
                                        a.AllDataDict['gamma_s'])
            temp_1 = (a.ConstDict['re'] * a.AllDataDict['wavelength'] *
                      a.AllDataDict['wavelength'])
            P4Rm.ParamDict['G_s'] = temp_1 / (np.pi * a.ParamDict['Vol_s'])
            temp_2 = arcsin(a.AllDataDict['wavelength'] /
                            (2*a.ParamDict['d_s']))
            P4Rm.ParamDict['thB_S_s'] = temp_2
            temp_3 = a.ConstDict['phi_s']
            P4Rm.ParamDict['g0_s'] = sin(a.ParamDict['thB_S_s'] - temp_3)
            P4Rm.ParamDict['gH_s'] = -sin(a.ParamDict['thB_S_s'] + temp_3)
            P4Rm.ParamDict['b_S_s'] = a.ParamDict['g0_s'] / a.ParamDict['gH_s']
            temp_4 = f_FH(a.AllDataDict['h_s'], a.AllDataDict['k_s'],
                          a.AllDataDict['l_s'],
                          a.AllDataDict['wavelength'],
                          a.ParamDict['thB_S_s'],
                          a.ParamDict['z'], name_s)
            P4Rm.ParamDict['FH_s'] = temp_4[0]
            P4Rm.ParamDict['FmH_s'] = temp_4[1]
            P4Rm.ParamDict['F0_s'] = temp_4[2]

# =============================================================================
            P4Rm.ParamDict['Ical'] = f_Refl(a.AllDataDict['geometry'])

            P4Rm.ParamDict['I_i'] = (a.ParamDict['Ical'] /
                                     a.ParamDict['Ical'].max() +
                                     a.AllDataDict['background'])
            P4Rm.ParamDict['depth'] = (a.AllDataDict['damaged_depth'] -
                                       a.ParamDict['z'])

            P4Rm.ParamDict['DW_i'] = f_DW(
                                         a.ParamDict['z'],
                                         a.ParamDict['dwp'],
                                         a.AllDataDict['damaged_depth'],
                                         spline_DW)
            P4Rm.ParamDict['strain_i'] = f_strain(
                                             a.ParamDict['z'],
                                             a.ParamDict['sp'],
                                             a.AllDataDict['damaged_depth'],
                                             spline_strain)
            t = a.AllDataDict['damaged_depth']

            if a.AllDataDict['damaged_depth'] > 0:
                self.on_shifted_sp_curves(t)
                self.on_shifted_dwp_curves(t)
            self.draw_curves()
        else:
            msg_ = "check if the structure file really exists"
            logger.log(logging.WARNING, msg_)