Skip to content

Commit

Permalink
raise error if no data with lower accuracy than limit
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeEfstathiadis committed Dec 15, 2023
1 parent 1e54660 commit ebebb5f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions forest/jasmine/data2mobmat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ebebb5f

Please sign in to comment.