crikit.utils package¶
Subpackages¶
Submodules¶
crikit.utils.datacheck module¶
Functions to check and (if needed) convert input variables
Created on Sat Jun 18 00:16:27 2016
@author: chc
crikit.utils.general module¶
General utilities
expand_1d_to_ndim_data : Match 1D data array dimensionality to that of another array
expand_1d_to_ndim : Expand 1D data array dimensionality to ndim
- find_nearestGiven a vector and a value, find the index and value
of the closest match
- padWrapper around numpy.pad that also returns a window defining the
original signal
Notes
- crikit.utils.general.arange_nonzero(start, stop, dtype=<class 'float'>)[source]¶
Similar to numpy arange but only returns non-zero elements
- crikit.utils.general.expand_1d_to_ndim_data(data, data_to_match)[source]¶
Make 1D data array equal in dimensions to data_to_match
- crikit.utils.general.find_nearest(np_vec, to_find=0)[source]¶
Given a vector and a value (or list/vector of values), find the index and value of the closest match
- crikit.utils.general.lin_from_row_col(row, col, sh)[source]¶
Convert a col and row counter to 1D linear count
- crikit.utils.general.mean_nd_to_1d(data, axis=- 1)[source]¶
Take the mean of an nd array, except axis, returning a 1D array
- crikit.utils.general.np_fcn_nd_to_1d(fcn, data, axis=- 1)[source]¶
Take in an n-dimensional array and return a 1D version operated on by fcn. Works with many numpy functions that can take an “axis” parameter
- crikit.utils.general.pad(y, pad_width, mode)[source]¶
Pad array with either constants or edge values.
Note: For N-D arrays, pads the -1 axis
- crikit.utils.general.pad_dual(y, edge_pad_width, constant_pad_width)[source]¶
Pad array with edge values followed by constant 0’s.
Note: For N-D arrays, pads the -1 axis
- Parameters
- Returns
Padded array and window. Window defines the region of the original signal
- Return type
y_pad, window
- crikit.utils.general.pad_edge_mean(y, pad_width, n_edge=1, axis=- 1)[source]¶
Pad data y with edge-values or near-edge mean values along axis
- Parameters
- Returns
(y_pad, window)
y_pad (ndarray) – Padded y
window (ndarray (1D)) – Mask with 0’s for pad regions, 1’s for original size
crikit.utils.roi module¶
Created on Wed Jun 15 23:33:41 2016
@author: chc
- crikit.utils.roi.pts_in_path(path)[source]¶
Return points (pixels) that fall within path (but not on boundary)