From bff25d1ef0b58ca33f4fa380877815c53bec678e Mon Sep 17 00:00:00 2001 From: Georgios Efstathiadis Date: Thu, 19 Dec 2024 13:29:11 +0200 Subject: [PATCH] bug at smooth_temp_ends --- src/forest/jasmine/traj2stats.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/forest/jasmine/traj2stats.py b/src/forest/jasmine/traj2stats.py index 782c10a3..5067a13e 100644 --- a/src/forest/jasmine/traj2stats.py +++ b/src/forest/jasmine/traj2stats.py @@ -531,6 +531,10 @@ def smooth_temp_ends( temp[0, 4] = (1 - p1) * x0 + p1 * x1 temp[0, 5] = (1 - p1) * y0 + p1 * y1 temp[0, 6] = t1_temp + + # if expanding range, then convert to imputed status and not observed + if max(p0, p1) > 1: + temp[0, 7] = 0 else: if parameters.split_day_night and i % 2 != 0: t0_temp_l = [start_time, end_time2] @@ -558,6 +562,11 @@ def smooth_temp_ends( end_temp[j], 2 ] + p1 * temp[end_temp[j], 5] temp[end_temp[j], 6] = t1_temp_l[j] + + if p0 > 1: + temp[start_temp[j], 7] = 0 + if p1 > 1: + temp[end_temp[j], 7] = 0 else: p0 = (temp[0, 6] - t0_temp) / (temp[0, 6] - temp[0, 3]) p1 = ( @@ -571,6 +580,11 @@ def smooth_temp_ends( temp[-1, 5] = (1 - p1) * temp[-1, 2] + p1 * temp[-1, 5] temp[-1, 6] = t1_temp + if p0 > 1: + temp[0, 7] = 0 + if p1 > 1: + temp[-1, 7] = 0 + return temp