#!/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 !!!
from numpy import *
from pygolem_lite.modules import *
import time
import os, sys
def prepare_data():
data = loadtxt('Nidatap.lvm')
tvec = arange(len(data)) * 5e-6 # 200kHz
save_adv('Nidatap', tvec, data)
print "prepared data"
def plot_data(file_type):
name = "NI Basic"
# graph all
out = get_data('Nidatap', 'ch', "" ,xlim=[0,40],integrated=False )
multiplot(out, name , 'graph1', (6,len(out)*2), 100, 'vertical', file_type)
os.system('convert -resize 150x120\! graph1.png icon.png')
## integrated
out = get_data('Nidatap', 'ch', "",xlim=[0,40] , integrated=True )
multiplot(out, name + ' Integrated' , 'graph2', (6,len(out)*2), 100, 'vertical', file_type)
def main():
if sys.argv[1] == "acquisition":
prepare_data()
if sys.argv[1] == "plots":
plot_data('png')
#plot_data('svg')
saveconst('status', 0)
if __name__ == "__main__":
main()