fractopo.analysis.azimuth module

Functions for plotting rose plots.

class fractopo.analysis.azimuth.AzimuthBins(bin_width: float, bin_locs: ndarray, bin_heights: ndarray)

Bases: object

Dataclass for azimuth rose plot bin data.

bin_heights: ndarray
bin_locs: ndarray
bin_width: float
fractopo.analysis.azimuth.decorate_azimuth_ax(ax: PolarAxes, label: str, length_array: ndarray, set_array: ndarray, set_names: Sequence[str], set_ranges: Sequence[tuple[float | int | Real, float | int | Real]], axial: bool, visualize_sets: bool, append_azimuth_set_text: bool = False, add_abundance_order: bool = False)

Decorate azimuth rose plot ax.

fractopo.analysis.azimuth.determine_azimuth_bins(azimuth_array: ndarray, length_array: ndarray | None = None, bin_multiplier: float | int | Real = 1.0, axial: bool = True) AzimuthBins

Calculate azimuth bins for plotting azimuth rose plots.

E.g.

>>> azimuth_array = np.array([25, 50, 145, 160])
>>> length_array = np.array([5, 5, 10, 60])
>>> azi_bins = determine_azimuth_bins(azimuth_array, length_array)
>>> azi_bins.bin_heights
array([ 5,  5,  0, 70])
>>> azi_bins.bin_locs
array([ 22.5,  67.5, 112.5, 157.5])
>>> azi_bins.bin_width
45.0
fractopo.analysis.azimuth.plot_azimuth_ax(bin_width: float, bin_locs: ndarray, bin_heights: ndarray, bar_color: str, ax: PolarAxes, axial: bool = True) PolarAxes

Plot azimuth rose plot to ax.

fractopo.analysis.azimuth.plot_azimuth_plot(azimuth_array: ndarray, length_array: ndarray, azimuth_set_array: ndarray, azimuth_set_names: Sequence[str], azimuth_set_ranges: Sequence[tuple[float | int | Real, float | int | Real]], label: str, plain: bool, append_azimuth_set_text: bool = False, add_abundance_order: bool = False, axial: bool = True, visualize_sets: bool = False, bar_color: str = 'darkgrey') tuple[AzimuthBins, Figure, PolarAxes]

Plot azimuth rose plot to its own figure.

Returns rose plot bin parameters, figure, ax