Howdy, Stranger!

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

Supported by

pygaze_log plugin iussue with OpenGaze

Hi everybody!

I'm running an experiment using GazePoint eyetracker. My script is actually working, but I saw that the .tsv output file is very long and confusing. Plus, I created a crucial variable in my block loop that specifies each type of trial, and I really need to have this variable in my .tsv file!! So, I could easily identify the condition that each raw refers to.
I thought that this was possible through the setting "Automatically log all variables" in the pygaze_log plugin, that was disabled by default. But unfortunately the experiment stops right at the end of the trial, showing this message:

Unexpected error

item-stack: experiment[run].TRN_loop[run].block_sequence_TRN[run].block_loop_TRN[run].trial_sequence[run].EyeLog[run]
exception type: UnicodeEncodeError
exception message: 'ascii' codec can't encode character u'\xe0' in position 57: ordinal not in range(128)
time: Thu Dec 20 17:46:52 2018

Traceback:
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libqtopensesame\misc\process.py", line 154, in run
exp.run()
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\experiment.py", line 449, in run
self.items.execute(self.var.start)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 103, in execute
self.run(name)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 122, in run
self[name].run()
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\sequence.py", line 51, in run
self.experiment.items.run(_item)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 122, in run
self[name].run()
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\loop.py", line 341, in run
self.experiment.items.execute(self._item)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 103, in execute
self.run(name)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 122, in run
self[name].run()
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\sequence.py", line 51, in run
self.experiment.items.run(_item)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 122, in run
self[name].run()
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\loop.py", line 341, in run
self.experiment.items.execute(self._item)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 103, in execute
self.run(name)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 122, in run
self[name].run()
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\sequence.py", line 51, in run
self.experiment.items.run(_item)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 122, in run
self[name].run()
File "C:\Program Files (x86)\OpenSesame\share\opensesame_plugins\pygaze_log\pygaze_log.py", line 52, in run
info[u'value'])
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pygaze_eyetracker\baseeyetracker.py", line 319, in log_var
self.log(u"var %s %s" % (safe_decode(var), safe_decode(val)))
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pygaze_eyetracker\libopengaze.py", line 685, in log
self._elog(msg)
File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pygaze_eyetracker\libopengaze.py", line 167, in _elog
self.extralogfile.write(msg + '\n')
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe0' in position 57: ordinal not in range(128)

I also adopted the method suggested by @eduard in this discussion (http://forum.cogsci.nl/index.php?p=/discussion/2247/pygaze-log-variables-in-edf-dataviewer), namely write the following code in a inline script:
exp.pygaze_eyetracker.log("!V TRIAL_VAR var %s" % var)
...but I saw that this code reports my variable only in .txt file; while I really need it in my .tsv file!

Any possible solution??

Thank you in advance!

Martina

Comments

  • Hi Martina,

    What happens is that you're trying to write a non-ascii character to a file (which might just be in a reference to a file location, and not something you're deliberately trying to log). Allowing this to work is on my TODO list for PyGaze, but unfortunately not yet possible.

    You could, instead of logging all variables, simply logging the variable of your choice by including the following in your pygaze_log item:

    [var_name]

    Where var_name should be replaced by the name of the variable that you need to log.

    Make sure to deselect the option to log all variables!

    Cheers,
    Edwin

  • Hi Edwin!

    Thanks for you reply.
    I'm not sure of where to include my variable in the pygaze_log item. I wrote it on the log message (it seemed to be the only editable space) and it appeared on the .txt file. Unfortunately, I need it to be on my .tsv file together with the coordinates of the saccades. Did I miss something?

    Thank you!
    Martina

  • Hi Martina,

    The pygaze_log item uses PyGaze's EyeTracker.log function, which should add the variable to both files! Have you checked the right-most column in the TSV file?

    If it's not in there, I would be very interested in seeing your experiment script and your TSV file, please. That would greatly help with any further debugging efforts.

    Cheers,
    Edwin

  • Hi Edwin!

    My variable is not in the right-most column! So, here are my script and the .tsv file as well.

    Thanks a lot for your help!!

    Martina

  • edited January 2019

    Hi Martina,

    Could you clarify why you think your variable is not in the right-most column? I just opened "subject-00.tsv", and there are definitely logged messages in there. For example, I can see "START_EXPL_0", "STOP_EXPL_0", "START_GRASP_0", "STOP_GRASP_0", and "START_EXPL_1" (and a whole bunch more of those messages, numbering up).

    Are other things supposed to be in there, or are you missing things?

    Cheers,
    Edwin

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games