def remnant_mass_ulim(eta, ns_g_mass, bh_spin_z, ns_sequence, max_ns_g_mass, shift):
    """
    Function that determines the maximum remnant disk mass
    for an NS-BH system with given symmetric mass ratio,
    NS mass, and BH spin parameter component along the
    orbital angular momentum.  This is a wrapper to
    the function remnant_mass.  Maximization is achieved
    by setting the BH dimensionless spin magntitude to unity.
    An unreasonably large remnant disk mass (100 solar masses)
    is returned if the maximum possible NS mass is exceeded
    in applying the model of Foucart PRD 86, 124007 (2012).

    Parameters
    -----------
    eta: float
        the symmetric mass ratio of the binary
    ns_g_mass: float
        NS gravitational mass (in solar masses)
    bh_spin_z: float
        the BH dimensionless spin parameter for the spin projection
        along the orbital angular momentum
    ns_sequence: 3D-array
        contains the sequence data in the form NS gravitational
         mass (in solar masses), NS baryonic mass (in solar
         masses), NS compactness (dimensionless)
    shift: float
        an amount to be subtracted to the remnant mass upper limit
        predicted by the model (in solar masses)

    Returns
    ----------
    remnant_mass_upper_limit: float
        The remnant mass upper limit in solar masses
    """
    # Sanity checks
    if not (eta > 0. and eta <=0.25 and abs(bh_spin_z)<=1):
        raise Exception("""The absolute value of the BH spin z-component must be <=1.
           Eta must be between 0 and 0.25.
           The function remnant_mass_ulim was launched with eta={0} and chi_z={1}.
           Unphysical parameters!""".format(eta, bh_spin_z))
    # To maximise the remnant mass, allow for the BH spin magnitude to be maximum
    bh_spin_magnitude = 1.
    # Unreasonably large remnant disk mass
    default_remnant_mass = 100.
    if not ns_g_mass > max_ns_g_mass:
        bh_spin_inclination = np.arccos(bh_spin_z/bh_spin_magnitude)
        remnant_mass_upper_limit = pycbc.tmpltbank.em_progenitors.remnant_mass(eta, ns_g_mass, ns_sequence, bh_spin_magnitude, bh_spin_inclination, shift)
    else:
        remnant_mass_upper_limit = default_remnant_mass

    return remnant_mass_upper_limit