def random_background_template_with_FWHM(background_dataset, FWHM, cosmic=0):
    """
    Parameters:
    -----------
        background_dataset : dataframe
            contains the background template data
        FWHM : float
            Desired FWHM parameter
        cosmic : bool (optional)
            Choice to include cosmic radiation
    Returns:
    --------
        random_background_spectrum : vector
            The full background spectrum template
    """

    background_choices = background_dataset[
        (background_dataset['fwhm'] == FWHM) &
        (background_dataset['cosmic'] == cosmic)]
    random_background = background_choices.sample()
    random_background_spectrum = random_background.values[0][3:]

    return random_background_spectrum