Commit 174c808c authored by Alex Nunes's avatar Alex Nunes

Fixed minor bug for compress detections to get the right lats and lons

Changes to be committed:
	modified:   resonate/
parent a3da48d2
......@@ -21,7 +21,7 @@ def compress_detections(detections, timefilter=3600):
['datecollected', 'catalognumber', 'unqdetecid', 'latitude', 'longitude'])
if mandatory_columns.issubset(detections.columns):
stations = detections.groupby('catalognumber').agg(
stations = detections.groupby('station').agg(
'mean')[['latitude', 'longitude']].reset_index()
# Get unique list of animals (not tags), set indices to respect animal and date of detections
......@@ -70,7 +70,7 @@ def compress_detections(detections, timefilter=3600):
out_df = out_df[['catalognumber', 'station', 'seq_num']].drop_duplicates(
).merge(stat_df, on=['catalognumber', 'seq_num'])
out_df = out_df.merge(stations, on='catalognumber')
out_df = out_df.merge(stations, on='station')
return out_df
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment