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

[bugfix] Corrects an error in time units when computing gamma tilde.

parent aba696f9
......@@ -2918,11 +2918,20 @@ def show_gamma_tilde():
S_res, S_tot = res[0], ma.sum((weights * log_A_dev_range - weighted_mean)**2)
R2 = 1 - S_res / S_tot
log_A_dev_fitted = fit_log_A_dev[0] * times + fit_log_A_dev[1]
slope, intercept = fit_log_A_dev[0], fit_log_A_dev[1]
log_A_dev_fitted = slope * times + intercept
plfit_log_A_dev.set_data(time_range, log_A_dev_fitted[i1:i2])
plfit_A_dev.set_data(times[i1:], exp(log_A_dev_fitted[i1:]))
gamma = -fit_log_A_dev[0] * 60 # unit is h¯¹ if times are given
# gamma is the opposite of the slope of log_A(t):
gamma = -slope
# If photo timestamps are given, we want gamma in the same unit as
# the Relative Elongation Rate (RER), which is in h¯¹.
if time_unit == strings["min"]:
gamma *= 60
elif time_unit == strings["days"]:
gamma /= 24
gamma_tilde = gamma / RER
RER_unit_TeX = growth_data["RER_unit_TeX"].astype(str)
......
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