Project

General

Profile

Data format » History » Version 1

Anonymous, 03/05/2020 03:22 PM

1 1 Anonymous
h1. Data format
2
3
<pre><code class="python">
4
def readFileADLINKCh0( filename, samplesPerFile, timeSerie_A ):
5
    fd = open(filename,'rb')
6
    
7
    dum = np.fromfile(fd, dtype = np.uint16)
8
9
    timeSerie_A[:] = dum[:]
10
    
11
    fd.close()
12
</code></pre>
13
14
<pre><code class="python">
15
lastBuffer = (nbFiles-1) * buffersPerFile + firstBuffer
16
for k in range( nbFiles ):
17
    
18
    # read the data
19
    nb = str( int( k * buffersPerFile + firstBuffer) )
20
    filename = data_dir + "/record" + nb + ".bin"
21
    readFileADLINKCh0( filename, samplesPerFile, timeSerie_A )
22
    
23
    print("k = {}, block = {} / {}".format(k, nb, lastBuffer))
24
    
25
    adc_A[ k, : ] = (timeSerie_A + offset) * scalingFactor
26
</code></pre>