Skip to content

Commit

Permalink
Raise error if no data with lower accuracy than limit (#237)
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeEfstathiadis authored Dec 15, 2023
1 parent 07b2702 commit 0c9449e
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(
f"No GPS record with accuracy less than {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 0c9449e

Please sign in to comment.