GenericMappingTools / gmt

The Generic Mapping Tools
https://www.generic-mapping-tools.org
Other
857 stars 359 forks source link

Issue with grdclip #4162

Closed Esteban82 closed 4 years ago

Esteban82 commented 4 years ago

I run the following example from the grdclip docs

gmt grdclip @classes.nc -Gnew_classes.nc -Si25/30/99 -Si35/39/55 -Sr17/11 -Sb10/0 -V

(I add the @ in the file name).

Is the with error in -Si a bug? Or this was modified (and them the example should be modified)?

In another script I have this command and I have errors also with -Sb and -Sa. In previous versions (I think GMT5) it worked fine. gmt grdclip %CUT% -G%CUT% -Sb3/10 -Si3/12/20 -Si12/22/30 -Sa22/40 -Vi

image

OS: Win64 GMT6.1.1.

PaulWessel commented 4 years ago

I get the same error you do. Will have a look after the breakfast routine...

PaulWessel commented 4 years ago

There is no such file. Only the files with a leading @ are actual files in the cache. Most of our examples involve imaginary data sets and the commands cannot be tried as is. We would like to improve that but it is a long path ahead. Adding a @ will not make the file appear, obviously.

PaulWessel commented 4 years ago

However, if you have an example with a file that fails to do what the docs say, please post as an issue.

Esteban82 commented 4 years ago

Ok. I addapt it to the grid of the example 2. gmt grdclip @HI_topo_02.nc -Gnew_classes.nc -Sb0/1 -Si0/2/10 -Sa2/1.9

seisman commented 4 years ago

The issue is related to changes in PR #2422 by @joa-quim.

Esteban82 commented 4 years ago

Ok. So now it is not possible to reclassified values as in the second example of the docs (-Si25/30/99 -Si35/39/55).

I have an script to create an Aspect-Slope map that that use this module. I think that I would have to add an extra step. First, collapse all the range values, and then replace it with (grdclip -Sr).

seisman commented 4 years ago

@PaulWessel @joa-quim Please check if we should revert the changes in #2422.

PaulWessel commented 4 years ago

yes, on my to-do list.

joa-quim commented 4 years ago

I had a quick look yesterday to this and don't remember why I did it. Have a vague recall that it was triggered by a crash but looking at it I don't see how. Anyway the patch was silly as we should no restrict the values the user wants to put in the clipped zone, so, yes, those changes should be reverted.

... and since the summer never ends so don't do the visits.

PaulWessel commented 4 years ago

Any easy way to revert, @seisman ?

seisman commented 4 years ago

No easy way to revert, because the changes in #2422 were changed again after that PR was merged.

joa-quim commented 4 years ago

Just commit a new one with the added lines removed.