Dividing line (cracks and cavities)

Tomogram split by a dividing line (a chord between two sensors).

A crack blocks the rays crossing it and in the whole tomogram it spreads into a low velocity zone that looks like a cavity. If the cross-section is split by a chord between two sensors, each half is reconstructed from its own sensors only and the halves are merged, a defect along the chord disappears while a cavity stays. The difference between the whole and the merged tomogram is measured by split_metrics(). The main measure of a crack is the delay of the rays crossing the line: the merged halves know nothing about the rays crossing the line, so a crack along the line makes these rays much slower than the halves predict. scan_split_lines() tries all dividing lines:

from tomotree import analysis, split
res = split.split_tomogram(data, (2, 8), method='ERSM')
sound_speed = analysis.sound_wood_speed(res['full'])
speed_min, speed_max = analysis.color_limits(res['full'], sound_speed=sound_speed)
print(split.split_metrics(res['full'], res['merged'], sound_speed, speed_min))

Sensors are numbered from 1 and ordered around the stem.

tomotree.split.crossing_rays(t, line)

Rays of t crossing line = (a, b): one end on each side, none at the ends of the line.

tomotree.split.plot_line(ax, t, line, **kwds)

Draw the dividing line (a, b) between the sensors of t into ax.

kwds go to ax.plot (default: black dashed line over the tomogram).

tomotree.split.plot_scan(t, table, metric='crossing_delay', ax=None, top=5, label=None)

Sensors of t and the dividing lines of table (scan_split_lines()) coloured by metric; the top lines with the largest value are thicker. label is the colorbar label (default: the name of the metric). Returns the matplotlib axes.

tomotree.split.scan_split_lines(data, sound_speed, speed_min, min_skipped=3, full=None, progress=None, **params)

Metrics of all dividing lines (split_lines()), the largest crossing delay first.

params are the arguments of analysis.reconstruct(), sound_speed and speed_min those of split_metrics() (from the whole tomogram). progress(i, total) is called after each line. Returns a DataFrame with the columns line, a, b and METRICS.

tomotree.split.split_halves(n, line, include_only=None)

Sensors of the two halves cut by line = (a, b): a..b and b..n, 1..a.

Both halves contain the ends of the line; sensors not in include_only are left out. Raises ValueError for an invalid line.

tomotree.split.split_lines(n, include_only=None, min_skipped=3)

Dividing lines (a, b) (a < b, numbered from 1) of a tree with n sensors.

Both ends are active sensors (include_only, None = all) and on each side of the line at least min_skipped active sensors lie between the ends, so the smaller half has min_skipped + 2 sensors.

tomotree.split.split_metrics(full, merged, sound_speed, speed_min, line=None)

Difference between the whole and the merged tomogram.

line is the dividing line (a, b); None takes it from merged.info['split_line'] (set by split_tomogram()).

  • crossing_delay: median over the rays crossing the line (crossing_rays()) of the measured time divided by the time computed from the merged tomogram, minus 1, in %. The halves are reconstructed without these rays; a large delay means that something along the line (a crack) slows them down.

  • rms_percent: root mean square of the velocity difference over the cells with a value in both, in % of sound_speed;

  • defect_area_full, defect_area_merged: area with velocity below speed_min in % of the area with a value;

  • defect_area_change: full minus merged (positive: the defect disappears when the tomogram is split, as for a crack along the line);

  • coverage: % of the cells of the whole tomogram with a value in the merged one.

tomotree.split.split_tomogram(data, line, full=None, **params)

Whole tomogram, its two halves cut by line = (a, b) and the merged tomogram.

params are the arguments of analysis.reconstruct(); the halves use the sensors of include_only (None = all) on their side of the line and the same disabled rays. full is the whole tomogram if already computed. Returns a dict with full, halves (two Tomo), sensors (the sensors of the halves, split_halves()), merged (a copy of full with the merged cell velocities and the rays of the halves) and line.