code: def _par_read(dirname, compressed=True):
      
      templates = []
      if compressed:
          arc = tarfile.open(dirname, "r:*")
          members = arc.getmembers()
          _parfile = [member for member in members
                      if member.name.split(os.sep)[-1] ==
                      'template_parameters.csv']
          if len(_parfile) == 0:
              arc.close()
              raise MatchFilterError(
                  'No template parameter file in archive')
          parfile = arc.extractfile(_parfile[0])
      else:
          parfile = open(dirname + '/' + 'template_parameters.csv', 'r')
      for line in parfile:
          t_in = Template()
          for key_pair in line.rstrip().split(','):
              if key_pair.split(':')[0].strip() == 'name':
                  t_in.__dict__[key_pair.split(':')[0].strip()] = \
                      key_pair.split(':')[-1].strip()
              elif key_pair.split(':')[0].strip() == 'filt_order':
                  try:
                      t_in.__dict__[key_pair.split(':')[0].strip()] = \
                          int(key_pair.split(':')[-1])
                  except ValueError:
                      pass
              else:
                  try:
                      t_in.__dict__[key_pair.split(':')[0].strip()] = \
                          float(key_pair.split(':')[-1])
                  except ValueError:
                      pass
          templates.append(t_in)
      parfile.close()
      if compressed:
          arc.close()
      return templates
docs: Internal write function to read a formatted parameter file.
  
      :type dirname: str
      :param dirname: Directory to read the parameter file from.
      :type compressed: bool
      :param compressed: Whether the directory is compressed or not.