I have a (960,960) array an I am trying to find the critical points so I can find the local extrema.
I have tried using the np.diff and np.gradient, but I have run into some trouble and I am not sure which function to use.
np.diff offers the option of calculating the second order diff, but the gradient doesn't.
How should I go about getting the critical points?
I've tried
diff = np.diff(storm, n=2)
dxx = diff[0]
dyy = diff[1]
derivative = dyy/dxx
I run into problems here because some of the values along the dxx are equal to zero.
Then there's the option of
gradient = np.gradient(storm)
g2 = np.gradient(gradient)
but will this give me what I'm looking for?