catch interpolation error

This commit is contained in:
David PAGNON 2024-02-29 12:55:32 +01:00 committed by GitHub
parent ef18f4d859
commit 80802c9226
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -759,7 +759,10 @@ def triangulate_all(config):
# Interpolate missing values
if interpolation_kind != 'none':
for n in range(nb_persons_to_detect):
Q_tot[n] = Q_tot[n].apply(interpolate_zeros_nans, axis=0, args = [interp_gap_smaller_than, interpolation_kind])
try:
Q_tot[n] = Q_tot[n].apply(interpolate_zeros_nans, axis=0, args = [interp_gap_smaller_than, interpolation_kind])
except:
logging.info(f'Interpolation was not possible for person {n}. This means that the not enough points are available, which is often due to a bad calibration.')
# Q_tot.replace(np.nan, 0, inplace=True)
# Create TRC file