def read(self, filename):
tribe = Tribe()<EOL>tribe.read(filename=filename)<EOL>if len(tribe) > <NUM_LIT:1>:<EOL><INDENT>raise IOError('<STR_LIT>')<EOL><DEDENT>for key in self.__dict__.keys():<EOL><INDENT>self.__dict__[key] = tribe[<NUM_LIT:0>].__dict__[key]<EOL><DEDENT>return self<EOL>
Read template from tar format with metadata.

:type filename: str
:param filename: Filename to read template from.

.. rubric:: Example

>>> template_a = Template(
...     name='a', st=read(), lowcut=2.0, highcut=8.0, samp_rate=100,
...     filt_order=4, process_length=3600, prepick=0.5)
>>> template_a.write(
...     'test_template_read') # doctest: +NORMALIZE_WHITESPACE
Template a:
 3 channels;
 lowcut: 2.0 Hz;
 highcut: 8.0 Hz;
 sampling rate 100 Hz;
 filter order: 4;
 process length: 3600 s
>>> template_b = Template().read('test_template_read.tgz')
>>> template_a == template_b
True