I am giving a talk at the SIO SWOT seminar in less than two weeks about Pangeo and the AdAC model data effort. So I am trying to come up with a cool example.
I put together this notebook - https://nbviewer.jupyter.org/gist/rabernat/2f9ca9a0a54840fa1c2b96068574c7c5 - where I am trying to reproduce @dhruvbalwada's vorticity strain histogram analysis (see also ocean-transport/coiled_collaboration#5).
I am getting some weird results and would like some help from @roxyboy or @lesommer debugging. I figure we will need these sorts of demos for this project anyway, so hopefully this is time well spent. The notebook is 💯 runnable on https://us-central1-b.gcp.pangeo.io/, so please feel free to run it and reproduce / fix.
This is what my histogram looks like:

Obviously very different from Dhruv's result in the channel model:

My vorticity just doesn't look very vorticity-like 😱

I worry I am calculating it wrong:
def nemo_vort(u, v, e1f, e2f, e2v, e1u):
return (
np.roll(v * e2v, 1, axis=-1)
- np.roll(u * e1u, 1, axis=-2)
) / (e1f * e2f)
Note that I am not using xgcm, for the reason described in pangeo-forge/staged-recipes#24 (comment) and also because this "kernel function" + apply_ufunc approach scales much better. But I did base my code off of @raphaeldussin's xgcm example at https://xgcm.readthedocs.io/en/stable/example_nemo_idealized.html.
I would very much appreciate if someone could have a look and help me find out what's going wrong.
I look forward to collaborating this way and building up more and more complex examples of multi-model analysis.
I am giving a talk at the SIO SWOT seminar in less than two weeks about Pangeo and the AdAC model data effort. So I am trying to come up with a cool example.
I put together this notebook - https://nbviewer.jupyter.org/gist/rabernat/2f9ca9a0a54840fa1c2b96068574c7c5 - where I am trying to reproduce @dhruvbalwada's vorticity strain histogram analysis (see also ocean-transport/coiled_collaboration#5).
I am getting some weird results and would like some help from @roxyboy or @lesommer debugging. I figure we will need these sorts of demos for this project anyway, so hopefully this is time well spent. The notebook is 💯 runnable on https://us-central1-b.gcp.pangeo.io/, so please feel free to run it and reproduce / fix.
This is what my histogram looks like:
Obviously very different from Dhruv's result in the channel model:
My vorticity just doesn't look very vorticity-like 😱
I worry I am calculating it wrong:
Note that I am not using xgcm, for the reason described in pangeo-forge/staged-recipes#24 (comment) and also because this "kernel function" + apply_ufunc approach scales much better. But I did base my code off of @raphaeldussin's xgcm example at https://xgcm.readthedocs.io/en/stable/example_nemo_idealized.html.
I would very much appreciate if someone could have a look and help me find out what's going wrong.
I look forward to collaborating this way and building up more and more complex examples of multi-model analysis.