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.
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
Wrap GMT's standard data type GMT_IMAGE for images #3338
Wrap GMT's standard data type GMT_IMAGE for images #3338
Changes from 20 commits
921674c
c01d6ab
36430c8
a918cfd
1983b7e
84cbd11
f887a23
95275b0
d43f2e9
47d4e4a
bb0efe3
994de3a
8d9c2ae
75c0f7e
dc1a649
0638dab
7080d8b
8692161
aeb2ea3
dad88ce
3f2f6bf
74b889f
bf7f0b0
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
header.z_min and header.z_max are not checked here, because they have invalid values like 1.79769313486231570000e+308 (i.e.,
DBL_MAX
).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting this error at https://github.com/GenericMappingTools/pygmt/actions/runs/10017032324/job/27690729251?pr=3338#step:8:1556:
So do we need to add
libgdal-hdf5
to gmt-feedstock, similar to conda-forge/gmt-feedstock#291?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working in conda-forge/gmt-feedstock#293.
Edit:
Tried to run
gmt grdcut @earth_relief_01d -R-10/-9/3/5 -Greliefcut.nc
in conda-forge/gmt-feedstock@ff8d995 and it worked. It means reading the netCDF file usually doesn't need the HDF5 library, but here we're actually reading the netCDF file as an image (kind="image"
which reads the file into a GMT_IMAGE data container), which calls the GDAL library to read rather than the netCDF library.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test still fails even if
libgdal-hdf5
is installed, see https://github.com/GenericMappingTools/pygmt/actions/runs/10018688146/job/27694518606?pr=3338.The expected
header.wesn
is [-180, 180, -90, 90], but the actual results are platform-dependent. For Python 3.12 + Ubuntu, the result is[-179.5, 179.5, -89.5, 89.5]
but for Python 3.10 + Ubuntu, the result is[0.5, 359.5, 0.5, 179.5]
.The test added in conda-forge/gmt-feedstock#293 also fails (see https://github.com/conda-forge/gmt-feedstock/pull/293/checks?check_run_id=27696860313, https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=983672&view=logs&jobId=656edd35-690f-5c53-9ba3-09c10d0bea97&j=656edd35-690f-5c53-9ba3-09c10d0bea97&t=986b1512-c876-5f92-0d81-ba851554a0a3).
Not interested in digging down the rabbit hole, so I prefer to removing this test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, or we can keep the test and mark it with xfail? Might have something to do with different GDAL versions or something. I almost think we should include GDAL in
pygmt.show_versions()
to more easily check things.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added the test back but the macOS + Python 3.12 CI job keeps crashing (https://github.com/GenericMappingTools/pygmt/actions/runs/10024733960/job/27707337991?pr=3338).