Source code :: main

[Return]
 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/usr/bin/python2
# -*- coding: utf-8 -*-

import matplotlib
matplotlib.rcParams['backend'] = 'Agg'
matplotlib.rc('font',  size='10')
matplotlib.rc('text', usetex=True)  # FIXME !! nicer but slower !!!

#import pygolem_lite


from numpy import *
#from pygolem_lite.config import *
from pygolem_lite.modules import *
#from matplotlib.pyplot import *
import time
from shutil import copy
import os, sys

from scipy.interpolate import interp1d


def getdata():
    for i in range(32):
	try:
	    tvec, data =  load_adv("PapouchSt_%02i" % i )
	    if 'tvec_0' in locals():
		data = interp1d(tvec, squeeze( data), copy=False,  bounds_error=False, fill_value=0)(tvec_0)   # interplate to the same time resolution !!! 
		data_0 = vstack([data_0.T, data]).T
	    else:
		data_0 = data
		tvec_0 = tvec
	except IOError:
	    pass
    if 'tvec_0' in locals():
	save_adv('Papouch_All', tvec_0, data_0)
    else:
	print "Missing data Papouch"

def graphs(file_type):

    name = "Papouch Stockel"
    # graph all
    
    channels = [ 'ch '+str(i) for i in range(1,13)]   # channels from 1 to 12 !!
    
     # integrated
    out = get_data('Papouch_All', channels, "",xlim=[0,40] ,integrated=True )
    multiplot(out, name + ' Integrated'  , 'graph_int', (6,len(out)*2), 100,  'vertical', file_type)
    os.system("convert -resize 150x120\!  graph_int.png icon.png")

    
    # graph all

    out = get_data('Papouch_All', channels , "",xlim=[0,40] ,integrated=False, reduction = False)
   
    multiplot(out, name  , 'graph', (6,len(out)*2), 100,  'vertical', file_type)
    os.system("convert -resize 150x120\!  graph.png icon.png")
    
    # icon
    #out = get_data('Papouch_All', "", "" , xlabel = "",integrated=False )
    #paralel_multiplot(out, "" , 'icon', (4,3), 40)


    
    
def main():
    if sys.argv[1] ==  "acquisition":
	getdata()
    if sys.argv[1] ==  "plots":
	graphs('png')
	#graphs('svg')
	saveconst('status', 0)



if __name__ == "__main__":
    main()
    

Navigation