Repository navigation
Fix wrong noise direction in grdsample wesn checking - #7469
Merged
Merged
Conversation
This relates to #7453 but does not fix it. When grdsample was changed by #7356 we got the sign of the error slop wrong for the x-direction. I have also broken some long lines into 2-lines so easier to do debug. With this fix the original problem fixed by #7356 is still fixed but now the grdcut command yields the correct sub-region. However, the spike in the corners are still there and are there for different reasons.
Contributor
Author
|
If you extend the west boundary to further west, e.g. -10:02, then the surface will show a visible “seam” along Lon = 10, and ending in the two spike lips. While I think this is BCs, we should also examine the BCR for outside corner cases as here |
Esteban82
approved these changes
May 21, 2023
Esteban82
left a comment
Member
There was a problem hiding this comment.
Blind approval. Let me know if I do you want to test it.
Contributor
Author
You could try to play with view points etc on something like this
which I think shows the seam + the lips |
Contributor
Author
|
But no merging yet. |
joa-quim
approved these changes
May 22, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This relates to #7453 but does not fix it. When grdsample was changed by #7356 we got the sign of the error slop (ince) wrong for the x-direction. I addition to fixing that, I have also broken some long lines into 2-lines so easier to do debug. With this fix the original problem fixed by #7356 is still fixed but now the grdcut command yields the correct sub-region. However, the spikes in the corners are still there and are there for different reasons, as discussed below. I recommend we approve and merge this PR though.
The commented out verbose statements in grdsample would print this before the April 7 "fix":
which is incorrect for the south limit in wesn_i (but fortuitously gives a better plot). They should be the same as wesn_o. After this PR we get the correct
I am pretty sure the spikes at the WS and NW corners have the same source. Remember, we are resampling the 15s grid (pixel) at the 3s grid (gridline). Here are items that conspire:
Here is a zoom in on the SW corner and where we wish to estimate 15s (red dots) from the blue dots.
Thus, the fix to this issue may be complicated, but perhaps something like this:
This obviously means a wholesale revision of the remote data set structures, how gmt_remote.c operators, etc. but probably the best solution. In fact, we should have been smart enough to think of this when the global tiling was first proposed and introduced.
Other solutions seems much messier, e.g., to somehow get the neighbouring tile data into the boundary pads, i.e., read in strips of the neighbor tiles and insert into pad. I would hate to be the coder for that.
FYI, if we just decide to cut out the 15s subset (the raw grid) and then use grdsample to sample it at the 3s nodes (i.e., no blending at all, just 15s resampled), you can still see the four corners having "lips":
So even without any grdblend calls happening you can see the 2-D BCR extrapolation at the corners lack real BC constraints. If we just plot the 15s as is: No lips:
So the spikes are all produced by teh BCR extrapolation into the voids.