def getDATA_hspike(folderName): print "********* Loading hspike data from '" + folderName + "' ***********" inputfile = InputFile(folderName + "/input.txt") inputfile.calcBasicParams() convFactor1 = inputfile.N_sp / inputfile.dT #superpartices/timestep -> particles/sec convFactor2 = 1.60217657e-19 * inputfile.N_sp / inputfile.dT # superparticles/timestep -> Amps convFactor3 = (inputfile.dz / inputfile.Omega_pe )**2 * inputfile.T_ref #dimless potential -> Volts (ts, emit, sigma, incident) = np.loadtxt(folderName + "/arcbounds_original.dat", usecols=(0, 10, 11, 12), unpack=True) useIdxs = np.arange(0, len(ts), 5) ts = ts[useIdxs] emit = emit[useIdxs] sigma = sigma[useIdxs] incident = incident[useIdxs] t = ts * inputfile.dT * 1e9 #ns emit *= convFactor1 / 5.0 #particles/sec sigma *= inputfile.dZ #cm incident *= convFactor1 / 5.0 #particles/sec return (t, emit, sigma, incident)
def getData_IV(folderName): print "********* Loading IV data from '" + folderName + "' ***********" inputfile = InputFile(folderName + "/input.txt") inputfile.calcBasicParams() convFactor1 = inputfile.N_sp/inputfile.dT #superpartices/timestep -> particles/sec convFactor2 = 1.60217657e-19*inputfile.N_sp/inputfile.dT # superparticles/timestep -> Amps convFactor3 = (inputfile.dz/inputfile.Omega_pe)**2*inputfile.T_ref #dimless potential -> Volts #Load circuit data if inputfile.CircuitName == "FixedVoltage_resistorCapacitor": (circ_ts, circ_deltaQ, circ_U, circuitCurrent) = \ np.loadtxt(folderName + "/circuit.dat", usecols=(0,1,2,3), unpack=True) t = circ_ts*inputfile.dT*1e9 #ns I = circ_deltaQ*convFactor2 #Amps U = circ_U*convFactor3 #Volts I_circ = circuitCurrent*convFactor2 #Amps print "done." return (t,I,U,I_circ) else: (circ_ts, circ_deltaQ, circ_U) = np.loadtxt(folderName + "/circuit.dat", usecols=(0,1,2), unpack=True) circuitCurrent=np.zeros_like(circ_ts) t = circ_ts*inputfile.dT*1e9 #ns I = circ_deltaQ*convFactor2 #Amps U = circ_U*convFactor3 #Volts print "done." return (t,I,U)
def getDATA_nParticles(folderName): print "********* Loading nParticles data from '" + folderName + "' ***********" inputfile = InputFile(folderName + "/input.txt") inputfile.calcBasicParams() (t, e,i,n) = np.loadtxt(folderName + "/mainStats.dat", usecols=(1,3,4,5), unpack=True) e*=inputfile.N_sp i*=inputfile.N_sp n*=inputfile.N_sp return (t,e,i,n)
def getDATA_nParticles(folderName): print "********* Loading nParticles data from '" + folderName + "' ***********" inputfile = InputFile(folderName + "/input.txt") inputfile.calcBasicParams() (t, e, i, n) = np.loadtxt(folderName + "/mainStats.dat", usecols=(1, 3, 4, 5), unpack=True) e *= inputfile.N_sp i *= inputfile.N_sp n *= inputfile.N_sp return (t, e, i, n)
def getDATA_hspike(folderName): print "********* Loading hspike data from '" + folderName + "' ***********" inputfile = InputFile(folderName + "/input.txt") inputfile.calcBasicParams() convFactor1 = inputfile.N_sp/inputfile.dT #superpartices/timestep -> particles/sec convFactor2 = 1.60217657e-19*inputfile.N_sp/inputfile.dT # superparticles/timestep -> Amps convFactor3 = (inputfile.dz/inputfile.Omega_pe)**2*inputfile.T_ref #dimless potential -> Volts (ts, emit, sigma, incident) = np.loadtxt(folderName + "/arcbounds_original.dat", usecols=(0,10,11,12), unpack=True) useIdxs = np.arange(0,len(ts),5) ts = ts[useIdxs] emit = emit[useIdxs] sigma = sigma[useIdxs] incident = incident[useIdxs] t = ts*inputfile.dT*1e9 #ns emit *= convFactor1/5.0 #particles/sec sigma *= inputfile.dZ #cm incident *= convFactor1/5.0 #particles/sec return (t,emit,sigma,incident)
def getData_IV(folderName): print "********* Loading IV data from '" + folderName + "' ***********" inputfile = InputFile(folderName + "/input.txt") inputfile.calcBasicParams() convFactor1 = inputfile.N_sp / inputfile.dT #superpartices/timestep -> particles/sec convFactor2 = 1.60217657e-19 * inputfile.N_sp / inputfile.dT # superparticles/timestep -> Amps convFactor3 = (inputfile.dz / inputfile.Omega_pe )**2 * inputfile.T_ref #dimless potential -> Volts #Load circuit data if inputfile.CircuitName == "FixedVoltage_resistorCapacitor": (circ_ts, circ_deltaQ, circ_U, circuitCurrent) = \ np.loadtxt(folderName + "/circuit.dat", usecols=(0,1,2,3), unpack=True) t = circ_ts * inputfile.dT * 1e9 #ns I = circ_deltaQ * convFactor2 #Amps U = circ_U * convFactor3 #Volts I_circ = circuitCurrent * convFactor2 #Amps print "done." return (t, I, U, I_circ) else: (circ_ts, circ_deltaQ, circ_U) = np.loadtxt(folderName + "/circuit.dat", usecols=(0, 1, 2), unpack=True) circuitCurrent = np.zeros_like(circ_ts) t = circ_ts * inputfile.dT * 1e9 #ns I = circ_deltaQ * convFactor2 #Amps U = circ_U * convFactor3 #Volts print "done." return (t, I, U)
if not (species == "e" or species == "Cu" or species == "Cup"): print "species must be one of 'e', 'Cu', 'Cup'" exit(1) speed = float(sys.argv[9]) tempunit = sys.argv[10] if not (tempunit == "K" or tempunit == "eV"): print "tempunit must be one of 'K' or 'eV'" exit(1) #Get the scaling setup MODLOAD_parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0,MODLOAD_parentdir) from calcScaling import InputFile inputfile = InputFile("../input.txt") inputfile.calcBasicParams() nr = inputfile.nr #system size [grids] nz = inputfile.nz #system size [grids] N_sp = inputfile.N_sp #Particle/superparticle ratio dZ = inputfile.dZ #um/grid dz = inputfile.dz #Ldb/grid (typically 0.5) Ldb = inputfile.Ldb #Debye length [cm] O_pe = inputfile.O_pe #Plasma angular frequency [s^-1] if max_r > inputfile.R*1e4: print print "************************************************************************************************"
print "Got options:" print " - mintime = ", mintime print " - maxtime = ", maxtime print print " - species = ", species print " - edge = ", edg print print " - nbinsX = ", nbinsX print " - nbinsY = ", nbinsY print #Get the scaling setup MODLOAD_parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, MODLOAD_parentdir) from calcScaling import InputFile inputfile = InputFile("../input.txt") inputfile.calcBasicParams() print print "Time window =", mintime * inputfile.dT * 1e9, "--", maxtime * inputfile.dT * 1e9, "ns" print # if minR == maxR and minR == None: # minR = 0.0 # maxR = inputfile.nr step = [] z = [] r = [] vz = [] vr = [] vt = []