Storing all events species: any
Maintainer Michael Davison Current version 0.1
Original Author Michael Davison Date last modified unknown
License BSD MED-PC version any
For many years now we regularly (and now always) store the times of every event in sessions for later detailed analysis. We have evolved the following procedure.
(no references)
How to use this code Download the code Download an example macro Download the profile

First, I shall assume that sessions are no more than 9999 s long (ours are usually 60 mins about, so the maximum is 3600 s). What we do is to form a single datum from the code of the event (e.g., left-key response) and the time in s of that event from the start of the session. Here are some fragments: \Inputs ^Lkey=1 ^CKey=2 ^RKey=3 \data collection \List x is the detailed data array dim x=5000 \and y is the counter for this array \codes (all stored codes are time in s + code \code for session start = 0 ^PeckLeft=10000 ^PeckRight=20000 ^RftLeft=30000 ^RftRight=40000 ^BlackoutStart=50000 ^Sessend=60000 ^Mag=70000 ^COLR=80000 ^CORL=90000 ^LeftKeyGreen = 110000 ^RightKeyGreen = 120000 \component number codes are component number (1-7) * 100000, which is why no code 10000 is defined above. (notice all codes are followed by at least 4 zeros) DiskVars=c,q,x (we conventionally use the q array to set all of the parameters of the experiment, at least ones that we might want to vary; we use the c array to provide whole-session counts of events [pecks, reinforcers] for quick checking of the data by operators). s.s.1, s3,\ Main routine LEFT #R^Lkey:Add c(p*4+0); add y;set x(y)=^PeckLeft+Btime/1";set b=1;On ^CKRed; if (s.s.2=3)[@Event,@no] @event:off ^LKYel,^RKYEL,^CKRed; if f=1[@Real,@NotReal] @REAL:on ^rft; add c(p*4+2);add y;set x(y)=^RftLeft+Btime/1";add n;--->s8 @NotReal: if f=2[@Mag,@KeyLight] @MAG:ON ^MagLite; add y; set x(y)=^Mag+Btime/1";add n;--->s9 @KeyLight:ON ^LKGreen;Add y;set x(y)=^LeftKeyGreen+Btime/1";add n;--->s6 @no:--->sx Thus, a large enough array (X = 5000) is defined, and Y is the subscript for this array. For every event to be coded and timed, we increase the subscript by 1, and add the code of the event (e.g., ^PeckLeft) to the Btime (in ticks) of the event divided by 1" (which is the number of ticks in 1 s on the system). For us, with a resolution set at 0.01 s, this provides a composite code+time number stored in array X of the form: aabbbb.bbb where aa is the code and bbbb.bbb is the time of the event in seconds (with 2 decimal places being significant). Our analysis programs decompose this composite number into a code and a time. This procedure saves storage space (and this is significant for us) and ensures that events are properly coded (it might be possible, had we used separate arrays for codes and times, for out storage or analysis to get out of synchrony. The output looks like: File: C:\birds\data\BIRD91.0 Start Date: 01/23/05 End Date: 01/23/05 Subject: 1 Experiment: 9 Group: 0 Box: 2 Start Time: 1:00:02 End Time: 1:55:07 MSN: Expt9 C: 0: 315.000 25.000 13.000 0.000 51.000 5: 12.000 3.000 0.000 157.000 44.000 10: 7.000 2.000 172.000 99.000 6.000 15: 5.000 59.000 122.000 1.000 9.000 20: 124.000 157.000 2.000 5.000 68.000 25: 116.000 2.000 6.000 Q: 0: 666.667 250.000 6000.000 18.000 200.000 5: 112.000 X: 0: 0.000 400060.000 10064.540 10064.830 10064.930 5: 10067.010 10069.390 10070.090 10071.240 10071.600 10: 10073.430 10073.540 80074.260 80074.580 20076.610 etc X1, for example, is a code of 40 (not shown above) at 60 s after the start of the session. X2 is a code of 1 (left key peck) at 64.54 s after the start of the session.

Related programs Other versions
No training programs submitted/required

No older versions available
No experimental versions available