clear; 
addpath( '../../pointprocesses/simulations/' );

set( 0, 'DefaultTextFontSize', 22.0 );
set( 0, 'DefaultAxesFontSize', 22.0 );

% load data
load( 'p-unit_stimulus.mat' );
load( 'p-unit_spike_times.mat' );
%load( 'pyramidal_noise_2014-09-02-af_cutoff_50_contr_5.mat' );
% load( 'pyramidal_noise_2014-09-02-ab_cutoff_300_contr_5.mat' );
% for k = 1:length( spike_times )
%     spike_times{k} = spike_times{k} * 0.001;
% end
% stimulus = stimulus(1:20000*5,:);

%dt = stimulus(2,1) - stimulus(1,1);
%spike_times = lifadaptspikes( 20, 50+100.0*stimulus(:,2), dt, 0.1, 0.04, 10.0 ); 
%spike_times = lifspikes( 20, 12+30.0*stimulus(:,2), dt, 0.1 ); 
%spike_times = lifspikes( 20, 20.0+30.0*stimulus(:,2), dt, 0.0001 ); 

%figure( 1 );
%clf;
%spikeraster( spike_times );
%isivec = isis( spike_times );
%isihist( isivec );
%isiserialcorr( isivec, 20 );
%fano( spike_times );

sta( stimulus(1:5:length(stimulus),:), spike_times, 0.05, 0.01 );
%stc( stimulus(1:5:length(stimulus),:), spike_times, 0.05, 0.01 );
