HAPPY.radial_hydride_fraction module

HAPPY.radial_hydride_fraction.hough_rad(image, num_peaks, min_distance=5, min_angle=5, val=0.25, scale=None, location=None)[source]

Perform Hough Line Transfom to determine radial hydride fraction.

Parameters
  • image (array) – input thresholded hydride image

  • num_peaks (float) – number of measured peaks in one rectangle.

  • min_distance (float) – minimum distance separating two parallel lines. It seems that a value of 5 is good

  • min_angle (float) – minimum angle separating two lines it seems that a value of 5 is good

  • val (float) – val is a number < 1 where, only hydrides that are at least val times the length of the longest hydride are measured. This helps to reduce noise becuase only hydrides that are significant in size are included in the calculation. The default value for this is 0.25, if you have much smaller hydride branches that you want to pick up this value can be reduced, but remember the noise increases as well.

  • scale (float) – Scale in meters per pixel.

  • location (str) – Location of scale bar i.e. ‘lower right’, ‘upper left’

Returns

  • angle_list (array) – List of angles generated from the hough transform.

  • len_list (array) – List of line lengths generated from the hough transform.

HAPPY.radial_hydride_fraction.RHF_no_weighting_factor(angle_list, len_list)[source]

Calculate the Radial Hydride Fraction without any weighting factor

Parameters
  • angle_list (array) – calculated from the Hough line transform

  • len_list (array) – List of lengths generated from the hogh line transform

Returns

  • radial (float) – fraction of radial hydrides

  • circumferential (float) – fraction of circumferential hydrides

HAPPY.radial_hydride_fraction.weighted_RHF_calculation(angle_list, len_list)[source]

Weighted Radial Hydride Fraction Calculation

Parameters
  • angle_list (array) – List of angles generated from the hogh line transform

  • len_list (array) – List of lengths generated from the hogh line transform

Returns

RHF – Weighted radial hydride fraction

Return type

float