Skip to content

module myna.application.exaca.export


function add_rgb_to_vtk

add_rgb_to_vtk(
    vtk_file_path,
    vtk_export_path,
    lookup_name,
    dirs={'X': [1, 0, 0], 'Y': [0, 1, 0], 'Z': [0, 0, 1]}
)

Add RGB coloring to VTK file

Args:

  • vtk_file_path: path to VTK file to add RGB colors to
  • vtk_export_path: path for export of modified VTK file
  • lookup_name: path to the lookup table of Reference ID orientations (e.g., GrainOrientationVectors.csv)

function extract_subregion

extract_subregion(
    vtk_file_path,
    vtk_export_path,
    bounds=array([[0, 1],
       [0, 1],
       [0, 1]])
)

Extract a subvolume from the given VTK file

Args:

  • vtk_file_path: path to VTK file to to extract region from
  • vtk_export_path: path for export of modified VTK file
  • bounds: array of X, Y, and Z min & max bounds in terms of fraction of the overall volume dimensions

function plot_euler_angles

plot_euler_angles(df, im_height, im_width, export_file='euler_angle_plots.png')

Plot the three Euler angles (Bunge notation: phi1, Phi, phi2) from a pandas DataFrame

Args:

  • df: pandas DataFrame containing, at least, columns "phi1", "Phi", and "phi2"
  • im_height: height of the data image in pixels
  • im_width: width of the data image in pixels
  • export_file: path to the exported plot

function plot_poles

plot_poles(M, direction, ax=None)

Plot the pole figure for all N rotation matrices and return the pole data in Cartesian coordinates

Args:

  • M: array-like (N,3,3,) of rotation matrices for sample -> crystal coordinates (passive reference frame)
  • direction: array-like (3,) describing the normal for the spherical projection
  • ax: (default None) axis to use for plotting, if none, will create a new figure with a single axis.

Returns:

  • pole_data: numpy array of XY locations of the calculate poles such that
  • `X=pole_data[: ,0]andY=pole_data[:,0]`.

function plot_pole_density

plot_pole_density(
    M,
    direction,
    bins=None,
    use_multiples_of_random=True,
    levels=5,
    smooth_sigma=None,
    annotate_xy=True,
    ax=None
)

Calculates and plots the pole density histogram in Cartesian coordinates on the specified axis

Args:

  • M: array-like (N,3,3,) of rotation matrices for sample -> crystal coordinates (passive reference frame)
  • direction: array-like (3,) describing the normal for the spherical projection
  • bins: (default None) integer number of bins to use for density calculation. If None, then calculate the number of bins as int(sqrt(N)).
  • use_multiples_of_random: (default True) if True, will divide the histogram counts by the expected counts for a uniform/random distribution across the projection to plot the "multiples of random distribution" instead of histogram counts
  • levels: (default 5) int of number of contour levels or array-like (N,) of specific levels to use in the contour plot. If an integer, levels will be chosen automatically based on data bounds.
  • smooth_sigma: (default None) scalar or sequence of scalars input to the scipy.ndimage.gaussian_filter() sigma parameter for smooth the data along axes uniformly (scalar) or along each specified axis (sequence of scalars).
  • ax: (default None) axis to use for plotting, if none, will create a new figure with a single axis.

Returns:

  • ax: axis with the pole figure

This file was automatically generated via lazydocs.