afam

Package to support the analyisation of SR Research .asc-files

Submodules

Package Contents

Classes

ASC_BUTTON

A dataclass used to store the data from a "BUTTON" line.

ASC_SBLINK

A dataclass used to store the data from a "SBLINK" line.

ASC_SSACC

A dataclass used to store the data from a "SSACC" line.

ASC_SFIX

A dataclass used to store the data from a "SFIX" line.

ASC_EBLINK

A dataclass used to store the data from a "EBLINK" line.

ASC_ESACC

A dataclass used to store the data from a "ESACC" line.

ASC_EFIX

A dataclass used to store the data from a "EFIX" line.

ASC_MSG

A dataclass used to store the data from a "MSG" line.

ASC_SAMPLE

A dataclass representing the basic framework of every ASCII sample.

ASC_MONO

TODO:

ASC_BINO

TODO:

ASC_Dataset

TODO:

class afam.ASC_BUTTON[source]

Bases: ASC_EVENT

A dataclass used to store the data from a “BUTTON” line. This line contains a button press or release event.

`t`

time of button press

Type

int

`b`

button number (1-8)

Type

int

`s`

button change (1=pressed, 0=released)

Type

int

t :int
b :int
s :int

Bases: ASC_EVENT

A dataclass used to store the data from a “SBLINK” line. This line contains the start of a blink event.

`eye`

eye (L-R)

Type

str

`st`

start time

Type

int

eye :str
st :int
class afam.ASC_SSACC[source]

Bases: ASC_EVENT

A dataclass used to store the data from a “SSACC” line. This line contains the start of a saccade event.

`eye`

eye (L-R)

Type

str

`st`

start time

Type

int

eye :str
st :int
class afam.ASC_SFIX[source]

Bases: ASC_EVENT

A dataclass used to store the data from a “SFIX” line. This line contains the start of a fixation event.

`eye`

eye (L-R)

Type

str

`st`

start time

Type

int

eye :str
st :int

Bases: ASC_EVENT

A dataclass used to store the data from a “EBLINK” line. This line contains start and end time (actually the time of the last sample fully within the blink), plus summary data of a blink event.

`eye`

eye (L-R)

Type

str

`st`

start time

Type

int

`et`

end time

Type

int

`d`

duration

Type

int

eye :str
st :int
et :int
d :int
class afam.ASC_ESACC[source]

Bases: ASC_EVENT

A dataclass used to store the data from a “ESACC” line. This line contains start and end time (actually the time of the last sample fully within the saccade), plus summary data of a saccade event.

`eye`

eye (L-R)

Type

str

`st`

start time

Type

int

`et`

end time

Type

int

`d`

duration

Type

int

`sx`

start X position

Type

float

`sy`

start Y position

Type

float

`ex`

end X position

Type

float

`ey`

end Y position

Type

float

`ampl`

amplitude in degrees

Type

float

`pvel`

peak velocity, degr/sec

Type

float

`resx`

resolution (if events_have_resolution==1)

Type

float

`resy`

resolution (if events_have_resolution==1)

Type

float

eye :str
st :int
et :int
d :int
sx :float
sy :float
ex :float
ey :float
ampl :float
pvel :float
resx :float
resy :float
class afam.ASC_EFIX[source]

Bases: ASC_EVENT

A dataclass used to store the data from a “EFIX” line. This line contains start and end time (actually the time of the last sample fully within the fixation), plus summary data of a fixation event.

`eye`

eye (L-R)

Type

str

`st`

start time

Type

int

`et`

end time

Type

int

`d`

duration

Type

int

`x`

X position

Type

float

`y`

Y position

Type

float

`resx`

resolution (if events_have_resolution==1)

Type

float

`resy`

resolution (if events_have_resolution==1)

Type

float

eye :str
st :int
et :int
d :int
x :float
y :float
resx :float
resy :float
class afam.ASC_MSG[source]

Bases: ASC_EVENT

A dataclass used to store the data from a “MSG” line. This line contains token and start time, plus some summary data.

`t`

token (TRIALID, SYNCTIME, TRIAL_RESULT, INFO, etc.)

Type

str

`st`

start time

Type

int

`data`

information

Type

str

t :str
st :int
data :str
class afam.ASC_SAMPLE[source]

A dataclass representing the basic framework of every ASCII sample.

`t`

timestamp in milliseconds

Type

int

t :int
to_dict()[source]

Convert the ASC_SAMPLE class to a dictionary.

Returns

`self.__dict__` – Dictionary representing all attributes of the ASCII sample

Return type

dict

Example

>>> event = ASC_SAMPLE(t=123456)
>>> event.to_dict()
{t:123456}
class afam.ASC_MONO[source]

Bases: ASC_SAMPLE

TODO:

`t`

time of button press

Type

int

`xp`

monocular X position data

Type

float

`yp`

monocular Y position data

Type

float

`ps`

monocular pupil size (area or diameter)

Type

float

t :int
xp :float
yp :float
ps :float
class afam.ASC_BINO[source]

Bases: ASC_SAMPLE

TODO:

`t`

time of button press

Type

int

`xpl`

left-eye X position data

Type

float

`ypl`

left-eye Y position data

Type

float

`psl`

left pupil size (area or diameter)

Type

float

`xpr`

right-eye X position data

Type

float

`ypr`

right-eye Y position data

Type

float

`psr`

right pupil size (area or diameter)

Type

float

t :int
xpl :float
ypl :float
psl :float
xpr :float
ypr :float
psr :float
class afam.ASC_Dataset[source]

TODO:

`event`

`msg`

`sample`

to_mat(file_name)[source]

Save a ASC_Dataset into a MATLAB-style .mat file.

Parameters

file_name (str) – name of the .mat file

to_ascDS(folder_name)[source]

Save a ASC_Dataset into the folder structure ascDS

Parameters

folder_name (str) – name of the folder