tjmahr / lookr

Scripts for looking-while-listening and visual-world eyetracking experiments
Other
7 stars 2 forks source link

weird timing thing #23

Closed tjmahr closed 5 years ago

tjmahr commented 8 years ago

Today, I wondered if it would be possible to identify probable trial boundaries (Inter-Trial Intervals) from the time columns in gazedata files emitted by Eprime.

My first thought was to diff(gazedata$RTTime) to calculate the difference in time between Frame N and Frame N-1. The biggest jumps in time would be the ITIs. Which works perfectly:

image

But on the plot, I see some weird diffs:

image

The first one shows up in the data as:

image

And the second as:

image

Clocks

The column RTTime is what we might call Eprime Local Time. I have used this column because stimulus presentation times in the Eprime administration log are measured with the same clock and relative time, making it easy to sync up Eprime's stimulus presentation with gaze location. RTTime is measured in milliseconds, possibly the running milliseconds from the start of the experiment:

fivenum(gazedata$RTTime)
#> [1]  27871.0  80509.0 140730.0 194358.5 248730.0
fivenum(gazedata$RTTime) / 1000
#> [1]  27.8710  80.5090 140.7300 194.3585 248.7300
fivenum(gazedata$RTTime - min(gazedata$RTTime)) / 1000
#> [1]   0.0000  52.6380 112.8590 166.4875 220.8590

The gazedata file also provides a column for TETTime for Tobii Eye Tracker Time, which has none of these hiccups:

image

But it's apparently measured as milliseconds since whenever computer time 0 was in the 70's

head(gazedata$TETTime)
#> [1] 1.439215e+12 1.439215e+12 1.439215e+12 1.439215e+12 1.439215e+12
#> [6] 1.439215e+12
fivenum(gazedata$TETTime - min(gazedata$TETTime))
#> [1]      0.00  52411.89 112858.95 166487.96 220861.22
fivenum(gazedata$TETTime - min(gazedata$TETTime)) / 1000
#> [1]   0.00000  52.41189 112.85895 166.48796 220.86122

Questions

Some questions I need to figure out:

When I synchronize time using the Tobii clock, it kinda straightens those kinks. Plots below focus on the first set of weird points...

fixed_time <- (gazedata$TETTime - min(gazedata$TETTime)) + min(gazedata$RTTime)
# Time since experiment start: Corrected vs Eprime
plot(fixed_time[2450:2700], gazedata$RTTime[2450:2700])  

image

# Interframe intervals: Eprime (red) vs Tobii (black)
plot(diff(gazedata$RTTime[2450:2700]), col = "red")
points(diff(fixed_time[2450:2700]))

image

zhamzham commented 5 years ago

Hello! Thank you for bringing up this issue. I wanted to see if you could please provide some guidance. Were you able to resolve this issue? Which time did you end up using for further analysis? Thanks! Z

tjmahr commented 4 years ago

Ooops I think I used RTTime, but I read in both. My current code gazedata files is here https://github.com/tjmahr/littlelisteners/blob/master/R/gazedata.R