def theoretical_vlbi_integration_time_homogeneous(Sensitivity_Jybm, SEFD_Jy, eta, Nstations, BW_total_Hz, pol='dual'):
    """
    Calculates the integration time required to achieve a given image sensitivity, for homogeneous antennae.
    Essentially inverting the equation in vlbi_image_sensitivity_homogeneous(): \n
    t_int_sec = (SEFD_Jy/(sqrt(#polarizations)*Sensitivity_Jybm*eta))^2 * 1./(N*(N-1)*BW_total_Hz)
    
    Parameters
    ----------
    Sensitivity_Jybm : float
        Image sensitivity, in Jy/beam
    SEFD_Jy : float
        System equivalent flux density, in units of Jansky
    eta : float 
        System inefficiency, in range [0,1]
    Nstations : int
        Number of homogeneous observing stations in the array
    BW_total_Hz : float
        Bandwidth in Hz in a single polarization
    pol : str
        Polarization descriptor.  ['single','r','l','x','y','1'] for single polarization, ['dual','full','rl','lr','xy','yx','2'] for dual polarization.
    
    Returns
    -------
    t_int_sec : float 
        The total integration time on source in seconds
    
    Example
    -------
    #To achieve 25 uJy/bm for VLBA obs at 5.0GHz (C-band,SEFD=210Jy), dual pol, 512MHz/pol, for eta=0.8: \n
    #t_int = (210/(np.sqrt(2)*25e-6*0.8))**2 / (10*(10-1)*512e6)  = 1196sec, or 0.33 hrs or 20 min \n
    obs.theoretical_vlbi_integration_time_homogeneous(25e-6,210,0.8,10,512e6,pol='dual') #--> 1196.29
    """
    if pol.lower() in ['single','r','l','x','y']: nr_pols=1
    elif pol.lower() in ['dual','full','rl','lr','xy','yx']: nr_pols=2
    else: raise Exception('theoretical_vlbi_integration_time_homogeneous(): pol="%s" is invalid'%(pol))
    t_int_sec = (SEFD_Jy/(Sensitivity_Jybm*eta))**2. * 1./(Nstations*(Nstations-1)*BW_total_Hz*nr_pols)
    return t_int_sec