EGI PyNetStation
egi-pynetstation sends event markers from Python to EGI Net Station / Amp
Server Pro through the Experimental Control Interface (ECI).
Install
pip install egi-pynetstation
For a development checkout:
git clone https://github.com/nimh-sfim/egi-pynetstation.git
cd egi-pynetstation
pip install -e .
The five commands
from egi_pynetstation import NetStation
ns = NetStation('10.10.10.42', 55513)
ns.connect(ntp_ip='10.10.10.51')
ns.begin_rec()
ns.send_event(event_type='stim')
ns.end_rec()
ns.disconnect()
That is the complete lifecycle for most experiments:
connect()opens ECI and starts background clock sampling.begin_rec()starts a recording and synchronizes its timestamp epoch.send_event()timestamps and queues an event marker.end_rec()flushes queued events and stops the recording.disconnect()closes ECI and its background workers.
Timing validation
Run a photocell timing test once for every experiment and physical setup:
python example5_psychopy_photocell_drift.py amp --fullscreen \
--log timing.csv --error-log timing_errors.jsonl \
--frame-interval-log timing_frames.csv
Also verify local clock precision:
python -m egi_pynetstation.check_clocks
The ordinary drift model uses at least 13 samples spanning 180 seconds. If
the photocell test shows meaningful startup drift, either connect earlier so
the model can collect evidence before begin_rec(), or enable the optional
provisional model:
ns.connect(ntp_ip='10.10.10.51', drift_warmup=True)
The provisional model can engage after five samples spanning 20 seconds and permanently hands off to the ordinary model when it is ready. Validate the choice on the actual stimulus computer, display, network, and amplifier used for the experiment.
See the Timing Test and Advanced guide for the full procedure.
PsychoPy
Mark the flip that presents a stimulus:
stim.draw()
win.callOnFlip(ns.send_event, event_type='stim')
win.flip()
send_event() captures the time immediately and performs network I/O on a
worker thread, so it is safe to use in a flip callback.
Documentation
Run the timing test once for every experiment and physical setup before
collecting data. At the end of a validation or production run, inspect
ns.session_summary().
License
This software is a United States Government Work. See LICENSE.
Metadata
Release files for egi_pynetstation 2.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| egi_pynetstation-2.1.0.tar.gz | 96.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| egi_pynetstation-2.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 204.2 kB
Release files / egi_pynetstation-2.1.0.tar.gz
| Download URL | egi_pynetstation-2.1.0.tar.gz |
|---|---|
| Size | 96.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3d62b45bdf69033f19058cd6a2c10f8bda1a8b57b329e20400837a35d74c407a
|
|
BLAKE2b-256 checksum How to use checksums |
3e63a0178e68c498433129c0488b97f0731230dd9373f0f0fcfdddf0b5920777
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.2 CPython/3.13.7 Darwin/25.6.0
|
Release files / egi_pynetstation-2.1.0-py3-none-any.whl
| Download URL | egi_pynetstation-2.1.0-py3-none-any.whl |
|---|---|
| Size | 107.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
354a852fe528151453d1273c09bf1357a46269e8d4f369d9f09f8dd48075dae4
|
|
BLAKE2b-256 checksum How to use checksums |
52d8d7de64dd9236577382bf60244d9ebfef55cd48ac2693f6258d6a3ac84f6a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.2 CPython/3.13.7 Darwin/25.6.0
|