def calc_csd(self):
CSDarray = np.array([])<EOL>CSDdict = {}<EOL>i = <NUM_LIT:0><EOL>for y in self.y:<EOL><INDENT>fil = os.path.join(self.populations_path,<EOL>self.output_file.format(y, '<STR_LIT>'))<EOL>f = h5py.File(fil)<EOL>if i == <NUM_LIT:0>:<EOL><INDENT>CSDarray = np.zeros((len(self.y),<EOL>f['<STR_LIT:data>'].shape[<NUM_LIT:0>], f['<STR_LIT:data>'].shape[<NUM_LIT:1>]))<EOL><DEDENT>CSDarray[i, ] = f['<STR_LIT:data>'].value<EOL>CSDdict.update({y : f['<STR_LIT:data>'].value})<EOL>f.close()<EOL>i += <NUM_LIT:1><EOL><DEDENT>return CSDdict,  CSDarray.sum(axis=<NUM_LIT:0>)<EOL>
Sum all the CSD contributions from every layer.