Skip to content

WIP API: Handle case when a grdmath operator expects a dataset instead of a grid - #2484

Closed
PaulWessel wants to merge 3 commits into
masterfrom
mexgrdmathfix
Closed

PaulWessel wants to merge 3 commits into
masterfrom
mexgrdmathfix

Conversation

@PaulWessel

Copy link
Copy Markdown
Contributor

There are six operators (e.g., INSIDE, PDIST, ...) that expects a dataset rather than a grid. GMT_Encode_Option now checks for this and sets the correct data type and geometry. That part is close to being However, we still fail to pass all tests. The mex example tests is

G = gmt('grdmath', '-R60/95/6/24 -I0.1 ? LDIST', [73 24; 89 6])

A few things to note:

  1. While the PR now detects the LDIST and sets the datatype to GMT_IS_DATASET, we fail deep in the API
  2. First time I realized it was examining the dataset pointer but we actually have a matrix from MATLAB. So I added | GMT_VIA_MATRIX to the family flag.
  3. Then we failed when calling gmtapi_validate_id in api_import_data around line 5143. We have passed an earlier call to gmtapi_validate_id but here the flag changes and we fail. Not sure why yet.
  4. I then decided to see what gmtmath does when it gets similar input (to learn what the flags have to be), so I tried G = gmt('gmtmath', '? ? ADD', [73; 89], [1; 1]). This went nowhere because I am getting a

GMT: Attempting to address a prhs entry that does not exist

message because there is a problem with the pointers to the rhs arguments and it goes outside the nrhs value. Going to be.

There are six operators (e.g., INSIDE, PDIST, ...) that expects a dataset rather than a grid. GMT_Encode_Option now checks for this and sets the correct data type and geometry.  However, we still fail to pass all tests.
@PaulWessel PaulWessel closed this Mar 9, 2020
@seisman
seisman deleted the mexgrdmathfix branch June 8, 2020 02:00
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

Successfully merging this pull request may close these issues.

1 participant