Skip to content
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

DIVAnd_residualobs returns residuals different from the "real" ones? #53

Closed
JianghuiDu opened this issue Dec 4, 2019 · 8 comments
Closed

Comments

@JianghuiDu
Copy link

JianghuiDu commented Dec 4, 2019

I have a gridded data product. I did DIVAndrun on this data using the same grid as in the original product. However, when I compare the residuals returned by DIVAnd_residualobs and the residuals calculated by differencing the analysis and the original gridded data, I find they are not the same (see the plot. They should be anti-correlated because the signs are opposite. You do see that trend but also a cloud of data, noise?, appears around 0). The residuals are small but clearly not due to rounding errors etc.. In the docs it is said the residuals are calculated by linearly interpolating the gridded analysis to the locations of observations. But since in my case the "data" and "analysis" are at exactly the same locations, I don't see why should these two methods give different results...

Untitled

@jmbeckers
Copy link
Member

I tried with a 2D example. I suspect the reason for the difference is the default parameter alphabc which tries to reject the last grid points of the grid to "infinity" without actually moving the data points and you see a difference there. If you use alphabc=0 the results should be close to rounding errors.

@JianghuiDu
Copy link
Author

The difference becomes bigger as epsilon2 becomes smaller.
Untitled

@jmbeckers
Copy link
Member

With alphabc=0 ?

@JianghuiDu
Copy link
Author

JianghuiDu commented Dec 4, 2019

It does remove the difference! But how does it affect the analysis?
Untitled

When you say "last grid point" do you mean the points in all dimensions on the boundaries? What about cyclic dimensions?

@jmbeckers
Copy link
Member

With your gridding of a gridded field it only modifies the analysis on the last and first grid point in each direction for small values of epsilon. These are the differences you see; the interior points should have the same residuals and analysis

@jmbeckers
Copy link
Member

"about cyclic dimensions" Normally that direction should not be affected but to be sure for your other problem I asked you to check anyway.

@JianghuiDu
Copy link
Author

For my other problem it doesn't work. Those observations between 358 and 2 are still masked out.

@jmbeckers
Copy link
Member

Yes, that it was I expected (normally alphabc does not act in the periodic direction). So for the other problem we will need to have a closer look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants