Skip to content

[Backport 6.1] Handle matrix via reference for grid input - #3838

Merged
PaulWessel merged 1 commit into
6.1from
backport-3829-to-6.1
Aug 4, 2020
Merged

[Backport 6.1] Handle matrix via reference for grid input#3838
PaulWessel merged 1 commit into
6.1from
backport-3829-to-6.1

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Backport 4c18338 from #3829

* Handle matrix vai reference for grid input
Testing is done via testapi_matrix_360_ref.c Seems to work but raises an issue related to memory freeing. Since the matrix data is only pointed to by the grid, I set the grid alloc_mode to external. However, that also means that the x and y arrays that are created when creating the grid is left unfreed at the end. We could just ignore this rare memory leak or do something about it. One way is to add info to the struct HIDDEN so that we free those arrays even those the matrix is left untouched.
* Add PS orig
* Update gmt_api.c
* Update gmt_grdio.c
* Fix output ij
* Handle a switch from reference to duplicate
* make sure we set min/max when needed and not reset it
* use lessons learned from MATRIX/DUPLICATE to GRID/DUPLICATE
Lots of errors there as well and probalby never accessed.
* Use duplcate for 360 adn ref for 360_ref
Also fix the region assignment
* Apply same logic for finding min/max as for duplicate
* handle non-projection in grdimage when a referenced global grid
@PaulWessel
PaulWessel self-requested a review August 4, 2020 19:36
@PaulWessel
PaulWessel merged commit a4fca92 into 6.1Aug 4, 2020
@PaulWessel
PaulWessel deleted the backport-3829-to-6.1 branch August 4, 2020 19:49
Sign up for freeto 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

@PaulWessel