fnin = os.path.abspath(sys.argv[1]) fnout = os.path.abspath(sys.argv[2]) # Determine parameters on new file based on path name l = float(re.findall('[\d\.]+(?=mm)' , fnout)[-1])*1e-3 n = float(re.findall('[\d\.]+(?=n)' , fnout)[-1])*1e10 eV = float(re.findall('[\d\.]+(?=eV)' , fnout)[-1]) eta = -float(re.findall('[\d\.]+(?=eta)', fnout)[-1]) print('l={}, n={}, eV={}, eta={}'.format(l, n, eV, eta)) electron = Species(n=n, eV=eV) debye = electron.debye OML = OML_current(Cylinder(r=1e-3, l=1), electron, eta=eta) df = mpl.DataFrame(fnin) Zn = df['Zn'].m f = df['f'].m Z = Zn*debye res = 0.1*debye Z_interp = np.linspace(0, l, int(np.ceil(l/res)+1)) Z_interp = np.array([a for a in Z_interp if a>min(Z) and a<l-min(Z)]) f_interp = np.interp(Z_interp, Z, f) g_interp = f_interp * f_interp[::-1] with open(fnout, 'w') as fout: fout.write("#:xaxis\tz\n") fout.write("#:name\tz\tzn\tZ\tZn\tOML\tI\tg\tf\n")
import metaplot as mpl import matplotlib.pyplot as plt from fitfuncs import * import scipy.integrate as integrate paramfile = np.load(sys.argv[1]) file = sys.argv[2] r, l, n, eV, eta = get_probe_params(file) elec = Species(n=n, eV=eV) I_OML = OML_current(Cylinder(r, 1), elec, eta=eta) debye = elec.debye l /= debye df = mpl.DataFrame(file) Zn = df['Zn'].m f = df['f'].m g = df['g'].m i = df['I'].m z = df['z'].m ls = paramfile['ls'] etas = paramfile['etas'] popts = paramfile['popts'] where_l = np.where(np.abs(np.array(ls) - l) < 1e-3)[0] where_eta = np.where(np.abs(np.array(etas) - eta) < 1e-3)[0] ind = [a for a in where_l if a in where_eta][0] popt = popts[ind] I_fit = I_OML * debye * (int_additive_model(l, l, *popt) -
#!/usr/bin/env python import sys import metaplot as mpl for f in sys.argv[1:]: df = mpl.DataFrame(f) dt = df['t'][1].m*1e12 print('{}: {} ps'.format(f, dt))
#!/usr/bin/env python # DEPRECATED # use normprof.py and constrprof.py instead import sys import metaplot as mpl import numpy as np # Read data df = mpl.DataFrame(sys.argv[1]) z = df['z'].to('m').m OML = df['OML'].to('A/m').m[0] g = df['g'].m # Shift z-axis to origin dz = z[1]-z[0] z -= z[0]-dz/2 half = int(len(z)/2) f = 0.5*(g[:half] + g[:half-1:-1]) z = z[:half] num = int(sys.argv[3]) z_new = z[:num] - num*1e-3/2 g_new = f[:num] * f[num-1::-1] with open(sys.argv[2], 'w') as file: file.write("#:xaxis\tz\n") file.write("#:name\tz\tOML\tI\tg\n") file.write("#:units\tm\tA/m\tA/m\tdimensionless\n")