Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

help with timestamp!

hi,

first, thanks a lot for the amazing tool you created :)
second, I'm so glad your health problems are being sorted out.
third, here's my problem, reposted from the GIThub issue. I hope you can help me :/

  • how to get the timestamp (time.time()) from the corrected time stamp in the pygaze output -

I'm struggling to get the timestamp from the tsv output. I developed my own script to present stuff with pygame and it records the timestamp from the time.time() function.
I see that in pyGaze that is corrected by the 'tracker timestamp' (internal time of the eyetracker). I have no idea what it is and I would love to find a way to convert the 'time'-timestamp in the tsv into the time.time()-timestmap.
Why is this correction useful anyway, and what is the internal time of the eyetracker?
can this be done? I hope so otherwise I'm in big troubles..
thanks so much in advance!

Comments

  • edit:

    I guess this is the culprit

            sample = self._tracker.get_frame()
            t1 = time.time()
            # put the sample in the Queue
            queue.put(sample)
            # release the Threading Lock
            self._lock.release()
            # Update the newest frame
            self._newestframe = copy.deepcopy(sample)
            # Calculate the clock difference
            self._clockdiff = sample['time'] - t1
    
  • I still have no idea about that 'time', but I managed to convert the timestamp from string format into unix timestamp format :)

    thanks to this:
    http://stackoverflow.com/questions/26161156/python-converting-string-to-timestamp-with-microseconds

  • Hi Daniele, I am glad you figured it out. I thought I would still share what I know about the timestamp because I am still trying to understand it myself.
    The correction seems to be necessary because the EyeTribe has its own clock which it uses to record the time a sample was collected. Pygaze is using the computer's clock by calling the time.time() function. These two clocks are not guaranteed to be synchronized. This correction is important for example when you want to send a message from python into the EyeTribe log file, and for it to correspond with the EyeTribe time. By taking the difference of the two times, you can determine how far apart they are. You can then add this amount of time to the last sample's time and you should supposedly get a more accurate idea of when the message was logged according to the EyeTribe clock.

  • thanks for the answer!
    I checked myself the synchronization and it seems OK.
    I will ask you more about this in the future, but now I realised I have a much bigger problem..
    see my next post :)

Sign In or Register to comment.