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
tcrossingline = (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 oftintoax.kwdsgo toax.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
tand the dividing lines oftable(scan_split_lines()) coloured bymetric; thetoplines with the largest value are thicker.labelis 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.paramsare the arguments ofanalysis.reconstruct(),sound_speedandspeed_minthose ofsplit_metrics()(from the whole tomogram).progress(i, total)is called after each line. Returns a DataFrame with the columnsline,a,bandMETRICS.
- tomotree.split.split_halves(n, line, include_only=None)
Sensors of the two halves cut by
line = (a, b):a..bandb..n, 1..a.Both halves contain the ends of the line; sensors not in
include_onlyare 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 withnsensors.Both ends are active sensors (
include_only, None = all) and on each side of the line at leastmin_skippedactive sensors lie between the ends, so the smaller half hasmin_skipped + 2sensors.
- tomotree.split.split_metrics(full, merged, sound_speed, speed_min, line=None)
Difference between the whole and the merged tomogram.
lineis the dividing line(a, b); None takes it frommerged.info['split_line'](set bysplit_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 % ofsound_speed;defect_area_full,defect_area_merged: area with velocity belowspeed_minin % 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.paramsare the arguments ofanalysis.reconstruct(); the halves use the sensors ofinclude_only(None = all) on their side of the line and the same disabled rays.fullis the whole tomogram if already computed. Returns a dict withfull,halves(twoTomo),sensors(the sensors of the halves,split_halves()),merged(a copy offullwith the merged cell velocities and the rays of the halves) andline.