Developer Guide

This section purports to document the esofspy internals.

esofspy.main()
dirsdist.histograms.angle_max(data_sorted, n_max)

Finds n_max directions of blood vessels with the highest length densities.

Parameters:

- data_sorted : array

- n_max : int

Returns:

- (h_azim, v_elev) : array

- vector : array

- vector_mean : array

dirsdist.histograms.cardinal_orientation(fig, data_sorted, ii, n_max, plot_axes=False)

Plots n_max cardinal directions.

Parameters:

- fig : int

- data_sorted : array

- ii : int

- n_max : int

- plot_axes : bool

Returns:

- v1 : array

- h1 : array

dirsdist.histograms.compute_fraction(data)

Computes fractions of lengths of blood vessels in all directions: l_i/\sum_{n=1}^N l_i, where l_i is the length of blood vessels in given direction, N is total number of directions.

Parameters:- data : array
Returns:- fraction : array
dirsdist.histograms.count_chi_square(data, fraction)

Chi-square test of fractions distribution: \chi^2 = \sum_{n=1}^N \frac{O_i-E_i}{E_i}, where O_i is observed value, E_i is expected value, N is total number of values. In our case E_i is value of fraction when we assumed uniform distribution, i.e. E_i = E_{i+1} =...= E_{N} = 1/v h, where v = number of elevation divisions and h = number of azimuth divisions.

Parameters:

- data : array

- fraction : array

Returns:

- chi_square : float

dirsdist.histograms.evaluate_anisotropy(n_tracer_data, tracer_data, calibration)

Evaluates fractional and ellipsoidal anisotropy from the line system in file tracer. The ellipsoidal anisotropy has the values from 1 (isotropy - lines express no preferential direction) to infinity (total anisotropy - all lines run in the same direction). The fractional anisotropy has the values from 0 (isotropy) to 1 (anisotropy).

Parameters:

- n_tracer_data: int :

- tracer_data : array

- calibration: array :

Returns:

- fractional_anisotropy : float

- ellipsoidal_anisotropy : float

dirsdist.histograms.evaluate_chi_square(chi_square)

Evaluates value of chi-square with respect to the probability value: p < 0.05 = anisotropic distribution, p > 0.05 = isotropic distribution.

Parameters:- chi_square : float
Returns:- p_val : float
dirsdist.histograms.evaluate_ellipsoidal_anisotropy(EA)

Evaluates value of ellipsoidal aninisotropy (EA): ‘ EA = 1 = isotropic system, EA = infinity = anisotropic system with very strong preferential directions.

Parameters:- ellipsoidal_anisotropy :
dirsdist.histograms.evaluate_fractional_anisotropy(FA)

Evaluates value of fractional anisotropy (FA): FA = 0 = isotropic system, FA \approx 1 = anisotropic system with very strong preferential directions.

Parameters:- fractional_anisotropy :
dirsdist.histograms.evaluate_isotropy(data)

Evaluates isotropy:

Isotropic means “independent of direction”. Isotropic radiation has the same intensity regardless of the direction of measurement, and an isotropic field exerts the same action regardless of how the test particle is oriented. This evaluation is based on the chi-square test; null hypothesis H_0 the observed fractions have uniform distribution (through all directions).

Parameters:

- data : array

Returns:

- chi_square : float

- p_val : float

- mean_fraction : float

- std_fraction : float

dirsdist.histograms.find_n_max(fraction, threshold)

Finds the number of directions necesarry to covered threshold value, i.e. given fraction of length densities [0,1].

Parameters:

- fraction : array

- threshold : float

Returns:

- n_max : int

dirsdist.histograms.histogram_mean(fig, data, title_prefix=None)

Counts and draws histogram: distribution of lengths of blood vessels.

Parameters:

- fig : int

- data : array

- title_prefix : str

dirsdist.histograms.histogram_mean_fraction(fig, data, fraction, title_prefix=None)

Counts and draws histogram: distribution of fractions of lengths of blood vessels, i.e. l_i/\sum_{n=1}^N l_i, where l_i is the length of blood vessels in given direction, N is total number of directions.

Parameters:

- fig : int

- data : array

- fraction : array

- title_prefix : str

dirsdist.histograms.lambert_azimuthal_equal_area(az, el)

Counts lambert axes.

Parameters:

- az : int

- el : int

Returns:

- x_lambert : float

- y_lambert : float

dirsdist.histograms.load_tracer_data(filename)

Loads data from tracer file.

Parameters:

- filename : str

Returns:

- tracer_data : array

- n_tracer_data : int

dirsdist.histograms.plot_lambert_axes(fig, x, txt)

Plots lambert axes.

Parameters:

- fig : int

- x : int

- txt : int

dirsdist.histograms.read_histograms(filename, vs, hs=None)

Reads histograms.

Parameters:

- filename : str

- vs, hs : int

Returns:

- data : array

dirsdist.histograms.rose(fig, data)

Draws original rose of directions based on dividing given by v and h (elevations and azimuths).

Parameters:

- fig : int

- data : array

dirsdist.histograms.rose_scaled(fig, data)

Draws scaled rose of directions based on dividing given by v and h (elevations and azimuths).

Parameters:

- fig : int

- data : array

dirsdist.histograms.sort_data(data)

Sorts data in ascending manner.

Parameters:- data : array
Returns:- data_sorted : array
dirsdist.linalg.convert_angles_to_direction(elev, azim)

Converts elevation and azimuth angles to direction vectors.

Parameters:

- elev : float

- azim : float

Returns:

- direction : array

dirsdist.linalg.convert_geo_to_angles(v, h, v_elev, h_azim)

Converts from v, h to elevation and azimuth angles.

Parameters:

- v : int

- h : int

- v_elev : int

- h_azim : int

Returns:

- elev : float

- azim : float

dirsdist.linalg.convert_geo_to_direction(v, h, v_elev, h_azim)

Converts from v, h to coordinates of vector in half cell (spherical tetragon).

Parameters:

- v : int

- h : int

- v_elev : int

- h_azim : int

Returns:

- direction : array

dirsdist.linalg.generate_angles(v_elev, h_azim)

Generates uniformly spaced elevation and azimuth angles given the number of parallels and meridians.

Parameters:

- v_elev : int

- h_azim : int

Returns:

- elev : float

- azim : float

dirsdist.linalg.make_axis_rotation_matrix(direction, angle)

Creates a rotation matrix corresponding to the rotation around a general axis by a specified angle.

R = \vec{d}\vec{d}^T + \cos(a) (I - \vec{d}\vec{d}^T) + \sin(a) skew(\vec{d})

Parameters:

- direction : array

- angle : float

Returns:

- mtx : array

dirsdist.utils.construct_name(path, filename)

Previous topic

Examples

This Page