Source code :: main
[Return]
[Download]#!/usr/bin/python2
# -*- coding: utf-8 -*-
import matplotlib #on JET must be used Qt4Agg backend
matplotlib.rcParams['backend'] = 'Agg'
matplotlib.rc('font', family='arial', size='10')
matplotlib.rc('text', usetex=True)
import sys
sys.path.append('/home/michal/Desktop/Prace/Golem/web_framework')
import pygolem
from numpy import *
from pygolem.config import *
from pygolem.modules import *
from matplotlib.pyplot import *
import time
from shutil import copy
import os
def setup():
print \
"""DIAGN Papouch setup
"""
def arming():
os.system('eecho -e -n $$"\x2A\x61\x00\x05\xfe\x02\x78\xf7\x0d"|socat -u - $(ADDRESS_socat);sleep 1; socat -T 0.5 -u $(ADDRESS_socat) /dev/null')
def acquisition():
pass
#rm -f PapouchSt*
#for i in $(DAS); do rm -f pool; echo DAS Papouch $$i;for j in `seq 1 10`; do make getdata IP=220 ADDRESS="$${i}_$${j}" CHAN=$$i ;done; awk '{print NR-1"E-6\t" $$1}' pool > PapouchSt_$$i;sleep 1s;done
#make graphs
#make html
#paste `for i in $(DAS); do echo PapouchSt_$$i; done` > matrice
def getdata():
pass
#socat -u commstrings/getdata$(ADDRESS) $(ADDRESS_socat); socat -u $(ADDRESS_socat),readbytes=8199 STDOUT | od -j 7 -v -A n -s -w2 |LC_ALL=C awk '{print $$1 / 32768 *10}' >> pool;
def graphs(file_type):
name = "Papouch"
# graph all
out = get_data('matrice', 'ch', "", xlim = [0,25],integrated=False )
paralel_multiplot(out, name , 'graph', (6,20), 100, 'vertical', file_type)
# integrated
out = get_data('matrice', 'ch', "", xlim = [0,25],integrated=True )
paralel_multiplot(out, name + ' Integrated' , 'graph_int', (6,20), 100, 'vertical', file_type)
# icon
out = get_data('matrice', "", "" , xlim = [0,25], xlabel = "",integrated=False )
paralel_multiplot(out, "" , 'icon', (4,3), 40)
def main():
setup()
graphs('png')
graphs('svg')
if __name__ == "__main__":
main()[Return]