Skip to content

Commit

Permalink
docs for +Utils
Browse files Browse the repository at this point in the history
  • Loading branch information
wchapman committed Jun 9, 2016
1 parent c90cad6 commit 42852ca
Show file tree
Hide file tree
Showing 48 changed files with 56 additions and 3,430 deletions.
2 changes: 1 addition & 1 deletion +CMBHOME/+Utils/AddChronuxPackage.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function AddChronuxPackage

% Add the chronux pacage
if ~isempty(findstr('chronux', path)), return; end % check that it isnt already there

a = what('CMBHOME');
Expand Down
6 changes: 2 additions & 4 deletions +CMBHOME/+Utils/AutoCorrRotation.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
function [phi, max_cor, phi_v_cor] = AutoCorrRotation(ac1, ac2, varargin)
% [phi] = AutoCorrRotation(ac1, ac2);
% [phi, max_cor, phi_v_cor] = AutoCorrRotation(ac1, ac2);
%
% Calculates angle phi for which ac1 and ac2 are maximally correlated.
% Useful for checking for rotation of grid field orientation between
% conditions
Expand Down Expand Up @@ -35,7 +32,8 @@
% 3. Finds max of the correlation score, and returns both vectors, as
% well.
%

% [phi] = AutoCorrRotation(ac1, ac2);
% [phi, max_cor, phi_v_cor] = AutoCorrRotation(ac1, ac2);
import CMBHOME.Utils.*

p = inputParser;
Expand Down
4 changes: 1 addition & 3 deletions +CMBHOME/+Utils/CatCA.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
function matout = CatCA(cellin)
% matout = CMBHOME.Utils.CatCA(cellin)
%
function matout = CatCA(cellin)%
% Converts a cell array of vectors 'cellin' of size MxN to a matrix padded by NaNs of
% size max_vector x N x M. This is useful for data structures in CMBHOME.
% If cellin is a matrix, matout = cellin. The reason M (epochs) gets pushed
Expand Down
1 change: 0 additions & 1 deletion +CMBHOME/+Utils/Cell2MatPlus.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
function matout = Cell2MatPlus(cellin)

% returns a matrix from cell cellin, where differently sized vectors are
% padded with NaNs

Expand Down
45 changes: 0 additions & 45 deletions +CMBHOME/+Utils/CondorCheck.m

This file was deleted.

138 changes: 0 additions & 138 deletions +CMBHOME/+Utils/CondorSubmit.m

This file was deleted.

4 changes: 2 additions & 2 deletions +CMBHOME/+Utils/ContinuizeEpochs.m
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
function varargout = ContinuizeEpochs(varargin)
% varargout = CMBHOME.Utils.ContinuizeEpochs(varargin);
%
% Converts all cell arrays passed through varagin to arrays in varargout
%
%
% If the cell array is Mx1, then that vararg output is a column vector. If
% the cell array is MxN, then the vararg output is a matrix max(cat(M) x N
% padded by zeros.
Expand All @@ -11,6 +10,7 @@

% takes all data from cell arrays in vargin, and continuizes them into
% vectors in vargout
% varargout = CMBHOME.Utils.ContinuizeEpochs(varargin);

varargout = cell(length(varargin),1);

Expand Down
4 changes: 2 additions & 2 deletions +CMBHOME/+Utils/EllipseDirectFit.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
function A = EllipseDirectFit(XY)
% coefficients = EllipseDirectFit(XY)
%
% Direct ellipse fit, proposed in article
% A. W. Fitzgibbon, M. Pilu, R. B. Fisher
% "Direct Least Squares Fitting of Ellipses"
Expand All @@ -22,6 +20,8 @@
% better approximated by a hyperbola.
% It is somewhat biased toward smaller ellipses.
%
% % coefficients = EllipseDirectFit(XY)


centroid = mean(XY); % the centroid of the data set

Expand Down
7 changes: 3 additions & 4 deletions +CMBHOME/+Utils/FilterEpochs.m
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
function epoch = FilterEpochs(epoch, mindur, minsep)
%
% epoch = CMBHOME.Utils.Filterepoch(epoch, mindur, minsep)
%
% For an Nx2 array of epoch values (time or otherwise), merges those closer
% For an Nx2 array of epoch values (time or otherwise), merges those closer
% than 'minsep' and removes those less than 'mindur'
%
% andrew 6/29/2011
% epoch = CMBHOME.Utils.Filterepoch(epoch, mindur, minsep)


[~, inds] = sort(epoch(:,1)); % sort ascending

Expand Down
2 changes: 0 additions & 2 deletions +CMBHOME/+Utils/IntersectEpochs.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
function epochs = IntersectEpochs(root, epochs)
% epochs = root.IntersectEpochs(epochs)
%
% Returns list of epochs that are contained in both epochs lists { epochs1, epochs2 }
%
% INPUTS
Expand Down
5 changes: 1 addition & 4 deletions +CMBHOME/+Utils/IntersectEpochs2.m
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
function epochs = IntersectEpochs2(varargin)
% Finds the intersection of all sets of epochs.
% epochs = IntersectEpochs2(epochs1, epochs2, epochs3...)
%
% Must pass at least
%
% Finds the intersection of all sets of epochs.
%
% andrew october 14 2011

import CMBHOME.Utils.*

if length(varargin)<2, error('you must pass at least 2 input arguments of type ''epoch'''); end
Expand Down
5 changes: 2 additions & 3 deletions +CMBHOME/+Utils/LinearRegression.m
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
function [y_m, R, P, b, y_int] = LinearRegression(x, y, ifPlot)
% [y_m, R, P, b, y_int] = LinearRegression(x, y)
% fits x and y to a linear model, and returns the R and P values, along
% with y_m, model y values

% andrew 26 january 2010
%
% [y_m, R, P, b, y_int] = LinearRegression(x, y)

degree=2; % linear regression

Expand Down
10 changes: 3 additions & 7 deletions +CMBHOME/+Utils/MergeEpochs.m
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
function root = MergeEpochs(root)
%
% root = CMBHOME.Utils.MergeEpochs(root);
%
% Returns root with epochs that do not overlap. Touching epochs are merged.
%
%
% Assumes that all epochs are on the timescale of root.b_ts (all epochs
% have samples within them. any epochs without samples within them are
% deleted)
%
% v1. andrew
% v2. ehren

% root = CMBHOME.Utils.MergeEpochs(root);

if ~strcmp(class(root), 'CMBHOME.Session'), error('MergeEpochs has been updated to require new syntax.'); end

if size(root.epoch,1)<2, return; end
Expand Down
3 changes: 2 additions & 1 deletion +CMBHOME/+Utils/MergeEpochs2.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
function epochs = MergeEpochs2(epochs, mergetouching)
% merge epochs of arbirary precision without creating binary vector
%
% epochs = CMBHOME.Utils.MergeEpochs2(epochs, mergetouching)
%
% merge epochs of arbirary precision without creating binary vector
%
% returned sorted
%
Expand Down
3 changes: 2 additions & 1 deletion +CMBHOME/+Utils/MyvarHolder.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
classdef MyvarHolder

% Class for arbitrary time series variables.

properties (SetAccess=private, Hidden)
p_var % Backup of the original variable, from the time of making the object
p_ts % Backup of the original timestamps, from the time o fmaking the object
Expand Down
5 changes: 2 additions & 3 deletions +CMBHOME/+Utils/OverThresholdDetect.m
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
function [ind,tf] = OverThresholdDetect(A, thresh, min_sep, min_length)
% ind = ThresholdDetect(A, thresh, min_sep, min_length);
% [ind, epochs] = ThresholdDetect(A, thresh, min_sep, min_length);
%
% Searches for continuous epochs for which A is at least thresh, merges those
% separated by less than min_sep indices, and returns ind, an Nx2 array of
% indices for continuous epochs over thresh
% ind = ThresholdDetect(A, thresh, min_sep, min_length);
% [ind, epochs] = ThresholdDetect(A, thresh, min_sep, min_length);

A = A(:);

Expand Down
1 change: 0 additions & 1 deletion +CMBHOME/+Utils/PipeRaster.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
function PipeRaster(cellin, varargin)

% Scatters the time course of a single element on ydim with the pipe '|'
% character. Existing plot must be 'held'

Expand Down
5 changes: 2 additions & 3 deletions +CMBHOME/+Utils/RemoveJumpsAndSmooth.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
function x = RemoveJumpsAndSmooth(x, max_allowed_flips, jitter_threshold, smooth_std,filter_def)
% x = RemoveJumpsAndSmooth(x, max_flip_length, jitter_threshold, smooth_std);
%
% Removes large jumps in data, smoothes the removed regions
% ARGUMENTS
% x a vector of something. NaNs may be used in place of
% known bad samples
Expand All @@ -17,7 +16,7 @@
% then linearly interpolate the missed samples and smooth by convolution
% with a gaussion of standard deviation smooth_std bins.
%
% andrew june 15 2011
% x = RemoveJumpsAndSmooth(x, max_flip_length, jitter_threshold, smooth_std);

import CMBHOME.Utils.*

Expand Down
Loading

0 comments on commit 42852ca

Please sign in to comment.