def METHOD_NAME(data, component, t_env_theory, coeff, X,Z,dx,dz):
    print("*** Checking " + component + " ***")
    field = data['boxlib', component].v.squeeze()
    env = abs(hilbert(field))
    env_theory = t_env_theory*np.abs(coeff)
    # Plot results
    fig = plt.figure(figsize=(12,6))
    ax1 = fig.add_subplot(221, aspect='equal')
    ax1.set_title('PIC field')
    p1 = ax1.pcolormesh(X,Z,field)
    cax1 = make_axes_locatable(ax1).append_axes('right', size='5%', pad=0.05)
    fig.colorbar(p1, cax=cax1, orientation='vertical')
    ax2 = fig.add_subplot(222, aspect='equal')
    ax2.set_title('PIC envelope')
    p2 = ax2.pcolormesh(X,Z,env)
    cax2 = make_axes_locatable(ax2).append_axes('right', size='5%', pad=0.05)
    fig.colorbar(p2, cax=cax2, orientation='vertical')
    ax3 = fig.add_subplot(223, aspect='equal')
    ax3.set_title('Theory envelope')
    p3 = ax3.pcolormesh(X,Z,env_theory)
    cax3 = make_axes_locatable(ax3).append_axes('right', size='5%', pad=0.05)
    fig.colorbar(p3, cax=cax3, orientation='vertical')
    ax4 = fig.add_subplot(224, aspect='equal')
    ax4.set_title('Difference')
    p4 = ax4.pcolormesh(X,Z,env-env_theory)
    cax4 = make_axes_locatable(ax4).append_axes('right', size='5%', pad=0.05)
    fig.colorbar(p4, cax=cax4, orientation='vertical')
    plt.tight_layout()
    plt.savefig("plt_" + component + ".png", bbox_inches='tight')
    if(np.abs(coeff) < small_num):
        is_field_zero = np.sum(np.abs(env)) < small_num
        if is_field_zero :
            print("[OK] Field component expected to be 0 is ~ 0")
        else :
            print("[FAIL] Field component expected to be 0 is NOT ~ 0")
        assert(is_field_zero)
        print("******\n")
        return
    relative_error_env = np.sum(np.abs(env-env_theory)) / np.sum(np.abs(env_theory))
    is_env_ok = relative_error_env < relative_error_threshold
    if is_env_ok :
        print("[OK] Relative error envelope: {:6.3f} %".format(relative_error_env*100))
    else :
        print("[FAIL] Relative error envelope: {:6.3f} %".format(relative_error_env*100))
    assert(is_env_ok)
    fft_field = np.fft.fft2(field)
    freq_rows = np.fft.fftfreq(fft_field.shape[0],dx/c)
    freq_cols = np.fft.fftfreq(fft_field.shape[1],dz/c)
    pos_max = np.unravel_index(np.abs(fft_field).argmax(), fft_field.shape)
    freq = np.sqrt((freq_rows[pos_max[0]])**2 + (freq_cols[pos_max[1]]**2))
    exp_freq = c/wavelength
    relative_error_freq = np.abs(freq-exp_freq)/exp_freq
    is_freq_ok = relative_error_freq < relative_error_threshold
    if is_freq_ok :
        print("[OK] Relative error frequency: {:6.3f} %".format(relative_error_freq*100))
    else :
        print("[FAIL] Relative error frequency: {:6.3f} %".format(relative_error_freq*100))
    assert(is_freq_ok)
    print("******\n")