code: def get_catalog(detections):
      
      catalog = Catalog()
      for detection in detections:
          if detection.event:
              catalog.append(detection.event)
      return catalog
docs: Generate an :class:`obspy.core.event.Catalog` from list of \
      :class:`Detection`'s.
  
      :type detections: list
      :param detections: list of :class:`eqcorrscan.core.match_filter.Detection`
  
      :returns: Catalog of detected events.
      :rtype: :class:`obspy.core.event.Catalog`
  
      .. warning::
          Will only work if the detections have an event associated with them.
          This will not be the case if detections have been written to csv
          format using :func:`eqcorrscan.core.match_filter.Detection.write`
          and read back in.