-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calculating shear and stretch deform using windspharm #110
Comments
Why not use the gradient method to compute this, this is pretty much exactly what the NCL code does? vw = VectorWind(u, v, ...)
# standard interface:
dudx, dudy = vw.gradient(u)
dvdx, dvdy = vw.gradient(v)
# metadata interfaces
dudx, dudy = vw.gradient(vw.u())
dvdx, dvdy = vw.gradient(vw.v())
# Compute stretch and shear
shear = dvdx + dudy
stretch = dudx - dvdy |
@ajdawson Looks great. Very easy and very clear. What is the difference between the first set of gradients and the metadata ones ? |
Nothing except their input arguments. I just realised there was a typo too, I have corrected it. |
Sorry to reopen this nearly 18 months later and I actually never tried this till now and I get this exception - `def main():
and I am getting this exception `raceback (most recent call last): During handling of the above exception, another exception occurred: Traceback (most recent call last): |
NCL has this functionality - https://www.ncl.ucar.edu/Document/Functions/Contributed/shear_stretch_deform.shtml. Is it possible to calculate shear and stretch deform using windspharm ?
All we need is the vector gradient of the wind and then we can add and subtract the components to get the respective quantities. Is this doable ?
The text was updated successfully, but these errors were encountered: