-
Notifications
You must be signed in to change notification settings - Fork 1
/
load_vdaq_conds.py
28 lines (23 loc) · 930 Bytes
/
load_vdaq_conds.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
__author__ = 'Horea Christian'
import numpy
from pyutils.exceptions import InputError
from get_data import unpack_block_file
def vdaq_conds(data_name):
_, nframesperstim, _, _, nstimuli, nvideoframesperdataframe, filesubtype, datatype = unpack_block_file(data_name)
nframes = numpy.array(nframesperstim) * numpy.array(nstimuli)
r = numpy.arange(1, nframes+1)
r1 = range(1, 10)
time_bin = 1000 / numpy.array(nvideoframesperdataframe)
tim = numpy.arange(1, numpy.array(nframesperstim)+1) * numpy.array(time_bin)
sumframes = False
if numpy.array(filesubtype) != 11:
raise InputError('not a VDAQ file')
if numpy.array(datatype) == 13:
data_type = '<u4'
bytes_per_pixel = 4
elif numpy.array(datatype) == 14:
data_type = 2
bytes_per_pixel = 4
else:
raise InputError('Check the data type')
return data_type, bytes_per_pixel