read_gazepoint#
- pypillometry.read_gazepoint(fname, keep_initial_label=False)[source]#
Read a recording of a GazePoint eye tracker (e.g., GP3).
The file is a table (tab- or comma-separated) with one row per sample and the columns of the GazePoint Open Gaze API, as written by programs that record the data stream of the eye tracker:
CNT,TIME(s),LPOGX, …,LPD,LPV,LEYEZ,LPUPILD,LPUPILV, …,USER.The column
USERholds the last label that the experiment sent to the eye tracker (e.g.,"TRIAL 3"). It is repeated on every sample until the next label; each change of the label is an event at that sample.The time of the samples is taken from the sample counter
CNTof the eye tracker:TIMEis the time at which the recording program received the sample, which jitters by several ms (and is rounded to steps of 7.8 ms on some computers), so that it looks as if samples were missing. The time is the straight line inCNTthat fitsTIMEbest; samples that are really missing are gaps inCNT. Files withoutCNT(or with repeated values of it) useTIME.- Parameters:
- Return type:
- Returns:
"samples":pandas.DataFramewithtime(ms) and the columns of the file under their original names, sorted byCNT(or by time; then samples with the time of an earlier sample are dropped)"events": DataFrame withtime(ms) andlabel"info": dict with"format","source","time_base"("CNT"or"TIME"),"sampling_rate"(Hz, from the time of the samples),"lost_samples"(gaps inCNT) and"duplicate_times"(number of dropped samples)
See also
pypillometry.EyeData.from_gazepointcreate an eyedata object from the file