polyTEM.spatial.statsΒΆ

Functions

bending_probability(v1, v2[, model, resolution])

Calculates the bending probability between aggregate segments v1 and v2 Segments are quantified as v = (x,y,alpha,a,b,c) where (a,b,c) is a unit vector of the nematic director (segment tangent), located at (x,y) (x,y) are in units of pixels

exponential_decay_length(y, x[, start_ind, ...])

Fits an exponential to y by modeling log(y) = ax + b.

extrapolate_NN(array)

Extrapolates the nematic orientations using Nearest Neighbors, to fill the bounding box

get_kstest(stack_list[, reference, plot])

retrieves Kolmogorov-smirnov test D-value against all distances for each stack in stack_list -- INPUTS stack_list = list of crystal stacks OUTPUTS kstest_list[sample][d_value_list] = list of all the ks_dvalues kstest_thetas[sample,distance] = theta with the largest CDF difference from uniform

legendre_polynomial_2([dimension])

2nd-order Legendre Polynomial.

line_intersect(line1, line2)

find the intersecting points between two lines

make_histogram_distributions(array, bins)

Histogram values and return random variable distribution

rotate_align_vectors(vec1, vec2)

Find the rotation matrix that aligns vec1 to vec2 :param vec1: A 3d "source" vector :param vec2: A 3d "destination" vector :return mat: A transform matrix (3x3) which when applied to vec1, aligns it with vec2.

vector_curvature(v1, v2, r1, r2)

Calculates the numerical components of curvature of v1(r1) using finite, single-sided (forward) difference between two unit vectors v1 and v2, whose origins are projected into the xy plane onto r1 and r2

Classes

LinRegressModel(slope, intercept, rvalue)