Skip to content

module myna.application.exaca.grainstats


function get_mean_grain_area

get_mean_grain_area(df2D, cell_size, threshold_grain_size=6)

Returns mean grain area, filtering out grains smaller than a threshold

Args:

  • df2D: dataframe corresponding to a 2D slice of a 3D grain structure
  • cell_size: spacing of pixels in the dataframe
  • threshold_grain_size: size below which grains are too small to be included in the average calculation

Returns:

  • mean_grain_area: in square meters

function get_fract_nucleated_grains

get_fract_nucleated_grains(df2D)

Returns the fraction of grains formed via nucleation event

Args:

  • df2D: dataframe corresponding to a 2D slice of a 3D grain structure

Returns:

  • fract_nucleated_grains: fraction of grains in the 2D slice formed via nucleation event (denoted with a negative grain ID). Note that the very small grains thresholded out in the mean area calculation are not filtered out here - but could be in the future

function get_misorientation_z_ref

get_misorientation_z_ref(reference_id_filename)

From the file of grain orientations, return a list of misorientations between a grain orientation's nearest <100> and the Z axis

Args:

  • reference_id_filename: name of file containing rotation matrices to be mapped to each grain_id

Returns:

  • misorientation_z_ref: np array of misorientation values, in degrees for each possible grain orientation in the file

function get_misorientation_z

get_misorientation_z(df, misorientation_z_ref)

args:

  • df: dataframe containing "Grain ID" values
  • misorientation_z_ref: np array of misorientation values, in degrees, for each possible grain orientation

Returns:

  • misorientation_z_list: np array of misorientation values, in degrees, for each cell in the df

function get_bin_centers_fre_dia

get_bin_centers_fre_dia(df2D, misorientation_z_list)

Freedman–Diaconis rule for bin width calculation based on the skewed nature of both the untextured and actual misorientation distributions Bin data based on the number of unique grains in the data

Args:

  • df: dataframe containing "Grain ID" values
  • misorientation_z_list: list of grain misorientations with <100>, in degrees, used to map gid values

Returns:

  • bin_edges: edges for binned misorientation data
  • bin_centers: center location of bins for misorientation data

function get_wasserstein_distance_misorientation_z

get_wasserstein_distance_misorientation_z(df, ref_file)

Calculate the distance between the orientations in a 2D slice of Euler angles and a randomly oriented, isotropic reference

Args:

  • df: DataFrame containing Grain ID values
  • ref_file: Reference file containing orientation IDs

This file was automatically generated via lazydocs.