% Jon Newman
% 2013 01 26
% Look at reactivity of each the three wells

fids = {
    '2013-02-19_pulse_chr2_zarathustra_21332_01';
    '2013-02-19_pulse_chr2_zarathustra_22468_01';
    };



figure

% Evoked FR
k = 1;
maxfr = 2000;
for f = 1:length(fids)
   fid = fids{f};
   
   s = loadspk([fid '.spk']);
   ss = SqueakySpk(fid,s.meta.fs_Hz,1,s);
%    ss.RemoveChannel(setdiff(1:64,w(ws(f),:)));

   subplot(length(fids),1,f)
   ss.ASDR(10,[0 7*60],[],1)
   xlim([0 7*60])
   ylim([0 maxfr])
   text(0,maxfr-5,'pre spont.','VerticalAlignment','top','HorizontalAlignment','left')
   text(5*60,maxfr-5,'evoke.','VerticalAlignment','top','HorizontalAlignment','left')
   text(6*60,maxfr-5,'post spont.','VerticalAlignment','top','HorizontalAlignment','left')
   set(gca,'XTick',[0:60:7*60])
   title(fids{f},'Interpreter','none');
%    k = k+1;

    
%    subplot(length(fids),3,k)
%    ss.ASDR(10,[0 300])
%    xlim([0 300])
%    ylim([0 maxfr])
%    text(10,maxfr-5,'pre spont.')
%    set(gca,'XTick',[0 60 ])
%    k = k+1;
%    ylabel(fid(end-4:end));
%    
%    subplot(length(fids),3,k)
%    ss.ASDR(10,[290 370])
%    xlim([290 370])
%    ylim([0 maxfr])
%    text(70,maxfr-5,'evoke.')
%    set(gca,'XTick',[60 120])
%    k = k+1;
%    
%    subplot(length(fids),3,k)
%    ss.ASDR(10,[360 7*60])
%    xlim([360 7*60])
%    ylim([0 maxfr])
%    text(130,maxfr-5,'post spont.')
%    set(gca,'XTick',[120 180])
%    k = k+1;
    
    
end

% export_fig('-pdf','-transparent',[fid(1:end-5) 'evoked_fr'])
