#!/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, move
import os, sys
def plot_data(file_type):
try:
name = "NI Turbo 6251"
# graph all
out = get_data('Nidatap_6251', 'ch', "" ,xlim=[0,40], ylim=[None, 11], integrated=False, reduction=False )
multiplot(out, name , 'graph0', (9,2), 100, 'vertical', file_type)
os.system('convert -resize 150x120\! graph0.png icon.png')
except:
print "Nidatap_6251 failed"
try:
name = "NI Turbo 6358"
## integrated
out = get_data('Nidatap_6358', 'ch', "", xlim=[0,40], integrated=True , reduction=True)
paralel_multiplot(out, name + ' Integrated' , 'graph2', (6,len(out)*2), 100, 'vertical', file_type)
# graph all
out = get_data('Nidatap_6358', 'ch', "" , xlim=[0,40],integrated=False, reduction=False )
multiplot(out, name , 'graph1', (6,len(out)*2), 100, 'vertical', file_type)
# icona
#out = get_data('Nidatap', "", "" , xlabel = "",integrated=False, reduction=True )
#paralel_multiplot(out, "" , 'icon', (4,3), 40)
os.system('convert -resize 150x120\! graph1.png icon.png')
except:
print "Nidatap_6358 failed"
print "done"
def main():
if sys.argv[1] == "plots":
plot_data('png')
#plot_data('svg')
saveconst('status', 0)
if __name__ == "__main__":
main()