fractopo.analysis.parameters module

Analysis and plotting of geometric and topological parameters.

fractopo.analysis.parameters.branches_intersect_boundary(branch_types)

Get array of if branches have E-component (intersects target area).

Return type:

ndarray

fractopo.analysis.parameters.convert_counts(counts)

Convert float and int value in counts to ints only.

Used by branches and nodes count calculators.

Return type:

Dict[str, int]

fractopo.analysis.parameters.counts_to_point(counts, is_nodes, scale=100)

Create ternary point from node_counts.

The order is important: for nodes: X, I, Y and for branches: CC, II, CI.

Return type:

Optional[Tuple[float, float, float]]

fractopo.analysis.parameters.decorate_branch_ax(ax, tax, counts)

Decorate ternary branch plot.

fractopo.analysis.parameters.decorate_count_ax(ax, tax, label_counts, is_nodes)

Decorate ternary count plot.

fractopo.analysis.parameters.decorate_xyi_ax(ax, tax, counts)

Decorate xyi plot.

fractopo.analysis.parameters.determine_branch_type_counts(branch_types, branches_defined)

Determine branch type counts.

Return type:

Dict[str, Union[float, int]]

fractopo.analysis.parameters.determine_node_type_counts(node_types, branches_defined)

Determine node type counts.

Return type:

Dict[str, Union[float, int]]

fractopo.analysis.parameters.determine_set_counts(set_names, set_array)

Determine counts in for each set.

Return type:

Dict[str, int]

fractopo.analysis.parameters.determine_topology_parameters(trace_length_array, area, branches_defined, correct_mauldon, node_counts, branch_length_array)

Determine geometric (and topological) parameters.

Number of traces (and branches) are determined by node counting.

The passed trace_length_array should be non-weighted.

Return type:

Dict[str, float]

fractopo.analysis.parameters.initialize_ternary_ax(ax, tax)

Decorate ternary ax for both XYI and branch types.

Returns a font dict for use in plotting text.

Return type:

dict

fractopo.analysis.parameters.initialize_ternary_branches_points(ax, tax)

Initialize ternary branches plot ax and tax.

fractopo.analysis.parameters.initialize_ternary_points(ax, tax)

Initialize ternary points figure ax and tax.

fractopo.analysis.parameters.plot_branch_plot_ax(counts, label, tax, color=None)

Plot ternary branch plot to tax.

fractopo.analysis.parameters.plot_parameters_plot(topology_parameters_list, labels, colors=None)

Plot topological parameters.

fractopo.analysis.parameters.plot_set_count(set_counts, label)

Plot set counts.

Return type:

Tuple[Figure, Axes]

fractopo.analysis.parameters.plot_ternary_plot(counts_list, labels, is_nodes, colors=None)

Plot ternary plot.

Same function is used to plot both XYI and branch type ternary plots.

Return type:

Tuple[Figure, Axes, TernaryAxesSubplot]

fractopo.analysis.parameters.plot_xyi_plot_ax(counts, label, tax, color=None)

Plot XYI pointst to given ternary axis (tax).

fractopo.analysis.parameters.tern_plot_branch_lines(tax)

Plot line of random assignment of nodes to branches to a branch ternary tax.

Line positions taken from NetworkGT open source code. Credit to: https://github.com/BjornNyberg/NetworkGT

Parameters:

tax (ternary.TernaryAxesSubplot) – Ternary axis to plot to

fractopo.analysis.parameters.tern_plot_the_fing_lines(tax, cs_locs=(1.3, 1.5, 1.7, 1.9))

Plot connections per branch parameter to XYI-plot.

If not using the pre-determined locations the texts will not be correctly placed as they use absolute positions and labels.

Parameters:
  • tax (TernaryAxesSubplot) – Ternary axis to plot to.

  • cs_locs – Pre-determined locations for the lines.

fractopo.analysis.parameters.tern_yi_func(c, x)

Plot Connections per branch threshold line to branch ternary plot.

Uses absolute values.

fractopo.analysis.parameters.ternary_heatmapping(x_values, y_values, i_values, number_of_bins, scale_divider=1.0, ax=None)

Plot ternary heatmap.

Modified from: https://github.com/marcharper/python-ternary/issues/81

Return type:

Tuple[Figure, TernaryAxesSubplot]

fractopo.analysis.parameters.ternary_point_kwargs(alpha=1.0, zorder=4, s=25, marker='X')

Plot point to a ternary figure.

fractopo.analysis.parameters.ternary_text(text, ax)

Add ternary text about counts.