def cellsim(self, cellindex, return_just_cell = False):
tic = time()<EOL>cell = LFPy.Cell(**self.cellParams)<EOL>cell.set_pos(**self.pop_soma_pos[cellindex])<EOL>cell.set_rotation(**self.rotations[cellindex])<EOL>if return_just_cell:<EOL><INDENT>allsecnames = []<EOL>allsec = []<EOL>for sec in cell.allseclist:<EOL><INDENT>allsecnames.append(sec.name())<EOL>for seg in sec:<EOL><INDENT>allsec.append(sec.name())<EOL><DEDENT><DEDENT>cell.allsecnames = allsecnames<EOL>cell.allsec = allsec<EOL>return cell<EOL><DEDENT>else:<EOL><INDENT>self.insert_all_synapses(cellindex, cell)<EOL>electrode = LFPy.RecExtElectrode(**self.electrodeParams)<EOL>if self.calculateCSD:<EOL><INDENT>cell.tvec = np.arange(cell.totnsegs)<EOL>cell.imem = np.eye(cell.totnsegs)<EOL>csdcoeff = csd.true_lam_csd(cell,<EOL>self.populationParams['<STR_LIT>'], electrode.z)<EOL>csdcoeff *= <NUM_LIT> <EOL>del cell.tvec, cell.imem<EOL>cell.simulate(electrode, dotprodcoeffs=[csdcoeff],<EOL>**self.simulationParams)<EOL>cell.CSD = helpers.decimate(cell.dotprodresults[<NUM_LIT:0>],<EOL>q=self.decimatefrac)<EOL><DEDENT>else:<EOL><INDENT>cell.simulate(electrode,<EOL>**self.simulationParams)<EOL><DEDENT>cell.LFP = helpers.decimate(electrode.LFP,<EOL>q=self.decimatefrac)<EOL>cell.x = electrode.x<EOL>cell.y = electrode.y<EOL>cell.z = electrode.z<EOL>cell.electrodecoeff = electrode.electrodecoeff<EOL>for attrbt in self.savelist:<EOL><INDENT>attr = getattr(cell, attrbt)<EOL>if type(attr) == np.ndarray:<EOL><INDENT>self.output[cellindex][attrbt] = attr.astype('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>self.output[cellindex][attrbt] = attr<EOL><DEDENT>except:<EOL><INDENT>self.output[cellindex][attrbt] = str(attr)<EOL><DEDENT><DEDENT>self.output[cellindex]['<STR_LIT>'] = <NUM_LIT> / self.dt_output<EOL><DEDENT>print(('<STR_LIT>' % (cellindex, self.y,<EOL>time()-tic)))<EOL><DEDENT>
Do the actual simulations of LFP, using synaptic spike times from
network simulation.


Parameters
----------
cellindex : int
    cell index between 0 and population size-1.
return_just_cell : bool
    If True, return only the `LFPy.Cell` object
    if False, run full simulation, return None.


Returns
-------
None or `LFPy.Cell` object


See also
--------
hybridLFPy.csd, LFPy.Cell, LFPy.Synapse, LFPy.RecExtElectrode