

Say we wanted to know what point was associated with the value at Z? Then. Now we can look and see exactly what is happening.
#NUMPY GRADIENT UPDATE#
Update Let's take a look at the xy pairs. Here is a more obvious example using f(x,y) = sin(x). Since my data was generated from f(x,y) = sin(x+y) gy looks the same. Gx is a matrix that gives the change dz/dx at all points. You can see that plotting Z as a surface gives: You need to give gradient a matrix that describes your angular frequency values for your (x,y) points. This module seems to me more a toy than a tool, it has severe limitations imho. Even if i make my data as a grid that would have lots of zeroes outside of the polygon of my original data, that would add really high vectors to my gradient affecting (negatively) the precision of calculation. I've understood that adient works properly only on a square grid of values, not what i'm searchin for. I didn't build my data on a grid, i already have a grid and this is why kind examples given here in answers do not help me.Ī more fitting example should have a grid of points and values like the one i have: data=Īnother thing i can add is that my grid is not a square one but has the shape of a polygon being the brillouin zone of a 2d crystal. I give in input also steps for derivation for the 2 directions: stepx=abs(max(unique(data)-min(unique(data))/(len(unique(data))-1) Where x1,x2 are point coordinates on an uniform grid (my points on the brillouin zone) and x3 is the value of frequency for that point. What i mean is: I want to calculate gradient of an array of values: data=.] Otherwise i would like to know if there's any other python function i can use. I would like to know how adient works and if it's the right choice for my problem. I hope i've been sufficiently clear in my explanation. 2 3d vectors at first i thought that the sum of the two would give me the vector i were searchin for but the z component doesn't vanish. I need to calculate gradient and I did expect a 2d vector, being gradient definition df/dx*i+df/dy*j+df/dz*kĪnd my function only a function of x and y i did expect something like df/dx*i+df/dy*jīut i got 2 arrays with 3 colums each, i.e. I fed a 3 column array to it, the first 2 colums are x and y coords, the third column is the frequency of that point (x,y). I used gradient to try to calculate group velocity (group velocity of a wave packet is the derivative of frequencies respect to wavenumbers, not a group of velocities).

I would like to know how does adient work.
