data = {"voltage":[0]*len(size),"current":[0]*len(size),"resistance":[0]*len(size),"sheet":[0]*len(size),"size":[0]*len(size)} ilow, ihigh, istep, compliance = -0.005,0.005,5e-4,7 ## Get the current and measure the voltage current = pa.sourceSelect(ilow,ihigh,istep,compliance) ## Start the actual measurement i = 0 raw_input("Start Measurement: Probe Structure (enter)") while i < len(squares): voltage = pa.measureData() ## Calculate the derivitive with ndfit resistance = ndfit.derivative(voltage,current) ## set the results into the dict. Using SET rather than append ## avoids complications with the redo loop data["voltage"][i]=voltage data["current"][i]=current data["resistance"][i]=sum(resistance)/len(resistance) data["sheet"][i]=(sum(resistance)/len(resistance)/squares[i]) data["size"][i]=("%sum x %sum"%(str(size[i]),str(width[i]))) c = raw_input("Probe Strucute. Press (r) for redo (enter) to continue:") if (c == 'r'): i-=1 i+=1 ## Print the sheet resistance
import ndfit import numpy as np import matplotlib.pyplot as plt # NDFIT has support for basic math on lists built in x = list(np.linspace(-10,10,101)) y = [i*i*i for i in x] z = ndfit.derivative(y,x) print z plt.plot(x,z) plt.plot(x,y) plt.show()
"size": [0] * len(size) } ilow, ihigh, istep, compliance = -0.005, 0.005, 5e-4, 7 ## Get the current and measure the voltage current = pa.sourceSelect(ilow, ihigh, istep, compliance) ## Start the actual measurement i = 0 raw_input("Start Measurement: Probe Structure (enter)") while i < len(squares): voltage = pa.measureData() ## Calculate the derivitive with ndfit resistance = ndfit.derivative(voltage, current) ## set the results into the dict. Using SET rather than append ## avoids complications with the redo loop data["voltage"][i] = voltage data["current"][i] = current data["resistance"][i] = sum(resistance) / len(resistance) data["sheet"][i] = (sum(resistance) / len(resistance) / squares[i]) data["size"][i] = ("%sum x %sum" % (str(size[i]), str(width[i]))) c = raw_input("Probe Strucute. Press (r) for redo (enter) to continue:") if (c == 'r'): i -= 1 i += 1 ## Print the sheet resistance
pa = hp_4145B(GPIB) pa.channelDefinition() ## Sweep Vd from 0V to 1.1V Vd = pa.sweepVoltage(0.0, 1.0, 0.05, "40E-3") fig = plt.figure(figsize=(10, 8)) ax1 = fig.add_axes([0.1, 0.1, 0.70, 0.8]) ax2 = ax1.twinx() for n, vg in enumerate(vgx): # time.sleep(1) pa.stepVoltage(vg, 0.0, 1, "30E-3") pa.setOutput() pa.measureData() Id = pa.getDataIdVd() g0 = [xx / w for xx in list(ndfit.derivative(Id, Vd))] print "%s %f" % ("Vg =", vg) c = cm.cool(float(n) / len(vgx), 1) ax1.plot(Vd, Id, color=c) ax2.plot(Vd, g0, color=c, linestyle='--') ax1.set_ylim(0.0, max(Id) + 0.001) ax2.set_ylim(0.0, max(g0) + 100) ax1.set_xlabel(r"Drain Voltage $(V_d)$") ax1.set_ylabel(r"Drain Current $(I_d)$") ax2.set_ylabel(r"Output Conductance $(g_0)$") ## Fancy Colorbar cmap = mpl.cm.cool
pa = hp_4145B(GPIB) pa.channelDefinition() ## Sweep Vd from 0V to 1.1V Vd = pa.sweepVoltage(0.0,1.0,0.05,"40E-3") fig = plt.figure(figsize=(10,8)) ax1 = fig.add_axes([0.1, 0.1, 0.70, 0.8]) ax2 = ax1.twinx() for n,vg in enumerate(vgx): # time.sleep(1) pa.stepVoltage(vg,0.0,1,"30E-3") pa.setOutput() pa.measureData() Id = pa.getDataIdVd() g0 = [xx/w for xx in list(ndfit.derivative(Id,Vd))] print "%s %f"%("Vg =", vg) c = cm.cool(float(n)/len(vgx),1) ax1.plot(Vd, Id,color=c) ax2.plot(Vd, g0,color=c,linestyle='--') ax1.set_ylim(0.0, max(Id)+0.001) ax2.set_ylim(0.0, max(g0)+100) ax1.set_xlabel(r"Drain Voltage $(V_d)$") ax1.set_ylabel(r"Drain Current $(I_d)$") ax2.set_ylabel(r"Output Conductance $(g_0)$") ## Fancy Colorbar cmap = mpl.cm.cool
def _partialy(Z, Y): return np.array([ ndfit.derivative(list(Z[:, i]), list(Y[:, i])) for i in range(len(Z)) ]).T
def _partialx(Z, X): return np.array([ ndfit.derivative(list(Z[i, :]), list(X[i, :])) for i in range(len(Z)) ])