Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the bug when passing pixel-registered matrix as grids #3503

Merged
merged 3 commits into from
Jun 20, 2020

Conversation

seisman
Copy link
Member

@seisman seisman commented Jun 20, 2020

Description of proposed changes

Fixes #3502

Reminders

  • Correct base branch selected? master for new features, 6.1 for bug fixes
  • Make sure that your code follows our style. Use the other functions/files as a basis.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Describe changes to function behavior and arguments in a comment below the function declaration.
  • If adding new functionality, add a detailed description to the documentation and/or an example.

@seisman
Copy link
Member Author

seisman commented Jun 20, 2020

@PaulWessel You can work on this branch directly. No need to merge it into master.

@PaulWessel
Copy link
Member

OK, need to wrap another debug first...

@PaulWessel
Copy link
Member

The gmtapi_init_matrix confused what the offset argument to gmt_M_get_n should be (it should be the registration, but we passed 0.5 * registration). To add insult to injury, we did not set the matrix registration using the input registration, hence the matrix was always gridline registered.
Good test!. The plots now look the same, @seisman.

@PaulWessel
Copy link
Member

I checked that gmt_M_get_n is used correctly everywhere else.

@seisman
Copy link
Member Author

seisman commented Jun 20, 2020

Great! Please add some comments to src/testapi_matrix_as_grid.c, and add a test in the test/api directory.

@PaulWessel
Copy link
Member

I've added the test and comments.

@seisman seisman changed the title Add a C test to check passing matrix as grids Fix the bug when passing pixel-registered matrix as grids Jun 20, 2020
@seisman seisman added this to the 6.1.0 milestone Jun 20, 2020
@seisman seisman merged commit 7f02e42 into master Jun 20, 2020
@seisman seisman deleted the testapi-registration branch June 20, 2020 08:24
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.

Bug when passing matrix as a pixel-registered grid to GMT C API?
2 participants