-
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
Add gallery example for grdclip #1396
Conversation
Since noone worked on this issue during the scipy-sprint here's a gallery example adressing #1384.
/format |
examples/gallery/images/grdclip.py
Outdated
# Load sample grid (1 arc minute global relief) and use area around the Hawaiian Islands | ||
grid = pygmt.datasets.load_earth_relief(resolution="01m", region=[-162, -153, 18, 23]) |
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.
The 1 arc minute global relief data is NOT cached in the CI. We should either cache the 01m data or use a lower resolution earth relief.
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 would prefer to use a high resolution as the 1 arc minute global relief, otherwise the map looks bad. Will add the 01m data to cache in a separate PR (#1398).
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.
Or can we use a different location? I like the Hawaii example, but caching the 1 arc minute data (258MB) isn't very feasible... How about another island like Iceland (or another medium-ish sized one).
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.
Or can we use a different location? I like the Hawaii example, but caching the 1 arc minute data (258MB) isn't very feasible... How about another island like Iceland (or another medium-ish sized one).
Sounds a better solution.
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 changed it to the 3 arc minute grid (27 MB) for the area around Iceland. Is that fine or still to large for caching?
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.
The current cache size is 30.5MB (https://github.com/GenericMappingTools/pygmt/actions/runs/1064597430), so adding 27MB would make it 50.5MB. I'm still a bit hesitant to add it... How about adding just the tile that is downloaded. Running gmt grdcut @earth_relief_03m -R-28/-10/62/68 -Gtemp.nc
gives me the tile name "N00W090.earth_relief_03m_p" in .gmt/server/earth/earth_relief/earth_relief_03m_p
so maybe try just caching that?
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.
The current cache size is 30.5MB (https://github.com/GenericMappingTools/pygmt/actions/runs/1064597430), so adding 27MB would make it 50.5MB. I'm still a bit hesitant to add it... How about adding just the tile that is downloaded. Running
gmt grdcut @earth_relief_03m -R-28/-10/62/68 -Gtemp.nc
gives me the tile name "N00W090.earth_relief_03m_p" in.gmt/server/earth/earth_relief/earth_relief_03m_p
so maybe try just caching that?
Does adding "N00W090.earth_relief_03m_p" allow to automatically use only this tile for plotting or is there anything else to consider @weiji14 ?
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.
See another similar case:
pygmt/pygmt/helpers/testing.py
Line 163 in 6a4b871
"@N35E135.earth_relief_03s_g.nc", |
So, I think we could only cache such a single tile. See some notes for this case in #985 (comment).
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.
See another similar case:
pygmt/pygmt/helpers/testing.py
Line 163 in 6a4b871
"@N35E135.earth_relief_03s_g.nc", I think we could only cache such a single tile.
I already recognized this one 😉 . My question is: Is that tile automatically used by pygmt.datasets.load_earth_relief()
when the corresponding region is defined?
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.
Is that tile automatically used by
pygmt.datasets.load_earth_relief()
when the corresponding region is defined?
Yes.
Co-authored-by: Dongdong Tian <[email protected]>
As discussed in #1396 this PR adds the 1 arc minute global relief data to cache.
Co-authored-by: Dongdong Tian <[email protected]>
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.
Great~~~We have one more gallery~ 😄
Co-authored-by: Dongdong Tian <[email protected]>
Description of proposed changes
Since noone worked on this issue during the scipy-sprint here's a gallery example adressing #1384.
Reminders
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
.Slash Commands
You can write slash commands (
/command
) in the first line of a comment to performspecific operations. Supported slash commands are:
/format
: automatically format and lint the code/test-gmt-dev
: run full tests on the latest GMT development version