Preproc: =============== Code for preprocessing neural data (reorganize data into the needed form) including parsing experimental files, trial sorting, and subsampling .. contents:: :local: Preprocessed data format ------------------------ Preprocessed BMI3D data takes the form of HDF files containing several datasets. Each dataset is labeled as either ``_data`` or ``_metadata`` depending on its source. Datasets with the ``data`` suffix typically contain numpy structured arrays while those denoted ``metadata`` contain simple data types. .. image:: _images/preproc_org.png On our lab server, preprocessed data is stored in ``/data/preprocessed/``. Use :func:`aopy.data.get_preprocessed_filename` to get the filename of any preprocessed file. Or use :func:`aopy.data.load_preproc_exp_data`, :func:`aopy.data.load_preproc_eye_data`, :func:`aopy.data.load_preproc_broadband_data`, :func:`aopy.data.load_preproc_lfp_data` to load the various preprocessed datasets directly. .. list-table:: :widths: 25 75 :header-rows: 1 * - Dataset - Contents * - ``exp_data`` - The experimental data. It contains all the information about timing, position, state, events, etc. * - ``exp_metadata`` - Metadata explaining the experimental data, e.g. information about the subject, date, and experimental parameters * - ``eye_data`` - The eye data, including position and a mask for the eyes being closed. * - ``eye_metadata`` - Metadata about the eye tracking, including labels for which channel corresponds to which eye, sampling rate, etc. * - ``mocap_data`` - Motion capture data * - ``mocap_metadata`` - Metadata explaining the motion capture data * - ``broadband_data`` - Unfiltered raw neural data * - ``lfp_data`` - Neural data that has been low-pass filtered at 500 Hz and downsampled to 1000 Hz * - ``spike_data`` - TBD Experimental data ----------------- **clock** [shape: (13132,), type: [('time', ' - see motive documentation Examples -------- To access the data you can do one of the following .. code-block:: python clock = aopy.data.load_hdf_data(result_dir, result_filename, 'clock', 'exp_data') or .. code-block:: python data = aopy.data.load_hdf_group(result_dir, result_filename, 'exp_data') clock = data['clock'] To access fields inside the individual structured arrays, .. code-block:: python timestamps = clock['timestamp'] first_timestamp = timestamps[0] Note that you can also access structured arrays by row first, then by column .. code-block:: python first_clock = clock[0] first_timestamp = first_clock['timestamp'] Or at the same time .. code-block:: python first_timestamp = clock['timestamp'][0] API --- Preproc wrappers ^^^^^^^^^^^^^^^^ These functions are also available directly from ``aopy.preproc`` .. automodule:: aopy.preproc.wrappers :members: Preproc base ^^^^^^^^^^^^ These functions are also available directly from ``aopy.preproc`` .. automodule:: aopy.preproc.base :members: Quality ^^^^^^^ .. automodule:: aopy.preproc.quality :members: BMI3D ^^^^^ .. automodule:: aopy.preproc.bmi3d :members: Oculomatic ^^^^^^^^^^ .. automodule:: aopy.preproc.oculomatic :members: Optitrack ^^^^^^^^^ .. automodule:: aopy.preproc.optitrack :members: Neuropixel ^^^^^^^^^^ .. automodule:: aopy.preproc.neuropixel :members: