function [deltas,peaks,occ] = BatchGetDeltas(session,varargin)

durations = [-0.025 0.025];
[~,sessionName] = fileparts(session);

global BASEPATH
deltas = dlmread(fullfile(BASEPATH, 'data', [sessionName '-deltas-lfp-deltagroups']));
groups = deltas(1,4:end);
deltas(1,:) = [];
occ = deltas(:,4:end);
deltas = deltas(:,1:3);
peaks = dlmread(fullfile(BASEPATH, 'data', [sessionName '-deltas-lfp-deltapeaks']));
peaks(1,:) = []; peaks(:,1) = [];
starts = dlmread(fullfile(BASEPATH, 'data', [sessionName '-deltas-lfp-deltastarts']));
starts(1,:) = []; starts(:,1) = [];
stops = dlmread(fullfile(BASEPATH, 'data', [sessionName '-deltas-lfp-deltastops']));
stops(1,:) = []; stops(:,1) = [];

%% Load session
SetCurrentSession(session,'verbose','off');
load([session(1:max(strfind(session,'/'))) 'UnitSeparation/cells']);
if exist('PFCpyr','var'),
    if exist('PFCint','var'),
        pfcUnit = [PFCpyr ones(size(PFCpyr,1),1);PFCint 2*ones(size(PFCint,1),1)];
    else
        pfcUnit = [PFCpyr ones(size(PFCpyr,1),1)];
    end
else
    pfcUnit = [PFCint 2*ones(size(PFCint,1),1)];
end

pfcUnit = sortrows(pfcUnit);

units = GetUnits;

if isempty(HPCpyr) || isempty(pfcUnit),return;end
hpc = GetSpikeTimes(HPCpyr,'output','numbered');
pfc = GetSpikeTimes(pfcUnit(:,1:2),'output','full');
[okunits,~,pfcID] = unique(pfc(:,2:3),'rows');

pfcUnit(~ismember(pfcUnit(:,1:2),okunits,'rows'),:) = [];








