nrv.utils

Description

Utils: general purpose functions and classes

utils provides some classes and functions for runing and interconnecting code from the scientific sub-packages.

Classes

nrv_function()

Class containg all comon method of fonction used in nrv

function_1D()

class containing function from IR to IR Such function can be call either on 1 value or on a ndarray (and applied on each value)

gaussian([mu, sigma])

gaussian function define as:

gate([mu, sigma, kind, N])

function_2D()

class containing function from IR^2 to IR Such function can be call either on 1 value or on a ndarray (and applied on each value)

ackley()

Bi-dimensional Ackley function

beale()

Bi-dimensional Beale function

goldstein_price()

Bi-dimensional Goldstein function

booth()

Bi-dimensional Booth function

bukin6()

Bi-dimensional Booth function

function_ND()

class containing function from IR^n to IR Such function can be call either on 1 value or on a ndarray (and applied on each value)

Id()

rosenbock()

Multi-dimensional Rosenbock function

rastrigin()

Multi-dimensional Rastrigin function

sphere([Xc])

Multi-dimensional Sphere function

cost_evaluation()

nrv_interp(X_values, Y_values[, kind, dx, ...])

Interpolator based on scipy.interpolate

MeshCallBack([f, axis])

stimulus([s_init])

Stimulus class for NRV2, signals are defined as asynchronous signals, with s the values and t as occurence timings.

Functions

distance_point2point(x_1, y_1[, x_2, y_2])

Computes the distance between a point (x_p,y_p) and a line defined as y=a*x+b

distance_point2line(x_p, y_p, a, b)

Computes the distance between a point (x_p,y_p) and a line defined as y=a*x+b

nearest_idx(array, val)

Return index of neareast value

nearest_greater_idx(array, val)

Return index of neareast greater value

in_tol(test, ref[, tol])

Check if a value is equal to a value +- a tol (excluded).

get_perineurial_thickness(fasc_d[, nerve_type])

Return a fascicle's perineurium thickness from its diameter.

membrane_capacitance_from_model(model)

compute_complex_admitance(f, g, fc)

compute the complex admitance of a first oder system (of cutoff frequency fc and conductivity g) at a given frequency f

print_default_nrv_unit()

Print all the default units in nrv.

from_nrv_unit(value, unit)

Convert a quantity value from the default nrv units to unit.

to_nrv_unit(value, unit)

Convert a quantity value from unit to the default nrv unit.

convert(value, unitin, unitout)

Convert a quantity value from unitin to unitout.

sci_round(value[, digits])

Rounds one or several values to digits significant digits.

is_stim(stim)

check if an object is a stimulus, return True if yes, else False

set_common_time_series(stim1, stim2)

set two signals at the same time samples, missing samples are reconstructed by holding a value

get_equal_timing_copies(stim1, stim2)

create two stimuli with equal timing as copies of the input ones

datfile_2_stim(fname[, dt])

Creates a stimulus from sampled data specified in a .dat file