Create LibGMT.grid_to_vfile for xarray support #159
Merged
Conversation
Implemented a doctest using the earth relief data. Not passing at the moment. Failing with a Seg Fault. Might be because the direction needs to be `GMT_IN|GMT_IS_REFERENCE`. Need support for | in the direction argument.
Still crashing when using ranges and inc but works with dim. Might be a bug in GMT
Need docs for dataarray_to_matrix and more tests for the code.
Member
Author
|
Still needs some work on documentation and extensive testing. |
stickler-ci
reviewed
Apr 9, 2018
gmt/clib/core.py
Outdated
| direction_int = self._parse_constant( | ||
| direction, valid=['GMT_IN', 'GMT_OUT'], | ||
| valid_modifiers=['GMT_IS_REFERENCE']) | ||
| # valid_modifiers=None) |
There was a problem hiding this comment.
E116 unexpected indentation (comment)
|
|
||
| """ | ||
| if len(grid.dims) != 2: | ||
| raise GMTInvalidInput( |
There was a problem hiding this comment.
F821 undefined name 'GMTInvalidInput'
gmt/clib/utils.py
Outdated
| north_incs = north[1:] - north[0:-1] | ||
| north_inc = north_incs[0] | ||
| if not np.allclose(north_incs, north_inc): | ||
| raise GMTInvalidInput( |
There was a problem hiding this comment.
F821 undefined name 'GMTInvalidInput'
Member
Author
|
Requires GMT 6.0.0a14 to work. There was a bug in the GMT grid creation when specified the grid dimensions and increments. |
Closed
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes proposed in this pull request
Implements a new context manager
LibGMT.grid_to_vfilethat takesan
xarray.DataArray, creates aGMT_MATRIXto store the data,passes it along to a virtual file, and yields the virtual file name.
This is the main building block for supporting the
grd*commands (#124).