Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/stm/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
start_points = [0, 0, 8]
end_points = [2, 0, 8]
distance = np.linalg.norm(np.array(end_points) - np.array(start_points))
biases, points, dIdV_map = stm.line_sts(biasstart, biasend, biasstep, start_points, end_points, 50)
biases, points, current, dIdV_map = stm.line_sts(biasstart, biasend, biasstep, start_points, end_points, 50)

plt.figure(figsize=(10, 6), dpi=150)

Expand Down
18 changes: 12 additions & 6 deletions tools/stm/stm.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,6 @@ def linescan(self, bias, current, p1, p2, npoints=50, z0=None):
def pointcurrent(self, bias, x, y, z):
"""Current for a single x, y, z position for a given bias."""

self.read_ldos(bias)

nx = self.ldos.shape[0]
ny = self.ldos.shape[1]
nz = self.ldos.shape[2]
Expand Down Expand Up @@ -193,6 +191,7 @@ def sts(self, x, y, z, bias0, bias1, biasstep):

for b in np.arange(len(biases)):
print(b, biases[b])
self.read_ldos(biases[b])
current[b] = self.pointcurrent(biases[b], x, y, z)

dIdV = np.gradient(current, biasstep)
Expand All @@ -209,14 +208,21 @@ def line_sts(self, bias0, bias1, biasstep, p1, p2, npoints=50):
d = p2 - p1
s = np.dot(d, d)**0.5
biases = np.arange(bias0, bias1 + biasstep, biasstep)
current = np.zeros((npoints, len(biases)))

dIdV = np.zeros((npoints, len(biases)))
for b in np.arange(len(biases)):
print(b, biases[b])
self.read_ldos(biases[b])

for i in range(npoints):
x, y, z = p1 + i * d / (npoints - 1)
current[i, b] = self.pointcurrent(biases[b], x, y, z)

dIdV = np.zeros((npoints, len(biases)))
for i in range(npoints):
x, y, z = p1 + i * d / (npoints - 1)
biases, current, dIdV[i, :] = self.sts(x, y, z, bias0, bias1, biasstep)
dIdV[i, :] = np.gradient(current[i, :], biasstep)

return biases, np.linspace(0, s, npoints), dIdV
return biases, np.linspace(0, s, npoints), current, dIdV


def find_current(self, ldos, z):
Expand Down
Loading