No data found for CTT tag(s) with trailing spaces

I’m having trouble extracting detection data for a number of tags from my .motus dataset. For example, I have a CTT powertag whose manufacturing ID is 55524C1E. When I run my code below, I get the message that I programed (no data found for tag: 55524C1E). However, if I search the Motus dashboard for the deployment ID, I see that it was detected at two of our local stations. Motus Animal summary

Why can’t I pull that data? What is a viable workaround?

rm(list=ls()) #wipes R’s brain

library(motus) library(lubridate) library(dplyr) library(RSQLite)

Set the system environment time zone to UTC (to

ensure that you are always working in UTC)

Sys.setenv(TZ = “UTC”)

setwd(“C:/Users/degrootel/Documents/PARC Stopover/Motus project data/”) #default filepath

#srvTimeout(1800) # Set timeout to 1800 seconds (30 minutes)

sql.motus ← tagme(416, new = FALSE, update = FALSE, dir = “./data/”) ## update data, whole database

Getting tags

#DATE.FORMAT ← “%Y-%m-%d” tags.all ← data.frame(read.csv(“fall_22_tags.csv”), header = T) %>% mutate(StartDate = as.POSIXct(StartDate, format = “%m/%d/%Y %H:%M”))

Loop through each row of tags.all

for (i in 1:nrow(tags.all)) { tag ← tags.all[i, 1] species ← tags.all[i, 3]

Filter and collect the data

df_tag ← tbl(sql.motus, “alltags”) %>% filter(mfgID %in% c(tag)) %>% collect()

Skip if no data found for the tag

if (nrow(df_tag) == 0) { message(paste(“No data found for tag:”, tag, “- skipping.”)) next }

Process and filter the data

df_tag ← df_tag %>% as.data.frame() %>% mutate(ts = as_datetime(ts, tz = “UTC”, origin = “1970-01-01”)) %>% filter(runLen > 2)

Define the filename

filename ← paste0(“./data/fall_22/df_”, tag, “_”, species, “_fall22.RDS”)

Save the filtered data

saveRDS(df_tag, filename) message(paste(“Saved data for tag:”, tag, “to”, filename)) }

Hi Lucas, I’m having the same issue pulling any data from our CTT tags as well. Have you found any solutions to this?

I found that many of the tags that I couldn’t pull had some extra spaces after the eight-digit alpha numeric manufacturing ID. I didn’t check all of them, but it seemed like a lot of them had an E as the last or second to last letter. I wonder if CTT added spaces because of the issue with E’s turning the numbers into exponential numbers. A “fix” that I found was to download my tag metadata and use the manufacturing ID’s from that csv file as the lookup in my code above.

I would look at the dashboard for the project and make sure they were detected by some other towers as a cross reference.

Indeed there are about 1600 CTT tags in the Motus database with trailing spaces. I’m not sure if that’s intentional but I suspect not.

BTW @user86 there are 54 tags in Project 416 with a trailling space. @Mary_Scofield do you have any specific examples? It may not may not be the same issue.

@user80 and @user1023 I’ll follow up in email

@user86 we’ve stripped out the spaces on all existing tag registrations so you should be able to query these “normally”. Let us know if you find otherwise.

…And thanks for pointing this out!