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

fids = {
    '2013-02-08_pulse_chr2_xinhai_20629';
    '2013-02-08_pulse_chr2_xinhai_20628';
    '2013-02-08_pulse_chr2_xinhai_22471';
    '2013-02-08_pulse_chr2_xinhai_22493';
    };



figure

% Evoked FR
k = 1;
maxfr = 30;
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),3,k)
   ss.ASDR(10,[0 60])
   xlim([0 60])
   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,[60 120])
   xlim([60 120])
   ylim([0 maxfr])
   text(70,maxfr-5,'evoke.')
   set(gca,'XTick',[60 120])
   k = k+1;
   
   subplot(length(fids),3,k)
   ss.ASDR(10,[120 180])
   xlim([120 180])
   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'])
