Skip to content
Read MedPC data into python and matlab
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ExampleFile1
ExampleFile2
LICENSE
MedPC Template
MedParse Example.ipynb
README.md
med_to_tec.m
med_to_tec.py
mpc_to_tec.m

README.md

MedParse

Functions to read MedPC data into python and matlab
Files:
mpc_to_tec.m -> MATLAB Original file provided by Russell Church and Paulo Guilhardi, May 2000
med_to_tec.m -> MATLAB Updated version by Marcelo Cetano, April 2010
med_to_tec.py -> PYTHON Translated to python by Kyra Swanson, January 2015
2015-09-25_ML03 -> Example MedPC data file containing raw time-event codes
MEDPC Template -> Standard MedPC event codes and saving conventions used in our lab

Requirements for MedPC file

Set a timing variable (eg U) to the internal time to set a baseline and set another as an index placeholder (eg Y). A separate index holder is needed for each data array

#Start: Set U = BTIME, Y = 0, K = 0;

Set variables to arrays to hold times:

DIM A=9999, B=3, L=9999

Save variables as they occur into the arrays:

This example saves lick times into array L

s.s.X,
s1,
#Start: ---> s2 \this prevents licks from being recorded before initialization of the session
s2,
#R^LICK: Set L(K) = BTIME-U; Add K; ---> SX

This example saves event times and the code corresponding to the event. The element is saved as TIME.EVENTCODE. For example, OnPumpA = 11 and if OnPumpA occurs at exactly 536 seconds from start will be recorded as 268000.011

s.s.X,
s1,
#Z^OnPumpA: Set A(Y) = BTIME-U + (^OnPumpA)/1000; Add Y; --->sx
#Z^OffPumpA: Set A(Y) = BTIME-U + (^OffPumpA)/1000; Add Y; --->sx

Example File (2015-09-25_ML03)

The following codes correspond to the following events in this example:

Lick = 1 (.001)

PumpA
ON = 11 (.011)
OFF = 21 (.021)

PumpB
ON = 12 (.012)
OFF = 22 (.022)

Low concentration = 50 (0.050)
High concentration = 51 (0.051)

Shift = 52 (0.052)

You can’t perform that action at this time.