-
Notifications
You must be signed in to change notification settings - Fork 224
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
**BREAKING** pygmt.grdcut: Refactor to store output in virtualfiles for grids #3115
Open
seisman
wants to merge
103
commits into
main
Choose a base branch
from
gmtimage
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
5 tasks
Minimal xarray.DataArray output with data and coordinates, no metadata yet.
weiji14
reviewed
Mar 22, 2024
seisman
changed the title
WIP: Initial try to support raster images using temporary files
WIP: pygmt.grdcut: Support both grids and images
Mar 27, 2024
seisman
force-pushed
the
datatypes/gmtgrid
branch
3 times, most recently
from
April 1, 2024 07:11
d8f1160
to
d0517e0
Compare
seisman
force-pushed
the
datatypes/gmtgrid
branch
from
April 1, 2024 11:32
d0517e0
to
4ba67df
Compare
31 tasks
weiji14
added a commit
that referenced
this pull request
Jun 18, 2024
Special case `earth_day` to be loaded as GMT_IMAGE rather than GMT_GRID. Need to use `GMT_OUT|GMT_IS_REFERENCE` in virtualfile_out to avoid segfault, xref #3115.
Extra metadata from the _GMT_GRID_HEADER struct.
Reorder the dimensions to follow Channel, Height, Width (CHW) convention. Also added doctest checking output DataArray object and the image's x and y coordinates.
Get the registration and gtype info from the grid header and apply it to the GMT accessor attributes.
Trying to match some of the doctests in _GMT_GRID.
7 tasks
seisman
changed the title
pygmt.grdcut: Refactor to store output in virtualfiles for grids
**BREAKING** pygmt.grdcut: Refactor to store output in virtualfiles for grids
Dec 10, 2024
7 tasks
I think it's better to not introduce last-minute breaking changes, so bump this PR to v0.15.0. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
Improving an existing feature
needs review
This PR has higher priority and needs review.
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.
This PR applies virtualfiles in
pygmt.grdcut
, so that this function doesn't have to write to temporary files (#2730).grdcut
is on of the complicated module that it works for grid, image and cube. We have to know thekind
of the input before calling theSession.virtualfile_out
method.It turns out it's not trivial to determine the data
kind
of an input file. We have some options:.nc
is a grid,.tif
is a image)kind
parameter (default to"grid"
) and users should specify thekind
parameter.Option 1-2 may not always work; option 3 also dosn't always work (see #3115 (comment)).
This PR currently adopts option 4. Need to note option 4 meaning BREAKING:
grdcut("@earth_day_01d")
works; now must usegrdcut("@earth_day_01d", kind="image")