def generate_ftb_line(frequency, shots, **kwargs):
    """ Function that generates an FTB file for a list of
        frequencies, plus categorization tests.

        kwargs are passed as additional options for the ftb
        batch. Keywords are:

        magnet: bool
        dipole: float
        atten: int
        skiptune: bool
        drfreq: float
        drpower: int
        cal

        parameters:
        ---------------
        :param frequency: float for frequency in MHz
        :param shots: int number of shots to integrate for

        returns:
        ---------------
        :return ftbline: str
    """
    line = "ftm:{:.4f} shots:{}".format(frequency, shots)
    for key, value in kwargs.items():
        line += " {}:{}".format(key, value)
    line += "\n"
    return line