Not able to read .asc file generated by eyelink 1000+
Followed the data demonstrated on Analyzing eye-movement data, but not able to read .asc
file properly. The error information is like:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-3-d108d6f85b36> in <module>
----> 1 dm = get_data()
2 print(dm)
~/miniconda3/lib/python3.7/site-packages/datamatrix/_functional/_memoize.py in _call_without_arguments(self, *args, **kwargs)
223 return self._write_cache(
224 memkey,
--> 225 self._fnc(*args, **kwargs)
226 )
227
<ipython-input-2-107bd9e4e4c4> in get_data()
21 dm = ops.keep_only(
22 dm,
---> 23 dm.set_size, dm.correct, dm.ptrace_sounds, dm.ptrace_retention,
24 dm.fixxlist_retention, dm.fixylist_retention
25 )
~/miniconda3/lib/python3.7/site-packages/datamatrix/_datamatrix/_datamatrix.py in __getattr__(self, name)
605 if name in ('__getstate__', '_cols'):
606 raise AttributeError()
--> 607 return self._getcolbyname(name)
608
609 def __getitem__(self, key):
~/miniconda3/lib/python3.7/site-packages/datamatrix/_datamatrix/_datamatrix.py in _getcolbyname(self, key)
388 col = self._cols.get(key, None)
389 if col is None:
--> 390 raise AttributeError(u'No column named "%s"' % key)
391 return col
392
AttributeError: No column named "set_size"
and the data type of my .asc
file is:
** CONVERTED FROM E:\Git_liweizhe\Research\Papers\Journal Papers\2018\Pupil_color\Exp\code\data\edf\01_m_25F.EDF using edfapi 3.1 Win32 Oct 18 2018 on Fri Jan 18 16:55:01 2019
** DATE: Wed Dec 26 19:24:32 2018
** TYPE: EDF_FILE BINARY EVENT SAMPLE TAGGED
** VERSION: EYELINK II 1
** SOURCE: EYELINK CL
** EYELINK II CL v5.12 May 12 2017
** CAMERA: Eyelink GL Version 1.2 Sensor=AJ7
** SERIAL NUMBER: CLG-BEA17
** CAMERA_CONFIG: BEA17200.SCD
** Inspiration_Color
**
MSG 848272 DISPLAY_COORDS = 0 0 1919 1079
INPUT 900827 127
MSG 907988 !CAL
CALIBRATION (HV5,P-CR) FOR LEFT: <<<<<<<<<
MSG 907988 !CAL Calibration points:
MSG 907988 !CAL -33.5, -42.9 0, 108
MSG 907988 !CAL -33.6, -58.9 0, -2255
MSG 907988 !CAL -34.0, -29.1 0, 2399
MSG 907988 !CAL -69.1, -43.6 -4157, 108
MSG 907988 !CAL -1.6, -43.6 4157, 108
MSG 907988 !CAL 0.0, 0.0 0, 0
MSG 907988 !CAL eye check box: (L,R,T,B)
-76 7 -65 6
MSG 907988 !CAL href cal range: (L,R,T,B)
-6236 6236 -3418 3562
MSG 907988 !CAL Cal coeff:(X=a+bx+cy+dxx+eyy,Y=f+gx+goaly+ixx+jyy)
0.00031112 123.94 2.0783 0.20375 0.16679
107.89 0.3367 157.3 0.085003 0.57063
MSG 907988 !CAL Prenormalize: offx, offy = -33.517 -42.944
MSG 907988 !CAL Gains: cx:137.499 lx:120.471 rx:154.821
MSG 907988 !CAL Gains: cy:223.282 ty:171.314 by:253.597
MSG 907988 !CAL Resolution (upd) at screen center: X=1.9, Y=1.2
MSG 907988 !CAL Gain Change Proportion: X: 0.285 Y: 0.480
MSG 907988 !CAL Gain Ratio (Gy/Gx) = 1.624
MSG 907988 !CAL Cross-Gain Ratios: X=0.026, Y=0.002
MSG 907988 !CAL PCR gain ratio(x,y) = 2.201, 1.878
MSG 907988 !CAL CR gain match(x,y) = 1.010, 1.010
MSG 907988 !CAL Slip rotation correction OFF
MSG 907988 !CAL
CALIBRATION (HV5,P-CR) FOR RIGHT: <<<<<<<<<
MSG 907988 !CAL Calibration points:
MSG 907988 !CAL -46.7, -47.0 0, 108
MSG 907988 !CAL -46.5, -62.1 0, -2255
MSG 907988 !CAL -47.2, -33.2 0, 2399
MSG 907988 !CAL -78.4, -47.0 -4157, 108
MSG 907988 !CAL -15.5, -48.8 4157, 108
MSG 907988 !CAL 0.0, 0.0 0, 0
MSG 907988 !CAL eye check box: (L,R,T,B)
-86 8 -68 6
MSG 907988 !CAL href cal range: (L,R,T,B)
-6236 6236 -3418 3562
MSG 907988 !CAL Cal coeff:(X=a+bx+cy+dxx+eyy,Y=f+gx+goaly+ixx+jyy)
0.00031112 132.21 3.2536 0.041906 0.11144
107.89 4.5507 161.47 0.14073 0.32727
MSG 907988 !CAL Prenormalize: offx, offy = -46.681 -47.047
MSG 907988 !CAL Gains: cx:138.230 lx:133.009 rx:144.588
MSG 907988 !CAL Gains: cy:203.792 ty:178.628 by:228.657
MSG 907988 !CAL Resolution (upd) at screen center: X=1.9, Y=1.3
MSG 907988 !CAL Gain Change Proportion: X: 0.087 Y: 0.280
MSG 907988 !CAL Gain Ratio (Gy/Gx) = 1.474
MSG 907988 !CAL Cross-Gain Ratios: X=0.031, Y=0.031
MSG 907988 !CAL PCR gain ratio(x,y) = 2.205, 1.964
MSG 907988 !CAL CR gain match(x,y) = 1.010, 1.010
MSG 907988 !CAL Slip rotation correction OFF
MSG 908008 !CAL CALIBRATION HV5 LR LEFT GOOD
MSG 908008 !CAL CALIBRATION HV5 LR RIGHT GOOD
INPUT 909997 127
MSG 920294 !CAL VALIDATION HV5 LR LEFT GOOD ERROR 0.46 avg. 1.23 max OFFSET 0.39 deg. -0.6,20.5 pix.
MSG 920294 !CAL VALIDATION HV5 LR RIGHT GOOD ERROR 0.45 avg. 1.38 max OFFSET 0.15 deg. 5.0,6.1 pix.
MSG 920294 VALIDATE LR POINT 0 LEFT at 960,540 OFFSET 0.25 deg. -6.1,11.8 pix.
MSG 920294 VALIDATE LR 4POINT 0 RIGHT at 960,540 OFFSET 0.22 deg. 1.7,-11.6 pix.
MSG 920294 VALIDATE LR POINT 1 LEFT at 960,81 OFFSET 0.38 deg. 19.9,-1.8 pix.
MSG 920294 VALIDATE LR 4POINT 1 RIGHT at 960,81 OFFSET 0.23 deg. -0.2,-11.9 pix.
MSG 920294 VALIDATE LR POINT 2 LEFT at 960,998 OFFSET 0.38 deg. -7.8,18.1 pix.
MSG 920294 VALIDATE LR 4POINT 2 RIGHT at 960,998 OFFSET 0.22 deg. -5.2,-10.1 pix.
MSG 920294 VALIDATE LR POINT 3 LEFT at 144,540 OFFSET 0.35 deg. 15.5,9.9 pix.
MSG 920294 VALIDATE LR 4POINT 3 RIGHT at 144,540 OFFSET 0.46 deg. 14.7,18.9 pix.
MSG 920294 VALIDATE LR POINT 4 LEFT at 1775,540 OFFSET 1.23 deg. 1.2,64.3 pix.
MSG 920294 VALIDATE LR 4POINT 4 RIGHT at 1775,540 OFFSET 1.38 deg. 17.9,69.8 pix.
INPUT 925092 127
INPUT 1054798 127
INPUT 1054908 127
MSG 1056864 DRIFTCORRECT LR LEFT at 960,540 OFFSET 0.10 deg. -2.8,-4.3 pix.
MSG 1056864 DRIFTCORRECT LR RIGHT at 960,540 OFFSET 0.16 deg. 8.0,0.6 pix.
MSG 1057003 TRIALID
MSG 1057006 RECCFG CR 500 2 1 LR
MSG 1057006 ELCLCFG BTABLER
MSG 1057006 GAZE_COORDS 0.00 0.00 1919.00 1079.00
MSG 1057006 THRESHOLDS L 81 209 R 83 217
MSG 1057006 ELCL_WINDOW_SIZES 160 160 0 0
MSG 1057006 CAMERA_LENS_FOCAL_LENGTH 38.00
MSG 1057006 ELCL_PROC ELLIPSE (5)
MSG 1057006 ELCL_EFIT_PARAMS 1.01 4.00 0.15 0.05 0.65 0.65 0.00 0.00 0.30
MSG 1057007 !MODE RECORD CR 500 2 1 LR
START 1057008 LEFT RIGHT SAMPLES EVENTS
PRESCALER 1
VPRESCALER 1
PUPIL AREA
EVENTS GAZE LEFT RIGHT RATE 500.00 TRACKING CR FILTER 2
SAMPLES GAZE LEFT RIGHT RATE 500.00 TRACKING CR FILTER 2
INPUT 1057008 127
1057008 967.1 533.4 1559.0 964.1 547.3 1333.0
1057010 967.3 533.2 1558.0 964.4 547.6 1332.0
SFIX L 1057012
SFIX R 1057012
1057012 967.5 533.0 1557.0 964.5 548.1 1330.0
1057014 967.8 534.1 1556.0 964.5 548.4 1329.0
1057016 967.0 534.7 1556.0 964.5 549.0 1327.0
1057018 966.9 534.3 1557.0 964.1 549.9 1327.0
1057020 967.2 534.0 1557.0 964.3 550.0 1325.0
1057022 967.3 532.9 1556.0 964.3 549.7 1325.0
1057024 967.3 532.5 1553.0 964.3 549.9 1325.0
What should I change if I want to reconstruct the pupil?
Comments
Hi Weizhe,
If you look in the
get_data()
function, you'll see that it assumes the existence of several variables, one of them beingset_size
. However, that's specific to the data file from the tutorial! If you're working with a different data file, you'll have to adjust the analysis script accordingly.As a first step, I would remove the call to
keep_only()
, in which case the parser should no longer crash. And then you can inspect whether all your variables have been recognized correctly, which depends on whether your data file matches the (default) assumptions ofeyelinkparser
.Cheers!
Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi Sebastiaan,
Thank you for your advice. I'll Try it out tomorrow because it's midnight now at China. By the way, Could you please take opening a Gitter room into consideration, as it would be convenient for you to commuicate with other developers and researchers. @sebastiaan
Sincerely
Weizhe