def get_shot_report(*argv): ##################################################################### ## IMPORTAN FLAGS ## ##################################################################### iplasma_ok=0 dens_ok=0 marte_ok=0 ##################################################################### ## VARIABLES ## ##################################################################### waited_time = 0 fluffytron={0: "|", 1: "/", 2: "-", 3: "\\"} client = StartSdas() if len(argv) < 1 : shotnr = client.searchMaxEventNumber('0x0000') else : shotnr = int(argv[-1]) plasma_curr_channelID='POST.PROCESSED.IPLASMA'; # Unique Identifier for plasma current plasma_dens_channelID='POST.PROCESSED.DENSITY'; # Unique Identifier for plasma density marte_power_channelID='MARTE_NODE_IVO3.DataCollection.Channel_105'; #Marte channel for the power supply print '\nSHOT #'+str(shotnr)+'\n' print '\nLoading data, CTRL-C to interrupt' while(True): if iplasma_ok==0: try: [iplasma,iplasma_times] = LoadSdasData(client, plasma_curr_channelID, shotnr); iplasma_ok=numpy.all(numpy.isfinite(iplasma)) except xmlrpclib.Fault: iplasma_ok=0 if dens_ok ==0: try: [dens,dens_times] = LoadSdasData(client, plasma_dens_channelID, shotnr); dens_ok=numpy.all(numpy.isfinite(dens)) # check if all finite except xmlrpclib.Fault: dens_ok=0 if marte_ok==0: try: [marte,marte_times] = LoadSdasData(client, marte_power_channelID, shotnr); marte_ok=numpy.all(numpy.isfinite(marte)) # check if all finite except xmlrpclib.Fault: marte_ok=0 if dens_ok and iplasma_ok and marte_ok : print '\nData loaded\n' break try: print fluffytron[waited_time % 4]+' '+'{0:02d}'.format(waited_time)+'s', print ' PLASMA CURRENT DATA:', if iplasma_ok : print 'READY', else : print 'NOT READY', print ' DENSITY DATA:', if dens_ok : print 'READY', else : print 'NOT READY', print ' MARTE CONTROL:', if marte_ok : print 'READY', else : print 'NOT READY', print ' \r', sys.stdout.flush() time.sleep(1) waited_time += 1
from pyISTTOK.exposure_time import exposure_time from pyISTTOK.period_counter import period_counter import xmlrpclib ##################################################################### ## GLOBAL VARIABLES ## ##################################################################### iplasma_threshold=0.7e3 dens_threshold=1.e18 marte_threshold=10 iplasma_ok=1 dens_ok=1 marte_ok=1 ##################################################################### client = StartSdas() if len(sys.argv) < 2 : shotnr = client.searchMaxEventNumber('0x0000') else : shotnr = int(sys.argv[-1]) plasma_curr_channelID='POST.PROCESSED.IPLASMA'; # Unique Identifier for plasma current plasma_dens_channelID='POST.PROCESSED.DENSITY'; # Unique Identifier for plasma density marte_power_channelID='MARTE_NODE_IVO3.DataCollection.Channel_105'; #Marte channel for the power supply print '\nSHOT #'+str(shotnr)+'\n' print 'Loading data' try: [iplasma,iplasma_times] = LoadSdasData(client, plasma_curr_channelID, shotnr);
timeout=0 s="" fluffytron = { 0: "|", 1: "/", 2: "-", 3: "\\", } ##################################################################### ##################################################################### ## SDAS ACCESS ## ##################################################################### client = StartSdas() if len(sys.argv) < 2 : shotnr = client.searchMaxEventNumber('0x0000') else : shotnr = int(sys.argv[-1]) plasma_curr_channelID='POST.PROCESSED.IPLASMA'; # Unique Identifier for plasma current plasma_dens_channelID='POST.PROCESSED.DENSITY'; # Unique Identifier for plasma density marte_power_channelID='MARTE_NODE_IVO3.DataCollection.Channel_105'; #Marte channel for the power supply print '\nLoading data, CTRL-C to interrupt' print 'I_thr ',iplasma_threshold,' n_thr ', dens_threshold print '\nSHOT #'+str(shotnr)+'\n' while (True): if iplasma_ok==0: