You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
grdimage does not plot subsets of data correctly on a global map #5180
I just ran the code in #5180 (comment) on GMT master (commit 81da2a2) and it's giving me this image:
Is this correct? To be honest, I'm not familiar with the Mollweide projection so not sure what the expected output should be, but the gray parts doesn't seem ok. Using -JW180/8i also gives some gray output that wasn't there before in GMT 6.1.1.
Well, the projected grid has to be a rectangle, so that is what it looks like. We can discuss if in these situations we should automatically set up a clip path before laying down the rectangle, but that has never been done. it has always been like this.
PostScript image is a rectangle, so any grdimage that is plotted in PostScript is projected and yields a rectangle. What is not within the original lon/lat boundingbox is set to NaN. Usually using -Q is really all you need.
Diference is the default CPT. For remote grids we use the default CPT listed in the server table. For t.grd we get turbo I think.
If we had started with letting the -Q behavior be the default long time ago and in fact not have a -Q option then we would not have this discussion. However, grdimage came out before PostScript level 3 introduced colormasking so -Q was added later.
If you refer to the white parts in the two figs at the far left and far right areas you posted above then I cannot reproduce those - it looks fine when I run those examples.
Activity
Make sure projected region handles periodic boundaries
Make sure projected region handles periodic boundaries (#5181)
weiji14 commentedon Apr 30, 2021
I just ran the code in #5180 (comment) on GMT master (commit 81da2a2) and it's giving me this image:
Is this correct? To be honest, I'm not familiar with the Mollweide projection so not sure what the expected output should be, but the gray parts doesn't seem ok. Using
-JW180/8ialso gives some gray output that wasn't there before in GMT 6.1.1.seisman commentedon May 3, 2021
@PaulWessel Please double-check it again.
PaulWessel commentedon May 3, 2021
OK, just did. It works fine for me. The gray is a function of the CPT. Add -Q to not see it or pick a CPT (like vik) that has white.
PaulWessel commentedon May 3, 2021
To be crystal clear, I just ran
seisman commentedon May 3, 2021
It means the gray region contains NaN values, but the
t.grdhas no values at the region, so it should be transparent even without -Q, no?PaulWessel commentedon May 3, 2021
Well, the projected grid has to be a rectangle, so that is what it looks like. We can discuss if in these situations we should automatically set up a clip path before laying down the rectangle, but that has never been done. it has always been like this.
seisman commentedon May 3, 2021
I have no idea what a projected grid means.
The following commands work as I expect, so what's the difference between the above
t.grdand thet0.grdhere?PaulWessel commentedon May 3, 2021
PostScript image is a rectangle, so any grdimage that is plotted in PostScript is projected and yields a rectangle. What is not within the original lon/lat boundingbox is set to NaN. Usually using -Q is really all you need.
Diference is the default CPT. For remote grids we use the default CPT listed in the server table. For t.grd we get turbo I think.
PaulWessel commentedon May 3, 2021
If we had started with letting the -Q behavior be the default long time ago and in fact not have a -Q option then we would not have this discussion. However, grdimage came out before PostScript level 3 introduced colormasking so -Q was added later.
seisman commentedon May 3, 2021
OK. It makes sense. Closing again.
weiji14 commentedon May 3, 2021
What about the white parts on the left and right of the oval? Is it meant to be white or colored by the grid (as with the
-JW180/8iexample)?PaulWessel commentedon May 3, 2021
If you refer to the white parts in the two figs at the far left and far right areas you posted above then I cannot reproduce those - it looks fine when I run those examples.
weiji14 commentedon May 3, 2021
Ah ok, I'll try and rebuild GMT master and try again. Thanks!
PaulWessel commentedon May 3, 2021
Great, it is a recent fix so probably just not updated on your end (I hope!).
Add regression test for grdimage plotting an xarray.DataArray grid su…
Add regression test for grdimage plotting an xarray.DataArray grid su…