Skip to content

Commit

Permalink
ReachTargetVoltage: Fix initial response check
Browse files Browse the repository at this point in the history
We want to only act specially on the very first sweep. But as we reset the
index, we will land in this branch on every sweep if the resistance is too
small.

Let's prefer comparing to the number of acquired sweeps instead.
  • Loading branch information
t-b committed Nov 19, 2024
1 parent 9150a0b commit dbc993d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Packages/MIES/MIES_AnalysisFunctions.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -1143,8 +1143,10 @@ Function ReachTargetVoltage(string device, STRUCT AnalysisFunction_V3 &s)
continue
endif

WAVE sweeps = AFH_GetSweepsFromSameSCI(numericalValues, s.sweepNo, i)

// check initial response
if(index == 0 && resistanceFitted[i] <= 20e6)
if(DimSize(sweeps, ROWS) == 1 && resistanceFitted[i] <= 20e6)
amps = -100e-12
targetVoltagesIndex[i] = -1
else
Expand Down

0 comments on commit dbc993d

Please sign in to comment.