def fig_kernel_lfp_CINPLA(savefolders, params, transient=<NUM_LIT:200>, X='<STR_LIT>', lags=[<NUM_LIT:20>, <NUM_LIT:20>]):
<EOL>zvec = np.r_[params.electrodeParams['<STR_LIT:z>']]<EOL>alphabet = '<STR_LIT>'<EOL>ana_params.set_PLOS_2column_fig_style(ratio=<NUM_LIT:0.5>)<EOL>fig = plt.figure()<EOL>fig.subplots_adjust(left=<NUM_LIT>, right=<NUM_LIT>, bottom=<NUM_LIT>, top=<NUM_LIT>, hspace=<NUM_LIT>, wspace=<NUM_LIT>) <EOL>gs = gridspec.GridSpec(<NUM_LIT:1>, <NUM_LIT:7>)<EOL>params.savefolder = '<STR_LIT>'<EOL>params.figures_path = os.path.join(params.savefolder, '<STR_LIT>')<EOL>params.spike_output_path = os.path.join(params.savefolder,<EOL>'<STR_LIT>')<EOL>params.networkSimParams['<STR_LIT>'] = params.spike_output_path<EOL>f = h5py.File(os.path.join('<STR_LIT>', '<STR_LIT>'))<EOL>srate = f['<STR_LIT>'].value<EOL>tvec = np.arange(f['<STR_LIT:data>'].shape[<NUM_LIT:1>]) * <NUM_LIT> / srate<EOL>inds = (tvec < params.tstop) & (tvec >= transient)<EOL>data_sg_raw = f['<STR_LIT:data>'].value.astype(float)<EOL>f.close()<EOL>kwidth = <NUM_LIT:20><EOL>kernels = np.zeros((len(params.N_X), <NUM_LIT:16>, <NUM_LIT:100>))<EOL>for j in range(len(params.X)):<EOL><INDENT>kernels[j] = data_sg_raw[:, <NUM_LIT:100>+kwidth+j*<NUM_LIT:100>:<NUM_LIT:100>+kwidth+(j+<NUM_LIT:1>)*<NUM_LIT:100>] / params.N_X[j]<EOL><DEDENT>activationtimes = np.array([x*<NUM_LIT:100> for x in range(<NUM_LIT:3>,<NUM_LIT:11>)] + [<NUM_LIT:200>])<EOL>networkSimSpikegen = CachedNetwork(**params.networkSimParams)<EOL>x, y = networkSimSpikegen.get_xy([transient, params.tstop])<EOL>titles = ['<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>]<EOL>COUNTER = <NUM_LIT:0> <EOL>for i, X__ in enumerate(([['<STR_LIT>']]) + list(zip(params.X[<NUM_LIT:1>::<NUM_LIT:2>], params.X[<NUM_LIT:2>::<NUM_LIT:2>]))):        <EOL><INDENT>ax = fig.add_subplot(gs[<NUM_LIT:0>, i])<EOL>if i == <NUM_LIT:0>:<EOL><INDENT>phlp.annotate_subplot(ax, ncols=<NUM_LIT:7>, nrows=<NUM_LIT:4>, letter=alphabet[<NUM_LIT:0>], linear_offset=<NUM_LIT>)<EOL><DEDENT>for j, X_ in enumerate(X__):<EOL><INDENT>cinds = np.arange(activationtimes[np.arange(-<NUM_LIT:1>, <NUM_LIT:8>)][COUNTER]-kwidth,<EOL>activationtimes[np.arange(-<NUM_LIT:1>, <NUM_LIT:8>)][COUNTER]+kwidth+<NUM_LIT:2>)<EOL>x0_sg = np.histogram(x[X_], bins=tvec[cinds])[<NUM_LIT:0>].astype(float)<EOL>if X_ == ('<STR_LIT>'):<EOL><INDENT>color='<STR_LIT:r>'<EOL><DEDENT>else:<EOL><INDENT>color=('<STR_LIT:r>', '<STR_LIT:b>')[j]<EOL><DEDENT>xcorr, vlimround = plotting_correlation(x0_sg/x0_sg.sum()**<NUM_LIT:2>, <EOL>data_sg_raw[:, cinds[:-<NUM_LIT:1>]]*<NUM_LIT>,<EOL>ax, normalize=False,<EOL>lag=kwidth,<EOL>color=color,<EOL>scalebar=False)<EOL>if i > <NUM_LIT:0>:<EOL><INDENT>ax.set_yticklabels([])<EOL><DEDENT>ax.plot([kwidth, kwidth],<EOL>[-<NUM_LIT> + j*<NUM_LIT:3>*<NUM_LIT:100>, -<NUM_LIT> + j*<NUM_LIT:3>*<NUM_LIT:100>], lw=<NUM_LIT:2>, color=color,<EOL>clip_on=False)<EOL>ax.text(kwidth*<NUM_LIT>, -<NUM_LIT> + j*<NUM_LIT:3>*<NUM_LIT:100>, '<STR_LIT>' % vlimround,<EOL>rotation='<STR_LIT>', va='<STR_LIT>')<EOL>ax.set_xlim((-<NUM_LIT:5>, kwidth))<EOL>ax.set_xticks([-<NUM_LIT:20>, <NUM_LIT:0>, <NUM_LIT:20>])<EOL>ax.set_xticklabels([-<NUM_LIT:20>, <NUM_LIT:0>, <NUM_LIT:20>])<EOL>COUNTER += <NUM_LIT:1><EOL><DEDENT>ax.set_title(titles[i])<EOL><DEDENT>for i, (savefolder, lag) in enumerate(zip(savefolders, lags)):<EOL><INDENT>params.savefolder = os.path.join(os.path.split(params.savefolder)[<NUM_LIT:0>],<EOL>savefolder)<EOL>params.figures_path = os.path.join(params.savefolder, '<STR_LIT>')<EOL>params.spike_output_path = os.path.join(params.savefolder,<EOL>'<STR_LIT>')<EOL>params.networkSimParams['<STR_LIT>'] = params.spike_output_path<EOL>networkSim = CachedNetwork(**params.networkSimParams)<EOL>f = h5py.File(os.path.join(params.savefolder, '<STR_LIT>'))<EOL>data_raw = f['<STR_LIT:data>'].value<EOL>srate = f['<STR_LIT>'].value<EOL>tvec = np.arange(data_raw.shape[<NUM_LIT:1>]) * <NUM_LIT> / srate<EOL>inds = (tvec < params.tstop) & (tvec >= transient)<EOL>data = data_raw[:,inds]<EOL>dataT = data.T - data.mean(axis=<NUM_LIT:1>)<EOL>data = dataT.T<EOL>f.close()<EOL>f = h5py.File(os.path.join('<STR_LIT>', '<STR_LIT>'))<EOL>data_sg_raw = f['<STR_LIT:data>'].value<EOL>data_sg = data_sg_raw[:,inds[data_sg_raw.shape[<NUM_LIT:1>]]]<EOL>f.close()<EOL>ax = fig.add_subplot(gs[<NUM_LIT:0>, <NUM_LIT:5> + i])<EOL>phlp.annotate_subplot(ax, ncols=<NUM_LIT:15>, nrows=<NUM_LIT:4>, letter=alphabet[i+<NUM_LIT:1>],<EOL>linear_offset=<NUM_LIT>)<EOL>x, y = networkSim.get_xy([<NUM_LIT:0>,params.tstop])<EOL>bins = np.arange(<NUM_LIT:0>, params.tstop+<NUM_LIT:2>)<EOL>x0_raw = np.histogram(x[X], bins=bins)[<NUM_LIT:0>]<EOL>x0 = x0_raw[inds].astype(float)<EOL>xcorr, vlimround = plotting_correlation(x0/x0.sum(), <EOL>data*<NUM_LIT>,<EOL>ax, normalize=False, <EOL>lag=lag,<EOL>scalebar=False,<EOL>color='<STR_LIT:k>',<EOL>title='<STR_LIT>' %X,<EOL>)<EOL>ax.plot([lag, lag],<EOL>[-<NUM_LIT>, -<NUM_LIT>], lw=<NUM_LIT:2>, color='<STR_LIT:k>',<EOL>clip_on=False)<EOL>ax.text(lag*<NUM_LIT>, -<NUM_LIT>, '<STR_LIT>' % vlimround,<EOL>rotation='<STR_LIT>', va='<STR_LIT>')<EOL>[Xind] = np.where(np.array(networkSim.X) == X)[<NUM_LIT:0>]        <EOL>x0_sg = np.zeros(x0.shape, dtype=float)<EOL>x0_sg[activationtimes[Xind]] += params.N_X[Xind]<EOL>ax.set_yticklabels([])<EOL>ax.set_xticks([-lag, <NUM_LIT:0>, lag])<EOL>ax.set_xticklabels([-lag, <NUM_LIT:0>, lag])<EOL><DEDENT>return fig<EOL>
This function calculates the  STA of LFP, extracts kernels and recontructs the LFP from kernels.

kwargs:
::
  transient : the time in milliseconds, after which the analysis should begin
            so as to avoid any starting transients
  X : id of presynaptic trigger population