polyTEM.crystal_peaks.flow_fields.trim_lines¶
- polyTEM.crystal_peaks.flow_fields.trim_lines(propagated_lines, intensity_matrix_shape, step_size, line_spacing, spacing_resolution, angle_spacing_degrees, max_overlap_fraction=0.5, min_length=2, verbose=False)¶
Trims lines created by the propagate_lines function for purposes of readability, rendering speed, and homogeneous line density. Inputs:
- propagated_lines: (4 x m x n) matrix, which contains the (x, y, theta, is_active) values for each point m along
each line n. is_active is a boolean value which is true if the line is still being drawn at that point.
intensity_matrix_shape: dimensions provided by intensity_matrix.shape step_size: real space distance between points in the intensity matrix, i.e. 10nm line_spacing: minimum distance between two lines before they start to overlap. Note that some overlaps
may be allowed.
spacing_resolution: higher values reduce geometric artifacts that cause greater spacing at certain angles. angle_spacing_degrees: minimum angular distance between two crossing lines before those lines count as
overlapping.
- max_overlap_fraction: fraction of line that can overlap with already-drawn lines. If the line overlaps
by more than this it is not drawn.
min_length: lines with less points than the minimum length are not drawn verbose: Boolean. When true, extra troubleshooting information is shown, including the space-filling process.
- Outputs:
trimmed_lines: matplotlib.pyplot figure drawn by the function