Hello,
It appears saddle_strength() does not properly compute the 0 extent. Specifically, saddle.py defines saddle_strength() and in lines 786 and 787:
ratios = np.zeros(n)
for k in range(1, n):
Meaning that the 0 extent is initialized as 0, and then never re-calculated in the subsequent loop (which starts at 1).
The following comment from the documentation suggests what the 0 value should be: # at extent=0, this reduces to ((S/C)[0,0] + (S/C)[-1,-1]) / (2*(S/C)[-1,0])
The way the loop is written, you probably just need to manually compute the value for 0 before entering into it, e.g. after setting ratios = np.zeros(n), but before the loop, insert:
true extent-0 value
intra0_sum = S[0, 0] + S[-1, -1]
intra0_count = C[0, 0] + C[-1, -1]
intra0 = intra0_sum / intra0_count
inter0_sum = S[0, -1] + S[-1, 0]
inter0_count = C[0, -1] + C[-1, 0]
inter0 = inter0_sum / inter0_count
ratios[0] = intra0 / inter0
Thanks,
Ittai
Hello,
It appears saddle_strength() does not properly compute the 0 extent. Specifically, saddle.py defines saddle_strength() and in lines 786 and 787:
Meaning that the 0 extent is initialized as 0, and then never re-calculated in the subsequent loop (which starts at 1).
The following comment from the documentation suggests what the 0 value should be: # at extent=0, this reduces to ((S/C)[0,0] + (S/C)[-1,-1]) / (2*(S/C)[-1,0])
The way the loop is written, you probably just need to manually compute the value for 0 before entering into it, e.g. after setting ratios = np.zeros(n), but before the loop, insert:
true extent-0 value
Thanks,
Ittai