Commit a66af83e authored by Félix Hartmann's avatar Félix Hartmann
Browse files

Adding a 'radius' plot to the 'Time series' windows.

parent dd008423
......@@ -1311,7 +1311,8 @@ def show_time_series(tige_id=None):
# Retrieving the tige id from the hdf5 file
tige_hdf_id = get_hdf5_tigeid(hdf5file, cur_tige)
# Retrieving useful data
# Retrieving useful data as time-indexed arrays
radii = tiges_data.diam[cur_tige].mean(axis=1) # space-averaged tige radii
x, y, s, lengths, angles, tip_angles, measure_zone, lines = \
load_postprocessed_data(hdf5file, tige_hdf_id)
......@@ -1320,7 +1321,7 @@ def show_time_series(tige_id=None):
fig_time = mpl.figure(strings["Organ"] + ' %s'%str(tige_name), figsize=(10, 6))
# grid = mpl.GridSpec(4, 3, wspace=.4, hspace=.4)
grid = mpl.GridSpec(4, 3)
grid = mpl.GridSpec(6, 3)
# Scaling
length_unit = "pix"
......@@ -1331,6 +1332,7 @@ def show_time_series(tige_id=None):
y *= scale_cmpix
s *= scale_cmpix
lengths *= scale_cmpix
radii *= scale_cmpix
lines *= scale_cmpix
# If photo times are given, convert photo numbers into minutes
......@@ -1365,6 +1367,7 @@ def show_time_series(tige_id=None):
mask[ss_image] = False
times = times[mask]
lengths = lengths[mask]
radii = radii[mask]
angles = angles[mask]
tip_angles = tip_angles[mask]
ss_line = lines[ss_image]
......@@ -1395,15 +1398,21 @@ def show_time_series(tige_id=None):
axAngle.plot(times, tip_angles, '+-', color=tiges_colors[cur_tige], lw=2)
axLength = fig_time.add_subplot(grid[2:, 1:], sharex=axAngle)
axLength = fig_time.add_subplot(grid[2:4, 1:], sharex=axAngle)
axLength.grid(True)
axLength.xaxis.set_major_locator(MultipleLocator(graduation))
axLength.set_xlabel(xlabel)
axLength.set_ylabel(strings["length"] + " (%s)"%length_unit)
axLength.plot(times, lengths, '+-', color=tiges_colors[cur_tige], lw=2)
axRadius = fig_time.add_subplot(grid[4:6, 1:], sharex=axAngle)
axRadius.grid(True)
axRadius.xaxis.set_major_locator(MultipleLocator(graduation))
axRadius.set_xlabel(xlabel)
axRadius.set_ylabel(strings["radius"] + " (%s)"%length_unit)
axRadius.plot(times, radii, '+-', color=tiges_colors[cur_tige], lw=2)
if exclude_ss_from_time_series and ss_image == cur_image:
# If the stead-state image has to be excluded from time series and is the current
# If the steady-state image has to be excluded from time series and is the current
# image, just create empty Line2D.
colortige, = axProfiles.plot([], [], 'k', lw=2.5)
time_select_angle, = axAngle.plot([None, None], axAngle.get_ylim(), 'k--', lw=1.5)
......@@ -4726,6 +4735,7 @@ def set_string_variables():
strings["photo number"] = _("photo number")
strings["length"] = _("length")
strings["s"] = _("curvilinear abscissa")
strings["radius"] = _("radius")
strings["angle"] = _("angle")
strings["tip angle"] = _("tip angle")
strings["degree"] = _("(deg)")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment