def write_catalog(detections, fname, format="<STR_LIT>"):
catalog = get_catalog(detections)<EOL>catalog.write(filename=fname, format=format)<EOL>
Write events contained within detections to a catalog file.

    :type detections: list
    :param detections: list of eqcorrscan.core.match_filter.Detection
    :type fname: str
    :param fname: Name of the file to write to
    :type format: str
    :param format: File format to use, see obspy.core.event.Catalog.write \
        for supported formats.