Skip to content

neon_recording

Modules:

  • calib

    Camera calibration utils

  • neon_recording

    Neon Recording

  • timeseries

Classes:

Functions:

  • open

    Load a NeonRecording from a path

AudioTimeseries

AudioTimeseries(recording: NeonRecording, data: ArrayType | None = None)

Bases: BaseAVTimeseries

Audio frames

Attributes:

  • data

    Data as a numpy array

  • pd

    Data as a pandas DataFrame

  • time

    The moment these data were recorded

Source code in src/pupil_labs/neon_recording/timeseries/timeseries.py
50
51
52
53
54
def __init__(self, recording: "NeonRecording", data: ArrayType | None = None):
    self.recording = recording
    if data is None:
        data = self._load_data_from_recording(recording)
    self._data = data

data property

data

Data as a numpy array

pd property

pd

Data as a pandas DataFrame

time class-attribute instance-attribute

time = fields[int64](TIMESTAMP_FIELD_NAME)

The moment these data were recorded

BlinkTimeseries

BlinkTimeseries(recording: NeonRecording, data: ArrayType | None = None)

Bases: Timeseries[BlinkArray, BlinkRecord], BlinkProps

Blink event data.

Attributes:

  • data

    Data as a numpy array

  • pd

    Data as a pandas DataFrame

  • start_time

    Start timestamp of the blink.

  • stop_time

    Stop timestamp of the blink.

  • time

    The moment these data were recorded

Source code in src/pupil_labs/neon_recording/timeseries/timeseries.py
50
51
52
53
54
def __init__(self, recording: "NeonRecording", data: ArrayType | None = None):
    self.recording = recording
    if data is None:
        data = self._load_data_from_recording(recording)
    self._data = data

data property

data

Data as a numpy array

pd property

pd

Data as a pandas DataFrame

start_time class-attribute instance-attribute

start_time = fields[int64]('start_time')

Start timestamp of the blink.

stop_time class-attribute instance-attribute

stop_time = fields[int64]('stop_time')

Stop timestamp of the blink.

time class-attribute instance-attribute

time = fields[int64](TIMESTAMP_FIELD_NAME)

The moment these data were recorded

EventTimeseries

EventTimeseries(recording: NeonRecording, data: ArrayType | None = None)

Bases: Timeseries[EventArray, EventRecord], EventProps

Event annotations

Attributes:

  • by_name

    Return a dict of event_name => all ts

  • data

    Data as a numpy array

  • event (NDArray[str_]) –

    Event name

  • pd

    Data as a pandas DataFrame

  • time

    The moment these data were recorded

Source code in src/pupil_labs/neon_recording/timeseries/timeseries.py
50
51
52
53
54
def __init__(self, recording: "NeonRecording", data: ArrayType | None = None):
    self.recording = recording
    if data is None:
        data = self._load_data_from_recording(recording)
    self._data = data

by_name cached property

by_name

Return a dict of event_name => all ts

data property

data

Data as a numpy array

event class-attribute instance-attribute

event: NDArray[str_] = fields[str_]('event')

Event name

pd property

pd

Data as a pandas DataFrame

time class-attribute instance-attribute

time = fields[int64](TIMESTAMP_FIELD_NAME)

The moment these data were recorded

FixationTimeseries

FixationTimeseries(recording: NeonRecording, data: ArrayType | None = None)

Bases: Timeseries[FixationArray, FixationRecord], FixationProps

Fixation event data.

Attributes:

  • data

    Data as a numpy array

  • mean_gaze_point

    Mean gaze position in pixels. Note that this value may be a poor representation

  • pd

    Data as a pandas DataFrame

  • start_gaze_point

    Start gaze position in pixels.

  • start_time

    Start timestamp of fixation.

  • stop_gaze_point

    Stop gaze position in pixels.

  • stop_time

    Stop timestamp of fixation.

  • time

    The moment these data were recorded

Source code in src/pupil_labs/neon_recording/timeseries/timeseries.py
50
51
52
53
54
def __init__(self, recording: "NeonRecording", data: ArrayType | None = None):
    self.recording = recording
    if data is None:
        data = self._load_data_from_recording(recording)
    self._data = data

data property

data

Data as a numpy array

mean_gaze_point class-attribute instance-attribute

mean_gaze_point = fields[float32](['mean_gaze_x', 'mean_gaze_y'])

Mean gaze position in pixels. Note that this value may be a poor representation of the fixation in the presence of VOR movements.

pd property

pd

Data as a pandas DataFrame

start_gaze_point class-attribute instance-attribute

start_gaze_point = fields[float32](['start_gaze_x', 'start_gaze_y'])

Start gaze position in pixels.

start_time class-attribute instance-attribute

start_time = fields[int64]('start_time')

Start timestamp of fixation.

stop_gaze_point class-attribute instance-attribute

stop_gaze_point = fields[float32](['stop_gaze_x', 'stop_gaze_y'])

Stop gaze position in pixels.

stop_time class-attribute instance-attribute

stop_time = fields[int64]('stop_time')

Stop timestamp of fixation.

time class-attribute instance-attribute

time = fields[int64](TIMESTAMP_FIELD_NAME)

The moment these data were recorded

IMUTimeseries

IMUTimeseries(recording: NeonRecording, data: ArrayType | None = None)

Bases: Timeseries[ImuArray, ImuRecord], ImuProps

Motion and orientation data

Attributes:

  • acceleration

    Translational acceleration data.

  • angular_velocity

    Angular velocity data.

  • data

    Data as a numpy array

  • pd

    Data as a pandas DataFrame

  • rotation

    Rotation as a quaternion given as xyzw.

  • time

    The moment these data were recorded

Source code in src/pupil_labs/neon_recording/timeseries/timeseries.py
50
51
52
53
54
def __init__(self, recording: "NeonRecording", data: ArrayType | None = None):
    self.recording = recording
    if data is None:
        data = self._load_data_from_recording(recording)
    self._data = data

acceleration class-attribute instance-attribute

acceleration = fields[float64](['acceleration_x', 'acceleration_y', 'acceleration_z'])

Translational acceleration data.

angular_velocity class-attribute instance-attribute

angular_velocity = fields[float64](['angular_velocity_x', 'angular_velocity_y', 'angular_velocity_z'])

Angular velocity data.

data property

data

Data as a numpy array

pd property

pd

Data as a pandas DataFrame

rotation class-attribute instance-attribute

rotation = fields[float64](['quaternion_x', 'quaternion_y', 'quaternion_z', 'quaternion_w'])

Rotation as a quaternion given as xyzw.

time class-attribute instance-attribute

time = fields[int64](TIMESTAMP_FIELD_NAME)

The moment these data were recorded

NeonRecording

NeonRecording(rec_dir_in: Path | str)

Class to handle the Neon Recording data

Parameters:

  • rec_dir_in (Path | str) –

    Path to the recording directory.

Raises:

Attributes:

Source code in src/pupil_labs/neon_recording/neon_recording.py
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
def __init__(self, rec_dir_in: pathlib.Path | str):
    """Initialize the NeonRecording object

    Args:
        rec_dir_in: Path to the recording directory.

    Raises:
        FileNotFoundError: If the directory does not exist or is not valid.

    """
    self._rec_dir = UPath(rec_dir_in).resolve()
    if not self._rec_dir.exists() or not self._rec_dir.is_dir():
        raise FileNotFoundError(
            f"Directory not found or not valid: {self._rec_dir}"
        )

audio cached property

Audio from the scene video

Blink data

calibration cached property

calibration: Calibration | None

Device camera calibration data

device_serial property

device_serial: str | None

Device serial number

duration property

duration: int

Recording Duration (nanoseconds)

events cached property

Event annotations

eye cached property

eye: EyeVideoTimeseries

Frames of video from the eye cameras

eyeball cached property

eyeball: EyeballTimeseries

Eye state data

eyelid cached property

eyelid: EyelidTimeseries

Eyelid data

fixations cached property

fixations: FixationTimeseries

Fixations data

gaze cached property

gaze: GazeTimeseries

2D gaze data in scene-camera space

id property

id: str | None

UUID of the recording

imu cached property

Motion and orientation data

info cached property

info: dict

Information loaded from info.json

pupil cached property

pupil: PupilTimeseries

Pupil diameter data

saccades cached property

saccades: SaccadeTimeseries

Saccades data

scene cached property

scene: SceneVideoTimeseries

Frames of video from the scene camera

start_time property

start_time: int

Start timestamp (nanoseconds since 1970-01-01)

stop_time property

stop_time: int

Stop timestamp (nanoseconds since 1970-01-01)

wearer cached property

wearer: dict

Wearer information containing uuid and name

worn cached property

worn: WornTimeseries

Worn (headset on/off) data

Timeseries

Timeseries(recording: NeonRecording, data: ArrayType | None = None)

Bases: TimeseriesProps, Generic[ArrayType, RecordType]

Base class for all Neon timeseries data.

Attributes:

  • data

    Data as a numpy array

  • pd

    Data as a pandas DataFrame

  • time

    The moment these data were recorded

Source code in src/pupil_labs/neon_recording/timeseries/timeseries.py
50
51
52
53
54
def __init__(self, recording: "NeonRecording", data: ArrayType | None = None):
    self.recording = recording
    if data is None:
        data = self._load_data_from_recording(recording)
    self._data = data

data property

data

Data as a numpy array

pd property

pd

Data as a pandas DataFrame

time class-attribute instance-attribute

time = fields[int64](TIMESTAMP_FIELD_NAME)

The moment these data were recorded

VideoTimeseries

VideoTimeseries(recording: NeonRecording, data: ArrayType | None = None)

Bases: BaseAVTimeseries

Video frames from a camera

Attributes:

  • data

    Data as a numpy array

  • height (int | None) –

    Height of the video

  • pd

    Data as a pandas DataFrame

  • time

    The moment these data were recorded

  • width (int | None) –

    Width of the video

Source code in src/pupil_labs/neon_recording/timeseries/timeseries.py
50
51
52
53
54
def __init__(self, recording: "NeonRecording", data: ArrayType | None = None):
    self.recording = recording
    if data is None:
        data = self._load_data_from_recording(recording)
    self._data = data

data property

data

Data as a numpy array

height cached property

height: int | None

Height of the video

pd property

pd

Data as a pandas DataFrame

time class-attribute instance-attribute

time = fields[int64](TIMESTAMP_FIELD_NAME)

The moment these data were recorded

width cached property

width: int | None

Width of the video

open

open(rec_dir_in: Path | str) -> NeonRecording

Load a NeonRecording from a path

Source code in src/pupil_labs/neon_recording/neon_recording.py
173
174
175
def open(rec_dir_in: pathlib.Path | str) -> NeonRecording:  # noqa: A001
    """Load a NeonRecording from a path"""
    return NeonRecording(rec_dir_in)