Closed Yefee closed 5 years ago
I think you should consider applying spectral truncation before computing the divergence, the gradients are small compared to the fields and the result is a noisy divergence field (i.e. use the truncation=
keyword argument when calling divergence
).
I would not expect the gradient operators to reproduce the result of divergence
, and even in your first example they do not match very well away from the equator. A truncated input to divergence will do a better job.
I also noticed the units of your field are unusual, values are of the order 1e11. This should not actually cause a problem though.
Thanks, @ajdawson !
After applying a truncation to the calculation, the divergence field becomes much better.
But I have a further question, different truncation returns different results. Then what is the optimal truncation I can use?
I don't think there is an optimal truncation as such. Truncation is just filtering out smaller scale variations in the original field (smoothing them) before computing divergence. Choice of truncation depends somewhat on what scale features you are interested in.
Thanks! I now feel more confident to use the truncation.
Close the issue.
Dear all,
I found the divergence calculation has some weird behaviors. Here I use the example data to calculate the divergence in two ways. They are largely equal except over high latitudes.
However, for my test data, it obviously fails.
Check my test data here. test3.nc.zip
Any thoughts?
Best