def read(self, filename):
from struct import calcsize, unpack<EOL>if not filename is None:<EOL><INDENT>self.filename = filename<EOL><DEDENT>with open(self.filename, '<STR_LIT:rb>') as plt:<EOL><INDENT>h = self.header = self._read_header(plt)<EOL>nentries = h['<STR_LIT>'] * h['<STR_LIT>'] * h['<STR_LIT>']<EOL>datafmt = h['<STR_LIT>']+str(nentries)+self._data_bintype<EOL>a = numpy.array(unpack(datafmt, plt.read(calcsize(datafmt))))<EOL><DEDENT>self.header['<STR_LIT:filename>'] = self.filename<EOL>self.array = a.reshape(h['<STR_LIT>'], h['<STR_LIT>'], h['<STR_LIT>']).transpose()  <EOL>self.delta = self._delta()<EOL>self.origin = numpy.array([h['<STR_LIT>'], h['<STR_LIT>'], h['<STR_LIT>']]) + <NUM_LIT:0.5>*numpy.diagonal(self.delta)<EOL>self.rank = h['<STR_LIT>']<EOL>
Populate the instance from the plt file *filename*.