#This script reads in a shot list and processes the cross coherence spectrogram between the given nodes and the antenna current signal. #Ted Golfinopoulos, 16 Aug 2012 from MDSplus import * import sys #For getting command line arguments import numpy import myTools_no_sql as myTools from scipy.fftpack import hilbert from scipy.interpolate import interp1d import re #from calcTransFun import * #This isn't being used, it seems #Parse shot information, contained in first command-line argument sList = myTools.parseList(sys.argv[1]) #List of nodes in remaining command line arguments stringArgs = sys.argv[2:] #Loop through shots in list for s in sList: print("Shot {0:d}".format(s)) #Open magnetics tree to get Shoelace antenna signal. magTree = Tree('magnetics', s, 'edit') if (s < 1110000000 and s != -1): antNode = magTree.getNode( 'active_mhd.signals:i_gh_upper_z' ) #Old current node for Active MHD antenna - for comparison with Jason Sears' work. else:
#Ted Golfinopoulos, 26 August 2015. import sys from MDSplus import * from calibrateBoxV import calibrateFourierDomain import myTools_no_sql as myTools from myTools_no_sql import getYX #import numpy import time import re from scipy.signal import freqs from math import pi from myRfft import * from numpy import fft sList = myTools.parseList( sys.argv[1]) #Get shot from command line, first argument #sList=[1150826028] #This shot had a disruption - use for testing. #sList=[1150820004] #This shot had a fizzle - use for testing elimTags = ['OLD', '_K$', 'ASP'] def getDigiNum(sigNode): #Parse digitizer number from expression in node. try: #First, check if node has a subnode called raw: digiNum = re.findall( 'acq_216_(\d)', str(sigNode.getNode('raw').getData().decompile()).lower()) except: #Otherwise, try to parse digitizer number from signal
from MDSplus import * import sys import myTools_no_sql as myTools sList = myTools.parseList( sys.argv[1] ) #0th argument is script name; first argument is shot number. Parse integer. #sList=[int(sys.argv[1])] for s in sList: #These two nodes had pointers to non-existent digitizers. Fix reference to correct digitizer inputs. #Need to do this for all of campaign up to and including 1160520 myTree = Tree('magnetics', s) myTree.getNode('\MAGNETICS::TOP.ACTIVE_MHD.SIGNALS:BP17_ABK:RAW').putData( Data.compile( 'GETNCI( \MAGNETICS::TOP.ACTIVE_MHD.SIGNALS:BP17_ABK, "ON") ? Build_Signal(Build_With_Units( \MAGNETICS::TOP.ACTIVE_MHD.DATA_ACQ.CPCI:ACQ_216_3:INPUT_10 * 1 / (\MAG_RF_COILS:CALIB[16] * 1), "Tesla/s"), *, \MAGNETICS::TOP.ACTIVE_MHD.SIGNALS:TIMEBASE3 ) : ABORT()' )) myTree.getNode('\MAGNETICS::TOP.ACTIVE_MHD.SIGNALS:BP20_GHK:RAW').putData( Data.compile( 'GETNCI( \MAGNETICS::TOP.ACTIVE_MHD.SIGNALS:BP20_GHK, "ON") ? Build_Signal(Build_With_Units( \MAGNETICS::TOP.ACTIVE_MHD.DATA_ACQ.CPCI:ACQ_216_3:INPUT_14 * 1 / (\MAG_RF_COILS:CALIB[49] * 1), "Tesla/s"), *, \MAGNETICS::TOP.ACTIVE_MHD.SIGNALS:TIMEBASE3 ) : ABORT()' )) print("Fixed BP17_ABK:RAW and BP20_GHK:RAW for " + str(s))