def METHOD_NAME(T,X,Y,opt):
    """Compute the electric field for a Gaussian laser pulse.
       This is used to write the binary input file.
    """
    k0 = 2.0*np.pi/wavelength
    inv_tau2 = 1./tt/tt
    osc_phase = k0*c*(T-t_c)
    diff_factor = 1.0 + 1.0j* foc_dist * 2/(k0*w0*w0)
    inv_w_2 = 1.0/(w0*w0*diff_factor)
    pre_fact = np.exp(1.0j * osc_phase)
    if opt == '3d':
        pre_fact = pre_fact/diff_factor
    else:
        pre_fact = pre_fact/np.sqrt(diff_factor)
    exp_arg = - (X*X + Y*Y)*inv_w_2 - inv_tau2 * (T-t_c)*(T-t_c)
    return np.real(pre_fact * np.exp(exp_arg))