Would you like to know how the divergence calculation is done in Metpy? We know that in Grads the calculation of divergence is performed by the finite difference method as follows:
pi = 3,14159265359
dtr = pi / 180
a = 6,371e6
dx = a * cos (dtr * lat) * dtr * cdiff (lon, x)
dy = a * dtr * cdiff (lat, y)
div = cdiff (u, x) / dx + cdiff (v, y) / dy-v * tan (dtr * lat) / a
However, in Metpy I didn't find anything detailed (as it is in the Grads) of how this calculation of divergence is performed.