def read_detections(fname):
f = open(fname, '<STR_LIT:r>')<EOL>detections = []<EOL>for index, line in enumerate(f):<EOL><INDENT>if index == <NUM_LIT:0>:<EOL><INDENT>continue  <EOL><DEDENT>if line.rstrip().split('<STR_LIT>')[<NUM_LIT:0>] == '<STR_LIT>':<EOL><INDENT>continue  <EOL><DEDENT>detection = line.rstrip().split('<STR_LIT>')<EOL>detection[<NUM_LIT:1>] = UTCDateTime(detection[<NUM_LIT:1>])<EOL>detection[<NUM_LIT:2>] = int(float(detection[<NUM_LIT:2>]))<EOL>detection[<NUM_LIT:3>] = ast.literal_eval(detection[<NUM_LIT:3>])<EOL>detection[<NUM_LIT:4>] = float(detection[<NUM_LIT:4>])<EOL>detection[<NUM_LIT:5>] = float(detection[<NUM_LIT:5>])<EOL>if len(detection) < <NUM_LIT:9>:<EOL><INDENT>detection.extend(['<STR_LIT>', float('<STR_LIT>')])<EOL><DEDENT>else:<EOL><INDENT>detection[<NUM_LIT:7>] = float(detection[<NUM_LIT:7>])<EOL><DEDENT>detections.append(Detection(<EOL>template_name=detection[<NUM_LIT:0>], detect_time=detection[<NUM_LIT:1>],<EOL>no_chans=detection[<NUM_LIT:2>], detect_val=detection[<NUM_LIT:4>],<EOL>threshold=detection[<NUM_LIT:5>], threshold_type=detection[<NUM_LIT:6>],<EOL>threshold_input=detection[<NUM_LIT:7>], typeofdet=detection[<NUM_LIT:8>],<EOL>chans=detection[<NUM_LIT:3>]))<EOL><DEDENT>f.close()<EOL>return detections<EOL>
Read detections from a file to a list of Detection objects.

:type fname: str
:param fname: File to read from, must be a file written to by \
    Detection.write.

:returns: list of :class:`eqcorrscan.core.match_filter.Detection`
:rtype: list

.. note::
    :class:`eqcorrscan.core.match_filter.Detection`'s returned do not
    contain Detection.event