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
grdmath for externals seems to only accept input grids, not lines #2476
julia> G = gmt("grdmath -R60/95/6/24 -I0.1 ? LDIST", mat2ds([73 24; 89 6]))
ERROR: grd_init: input (Array{GMT.GMTdataset,1}) is not a GRID container type
bu it works if I first save the the line into a file and next do
julia> G = gmt("grdmath -R60/95/6/24 -I0.1 line.dat LDIST")
changed the title [-]grdmath for externals seam to only accept input grids, not lines[/-][+]grdmath for externals seems to only accept input grids, not lines[/+]on Jan 19, 2020
There are several of these operators (LDIST2? PDIST? etc) and some are LINE and others are POINT. If the above works then maybe generalize this in to a
GMT_LOCAL void check_grdmath_type (struct GMT_OPTION *opt, struct GMT_RESOURCE *item) {
if (!opt) return;
if (!strcmp (opt->arg, "LDIST"))
item->family = GMT_IS_DATASET, item->geometry=GMT_IS_LINE;
else if ...
}
and call as
if (is_grdmath) check_grdmath_type (opt->previous, info[n_items])
you can set is_grdmath to true earlier in that functions when we check if grdmath is called.
Sorry, the principle is good I think. Deep in movie title and fading. Make me a matlab script that shows the same failure and if you are lucky I will have time later.
Activity
[-]grdmath for externals seam to only accept input grids, not lines[/-][+]grdmath for externals seems to only accept input grids, not lines[/+]PaulWessel commentedon Jan 20, 2020
Yes, that is the thinking. So you can experiment with this. In gmt_api.c around line 10675 we state
I think we may need something like this:
There are several of these operators (LDIST2? PDIST? etc) and some are LINE and others are POINT. If the above works then maybe generalize this in to a
and call as
if (is_grdmath) check_grdmath_type (opt->previous, info[n_items])you can set is_grdmath to true earlier in that functions when we check if grdmath is called.
joa-quim commentedon Jan 20, 2020
I made it
but still get the same error.
PaulWessel commentedon Jan 20, 2020
Sorry, the principle is good I think. Deep in movie title and fading. Make me a matlab script that shows the same failure and if you are lucky I will have time later.
joa-quim commentedon Jan 20, 2020
The Ml version should be almost equal
PaulWessel commentedon Jan 21, 2020
See #2484. Some progress.
gmtmath had incorrect THIS_MODULE_KEYS
gmtmath had incorrect THIS_MODULE_KEYS (#2487)
Allow grdmath to ingest datasets or grids depending on operator
Change container type for grdmath dataset operators in the API (#2859)