%% Calculate PSH for each SS object in the experiment
raw_dir = dir('C:\Users\Jon\Desktop\2010-12-21_Optimus-16259_21div_CNQX-and-Decodability\Stimulation-Data\2010-12-21_16259-Optimus*');

close all
col = jet(length(raw_dir));
figure();
hold on

for i = 1:length(raw_dir)
    
    cd(['C:\Users\Jon\Desktop\2010-12-21_Optimus-16259_21div_CNQX-and-Decodability\Stimulation-Data\' raw_dir(i).name])
    
    cd('pretrial-30min')
    
    fileinfo = dir([pwd '\*.SS']);
    fid = fileinfo(1).name;
    load(fid,'-mat');
    
    SS.ASDR(300,0); % look at 5 minute chunks
    if ~strcmp(SS.asdr,'NA')
        hold on
        plot(SS.asdr(:,1),SS.asdr(:,2),'color',col(i,:))
        xlabel 'Time(sec)'
        ylabel 'Firing Rate (Hz)'
        drawnow
        cd ..
    end
    
    
end


