From ebebb5f21e015588e21974f88cc6e9549c0397f0 Mon Sep 17 00:00:00 2001 From: Georgios Efstathiadis Date: Fri, 15 Dec 2023 11:30:34 -0500 Subject: [PATCH] raise error if no data with lower accuracy than limit --- forest/jasmine/data2mobmat.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/forest/jasmine/data2mobmat.py b/forest/jasmine/data2mobmat.py index da282397..1818bef2 100644 --- a/forest/jasmine/data2mobmat.py +++ b/forest/jasmine/data2mobmat.py @@ -179,6 +179,10 @@ def collapse_data( # Filter out rows where the GPS accuracy is beyond # the provided accuracy_limit data = data[data.accuracy < accuracy_limit] + if data.shape[0] == 0: + raise ValueError( + "No GPS record with accuracy less than {}.".format(accuracy_limit) + ) # Get the start and end timestamps in seconds t_start = sorted(np.array(data.timestamp))[0] / 1000