Discharge/DischargeDatabase/Examples/22813/includes/DAS/0513NIturbo_RT.ON/plots.py

#!/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 pygolem_lite import Shot

#from matplotlib.pyplot import *
import time
from shutil import copy, move
import os, sys


def graphs(file_type):


    try:
      name = "NI Turbo RT"
      # graph all
      load_adv('Nidata')
      out = get_data('Nidata', 'ch', "" ,xlim=[0,40],  integrated=False, reduction=False ) #  ylim=[None, 11],   
      paralel_multiplot(out, name  , 'graph', (6,len(out)*2),  100,  'vertical', file_type, wait=True)
      paralel_multiplot([out[5],out[15]], 'Currents', 'graph2', (6, 8), 100, 'vertical', file_type, wait=True)
      # time.sleep(5)  #wait to finish plotting
      os.system('convert -resize 150x120\! graph2.png icon.png')
    except:
      print "NIturbo_RT failed"
      #raise
  
    print "done"

     
      
if __name__ == "__main__":
    graphs('png')