pnpl.preprocessing.epochs_to_h5#
- pnpl.preprocessing.epochs_to_h5(epochs, output_path, dtype=<class 'numpy.float32'>, compression=None, compression_opts=4, picks='meg')[source]#
Convert MNE Epochs to H5 format.
Creates an H5 file with structure: - data: (trials, channels, time) - the picked channels (MEG by default) - labels: (trials,) - Event labels - times: (time,) - Time vector - channel_names: (channels,) - Channel names - channel_types: (channels,) - Channel types - sensor_xyz: (channels, 3) - Sensor positions
- Parameters:
epochs (mne.Epochs) – MNE Epochs object
output_path (str) – Output H5 file path
dtype (dtype) – Data type for storage (default: float32)
compression (str | None) – Compression algorithm (‘gzip’ or None)
compression_opts (int) – Compression level (1-9)
picks (str | Sequence[str]) – Channels to store: “meg” (default), “all”, or channel type(s) such as [“meg”, “eeg”] for simultaneous MEG+EEG
- Returns:
Path to created H5 file
- Return type:
str