def METHOD_NAME(fname, compname, steps):
    ds = yt.load(fname)
    dt = ds.current_time.to_value()/steps
    z = np.linspace(
        ds.domain_left_edge[0].v,
        ds.domain_right_edge[0].v,
        ds.domain_dimensions[0])
    # Compute the theory for envelope
    env_theory = gauss_env(+t_c-ds.current_time.to_value(), z)+gauss_env(-t_c+ds.current_time.to_value(),z)
    # Read laser field in PIC simulation, and compute envelope
    all_data_level_0 = ds.covering_grid(level=0,left_edge=ds.domain_left_edge, dims=ds.domain_dimensions)
    F_laser = all_data_level_0['boxlib', 'Ey'].v.squeeze()
    env = abs(hilbert(F_laser))
    # Plot results
    plt.figure(figsize=(8,8))
    plt.subplot(221)
    plt.title('PIC field')
    plt.plot(z, F_laser)
    plt.subplot(222)
    plt.title('PIC envelope')
    plt.plot(z, env)
    plt.subplot(223)
    plt.title('Theory envelope')
    plt.plot(z,env_theory)
    plt.subplot(224)
    plt.title('Difference')
    plt.plot(z,env-env_theory)
    plt.tight_layout()
    plt.savefig(compname, bbox_inches='tight')
    relative_error_env = np.sum(np.abs(env-env_theory)) / np.sum(np.abs(env))
    print("Relative error envelope: ", relative_error_env)
    assert(relative_error_env < relative_error_threshold)
    fft_F_laser = np.fft.fftn(F_laser)
    freq_z = np.fft.fftfreq(F_laser.shape[0],dt)
    pos_max = np.unravel_index(np.abs(fft_F_laser).argmax(), fft_F_laser.shape)
    freq = np.abs(freq_z[pos_max[0]])
    exp_freq = c/wavelength
    relative_error_freq = np.abs(freq-exp_freq)/exp_freq
    print("Relative error frequency: ", relative_error_freq)
    assert(relative_error_freq < relative_error_threshold)