def read(self, filename):
f = h5py.File(filename, "<STR_LIT:r>")<EOL>self.data = []<EOL>for i in range(f['<STR_LIT:data>'].attrs['<STR_LIT>']):<EOL><INDENT>self.data.append(f['<STR_LIT:data>']['<STR_LIT>' + str(i)].value)<EOL><DEDENT>self.u = []<EOL>for i in range(f['<STR_LIT:u>'].attrs['<STR_LIT>']):<EOL><INDENT>self.u.append(f['<STR_LIT:u>']['<STR_LIT>' + str(i)].value)<EOL><DEDENT>self.sigma = []<EOL>for i in range(f['<STR_LIT>'].attrs['<STR_LIT>']):<EOL><INDENT>self.sigma.append(f['<STR_LIT>']['<STR_LIT>' + str(i)].value)<EOL><DEDENT>self.v = []<EOL>for i in range(f['<STR_LIT:v>'].attrs['<STR_LIT>']):<EOL><INDENT>self.v.append(f['<STR_LIT:v>']['<STR_LIT>' + str(i)].value)<EOL><DEDENT>self.stachans = [tuple(stachan.decode('<STR_LIT:ascii>').split('<STR_LIT:.>'))<EOL>for stachan in f['<STR_LIT>'].value]<EOL>self.dimension = f['<STR_LIT:data>'].attrs['<STR_LIT>']<EOL>self.filt_order = f['<STR_LIT:data>'].attrs['<STR_LIT>']<EOL>self.highcut = f['<STR_LIT:data>'].attrs['<STR_LIT>']<EOL>self.lowcut = f['<STR_LIT:data>'].attrs['<STR_LIT>']<EOL>self.multiplex = bool(f['<STR_LIT:data>'].attrs['<STR_LIT>'])<EOL>self.sampling_rate = f['<STR_LIT:data>'].attrs['<STR_LIT>']<EOL>if isinstance(f['<STR_LIT:data>'].attrs['<STR_LIT:name>'], str):<EOL><INDENT>self.name = f['<STR_LIT:data>'].attrs['<STR_LIT:name>']<EOL><DEDENT>else:<EOL><INDENT>self.name = f['<STR_LIT:data>'].attrs['<STR_LIT:name>'].decode('<STR_LIT:ascii>')<EOL><DEDENT>return self<EOL>
Read detector from a file, must be HDF5 format.

Reads a Detector object from an HDF5 file, usually created by \
eqcorrscan.

:type filename: str
:param filename: Filename to save the detector to.