def collect_data(self):
<EOL>for measure in ['<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>if measure in self.savelist:<EOL><INDENT>self.collectSingleContribs(measure)<EOL><DEDENT><DEDENT>lfp = self.calc_signal_sum(measure='<STR_LIT>')<EOL>if self.calculateCSD:<EOL><INDENT>csd = self.calc_signal_sum(measure='<STR_LIT>')<EOL><DEDENT>if RANK == <NUM_LIT:0> and self.POPULATION_SIZE > <NUM_LIT:0>:<EOL><INDENT>if '<STR_LIT>' in self.savelist:<EOL><INDENT>fname = os.path.join(self.populations_path,<EOL>self.output_file.format(self.y,<EOL>'<STR_LIT>')+'<STR_LIT>')<EOL>f = h5py.File(fname, '<STR_LIT:w>')<EOL>f['<STR_LIT>'] = <NUM_LIT> / self.dt_output<EOL>f.create_dataset('<STR_LIT:data>', data=lfp, compression=<NUM_LIT:4>)<EOL>f.close()<EOL>del lfp<EOL>assert(os.path.isfile(fname))<EOL>print('<STR_LIT>')<EOL><DEDENT>if '<STR_LIT>' in self.savelist and self.calculateCSD:<EOL><INDENT>fname = os.path.join(self.populations_path,<EOL>self.output_file.format(self.y,<EOL>'<STR_LIT>')+'<STR_LIT>')<EOL>f = h5py.File(fname, '<STR_LIT:w>')<EOL>f['<STR_LIT>'] = <NUM_LIT> / self.dt_output<EOL>f.create_dataset('<STR_LIT:data>', data=csd, compression=<NUM_LIT:4>)<EOL>f.close()<EOL>del csd<EOL>assert(os.path.isfile(fname))<EOL>print('<STR_LIT>')<EOL><DEDENT>pop_soma_pos = np.zeros((self.POPULATION_SIZE, <NUM_LIT:3>))<EOL>keys = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>']<EOL>for i in range(self.POPULATION_SIZE):<EOL><INDENT>for j in range(<NUM_LIT:3>):<EOL><INDENT>pop_soma_pos[i, j] = self.pop_soma_pos[i][keys[j]]<EOL><DEDENT><DEDENT>fname = os.path.join(self.populations_path,<EOL>self.output_file.format(self.y, '<STR_LIT>'))<EOL>np.savetxt(fname, pop_soma_pos)<EOL>assert(os.path.isfile(fname))<EOL>print('<STR_LIT>')<EOL>fname = os.path.join(self.populations_path,<EOL>self.output_file.format(self.y, '<STR_LIT>'))<EOL>f = h5py.File(fname, '<STR_LIT:w>')<EOL>f.create_dataset('<STR_LIT:x>', (len(self.rotations),))<EOL>f.create_dataset('<STR_LIT:y>', (len(self.rotations),))<EOL>f.create_dataset('<STR_LIT:z>', (len(self.rotations),))<EOL>for i, rot in enumerate(self.rotations):<EOL><INDENT>for key, value in list(rot.items()):<EOL><INDENT>f[key][i] = value<EOL><DEDENT><DEDENT>f.close()<EOL>assert(os.path.isfile(fname))<EOL>print('<STR_LIT>')<EOL><DEDENT>COMM.Barrier()<EOL>
Collect LFPs, CSDs and soma traces from each simulated population,
and save to file.


Parameters
----------
None


Returns
-------
None