@@ -156,8 +156,6 @@ def linescan(self, bias, current, p1, p2, npoints=50, z0=None):
156156 def pointcurrent (self , bias , x , y , z ):
157157 """Current for a single x, y, z position for a given bias."""
158158
159- self .read_ldos (bias )
160-
161159 nx = self .ldos .shape [0 ]
162160 ny = self .ldos .shape [1 ]
163161 nz = self .ldos .shape [2 ]
@@ -193,6 +191,7 @@ def sts(self, x, y, z, bias0, bias1, biasstep):
193191
194192 for b in np .arange (len (biases )):
195193 print (b , biases [b ])
194+ self .read_ldos (biases [b ])
196195 current [b ] = self .pointcurrent (biases [b ], x , y , z )
197196
198197 dIdV = np .gradient (current , biasstep )
@@ -209,14 +208,21 @@ def line_sts(self, bias0, bias1, biasstep, p1, p2, npoints=50):
209208 d = p2 - p1
210209 s = np .dot (d , d )** 0.5
211210 biases = np .arange (bias0 , bias1 + biasstep , biasstep )
211+ current = np .zeros ((npoints , len (biases )))
212212
213- dIdV = np .zeros ((npoints , len (biases )))
213+ for b in np .arange (len (biases )):
214+ print (b , biases [b ])
215+ self .read_ldos (biases [b ])
216+
217+ for i in range (npoints ):
218+ x , y , z = p1 + i * d / (npoints - 1 )
219+ current [i , b ] = self .pointcurrent (biases [b ], x , y , z )
214220
221+ dIdV = np .zeros ((npoints , len (biases )))
215222 for i in range (npoints ):
216- x , y , z = p1 + i * d / (npoints - 1 )
217- biases , current , dIdV [i , :] = self .sts (x , y , z , bias0 , bias1 , biasstep )
223+ dIdV [i , :] = np .gradient (current [i , :], biasstep )
218224
219- return biases , np .linspace (0 , s , npoints ), dIdV
225+ return biases , np .linspace (0 , s , npoints ), current , dIdV
220226
221227
222228 def find_current (self , ldos , z ):
0 commit comments