syncopy.load_tdt(data_path, start_code=None, end_code=None, subtract_median=False)[source]#

Imports TDT time series data and meta-information into a single AnalogData object.

An ad-hoc trialdefinition will be attached if both start_code and end_code are given. Otherwise a single all-to-all trialdefinition is used. Custom trialdefinitions can be done afterwards with definetrial().

All meta-information is stored within the .info dict of the AnalogData object.

PDio related keys:

(“PDio_onset”, “PDio_offset”, “PDio_data”)

Trigger related keys:

(“Trigger_code”, “Trigger_timestamp”, “Trigger_sample”)

  • data_path (str) – Path to the directory containing the .sev files

  • start_code (int or None, optional) – Trigger code defining the beginning of a trial

  • end_code (int or None, optional) – Trigger code defining the end of a trial

  • subtract_median (bool) – Set to True to subtract the median from all individual time series


adata – The tdt data in syncopy format

Return type:



Load all channels from a source directory /data/session3/:

>>> adata = load_tdt('/data/session3')

Access the trigger codes and samples:

>>> trg_code = adata.info['Trigger_code']
>>> trg_sample = adata.info['Trigger_sample']

Load the same data and construct a trialdefinition on the fly:

>>> adata = load_tdt('/data/session3', start_code=23000, end_code=30020)

Access the 3rd trial:

>>> trl_dat = adata.trials[2]