Skip to content

Commit

Permalink
Removed Filtering
Browse files Browse the repository at this point in the history
Filtering wasn't very well done, has limited use and can be covered
using mapReduce.
  • Loading branch information
awadell1 committed Jan 30, 2017
1 parent b59a9da commit 20682f4
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 112 deletions.
5 changes: 1 addition & 4 deletions @datasource/datasource.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
Data = struct; %Structure of Logged Data
Entry = struct; %Structure of masterDirectory
Channel = {}; %Cell Array of logged channels
Detail = []; %Structure of Details
Gate = struct; %Structure for gating function
Detail = []; %Structure of Details
dm = []; %Handle to Datamaster Object
MatPath = ''; %Full path to .mat file
end
Expand Down Expand Up @@ -67,8 +66,6 @@ function clearData(ds,varargin)

newTime = Sync(varargin)

setGate(ds, filterHandle)

varargout = mapReduce(ds, mapFun, reduceFun, varargin)

[cdf_2, x, y, duration] = CDF2(ds,varargin)
Expand Down
21 changes: 2 additions & 19 deletions @datasource/getChannel.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
p.addRequired('ds',@(x) isa(x,'datasource') && length(x)==1);
p.addRequired('chanName',@(x) ischar(x) || iscell(x));
p.addOptional('filter', 'none', @(x) any(strcmp(x,{'none','hampel','median'})));
p.addOptional('gate', 'off', @(x) any(strcmp(x,{'off', 'on', 'refresh'})));
p.addOptional('unit', 'base', @ischar);
end

Expand Down Expand Up @@ -39,33 +38,17 @@
%Number of Standard of deviations a sample must deviate to be an outlier
nSigma = 3;

%Apply Filer
%Apply Filter
ds.Data.(chanName).Value = hampel(ds.Data.(chanName).Value,k,nSigma);
case 'median'
%Number of samples on either side to be used when computing the median
n = 13;

%Apply Filer
%Apply Filter
ds.Data.(chanName).Value = medfilt1(ds.Data.(chanName).Value,n);
end
end

%% Apply Gating
if strcmp(p.Results.gate, 'on') || strcmp(p.Results.gate, 'refresh')
%Refresh Gate if requested/required
if strcmp(p.Results.gate, 'refresh') || isempty(ds.Gate.Value)
ds.clearData(chanName);
ds.refreshGate;
end

%Find Samples to Drop
dropIndex = floor(interp1(ds.Gate.Time, 1* ds.Gate.Value, ds.Data.(chanName).Time));

%Drop samples
ds.Data.(chanName).Value(~dropIndex) = [];
ds.Data.(chanName).Time(~dropIndex) = [];
end

%% Convert Units
if ~strcmp(p.Results.unit,'')
%Convert Unit
Expand Down
15 changes: 0 additions & 15 deletions @datasource/refreshGate.m

This file was deleted.

16 changes: 0 additions & 16 deletions @datasource/setGate.m

This file was deleted.

16 changes: 0 additions & 16 deletions Samples/analysisSample.m

This file was deleted.

42 changes: 0 additions & 42 deletions Samples/gateSample.m

This file was deleted.

0 comments on commit 20682f4

Please sign in to comment.