Open a staged recording in an independent offline process#

Estimated reading time:11 minutes

Stage one real 5.6 MB BNCI2014-004 recording online, then copy and run the entire second code cell on the offline machine, including its imports. EEGDash must already be installed. Keep the signal and BIDS sidecars together under EEGDASH_CACHE_DIR. Running this whole script still requires a connection for stage 1; only stage 2 is the standalone offline recipe. Source: nm000135.

1. Run once on a network-enabled staging machine#

from eegdash import EEGDashDataset
from eegdash.paths import get_default_cache_dir

online = EEGDashDataset(
    cache_dir=get_default_cache_dir(),
    dataset="nm000135",
    subject="1",
    session="0train",
    run="0",
    task="imagery",
    n_jobs=1,
)
online.download_all(n_jobs=1)
online.description[["subject", "session", "run", "task"]]
subject session run task
0 1 0train 0 imagery


2. Standalone offline recipe: run this entire cell in a fresh process#

Set EEGDASH_CACHE_DIR to the staged root before starting Python. This cell has no in-memory dependency on stage 1 and no network fallback. If discovery or opening fails, repair the complete staged BIDS tree on a connected host; do not create stand-in files or switch downloads on inside the compute job.

from eegdash import EEGDashDataset
from eegdash.paths import get_default_cache_dir

cache_dir = get_default_cache_dir()
query = dict(dataset="nm000135", subject="1", session="0train", run="0", task="imagery")
offline = EEGDashDataset(cache_dir=cache_dir, **query, download=False, n_jobs=1)
raw = offline.datasets[0].raw
raw
General
Filename(s) sub-1_ses-0train_task-imagery_run-0_eeg.bdf
MNE object type RawBDF
Measurement date 2008-01-01 at 00:00:00 UTC
Participant sub-1
Experimenter mne_anonymize
Acquisition
Duration 00:40:20 (HH:MM:SS)
Sampling frequency 250.00 Hz
Time points 605,000
Channels
EEG
Head & sensor digitization 6 points
Filters
Highpass 0.00 Hz
Lowpass 125.00 Hz


Test network independence by disconnecting and running only stage 2. This demonstrates local loading, not offline installation or checkpoint acquisition: stage those dependencies separately. Cross-host checksums or a saved reference excerpt are optional transfer checks, not requirements for this independently runnable recipe.