Skip to content
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

Allow load_earth_relief() to load the original land-only 01s or 03s SRTM tiles #976

Merged
merged 19 commits into from
Mar 15, 2021

Conversation

core-man
Copy link
Member

@core-man core-man commented Feb 27, 2021

Description of proposed changes

Allow the load_earth_relief function to load the original land-only SRTM tiles, which have a resolution of 01s or 03s.

A new parameter use_srtm (default to False) was added to perform this feature.

If resolution is 01s or 03s, we then check use_srtm to determine the relief data prefix (earth_relief_prefix).

  • If use_srtm is False, earth_relief_prefix = earth_relief_.
  • If use_srtm is True, earth_relief_prefix = srtm_relief_.

Fixes #966

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If adding new functionality, add an example to docstrings or tutorials.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash commands are:

  • /format: automatically format and lint the code
  • /test-gmt-dev: run full tests on the latest GMT development version

pygmt/datasets/earth_relief.py Show resolved Hide resolved
pygmt/datasets/earth_relief.py Outdated Show resolved Hide resolved
pygmt/datasets/earth_relief.py Outdated Show resolved Hide resolved
@seisman seisman marked this pull request as draft February 27, 2021 17:10
@seisman
Copy link
Member

seisman commented Feb 27, 2021

@core-man I just converted your PR to draft to save CI resources.

pygmt/datasets/earth_relief.py Outdated Show resolved Hide resolved
pygmt/datasets/earth_relief.py Outdated Show resolved Hide resolved
pygmt/datasets/earth_relief.py Outdated Show resolved Hide resolved
pygmt/datasets/earth_relief.py Outdated Show resolved Hide resolved
pygmt/datasets/earth_relief.py Outdated Show resolved Hide resolved
pygmt/datasets/earth_relief.py Outdated Show resolved Hide resolved
@seisman seisman self-requested a review February 27, 2021 21:45
Copy link
Member

@seisman seisman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need to add a test to make sure that the change work as expected.

Please see pygmt/tests/test_datasets.py for similar tests.

@seisman seisman added this to the 0.4.0 milestone Feb 28, 2021
@seisman seisman added the feature Brand new feature label Feb 28, 2021
@core-man
Copy link
Member Author

We also need to add a test to make sure that the change work as expected.

Please see pygmt/tests/test_datasets.py for similar tests.

test_earth_relief_03s_landonly_srtm was added in 849df3b.

@seisman
Copy link
Member

seisman commented Feb 28, 2021

@core-man Sorry, I didn't realize that you already added a test to tests/test_datasets.py.

We just split the tests in tests/test_dataset.py into two files tests/test_datasets_tutorial.py and tests/test_datasets_earth_relief.py (#978). So you have to deal with the conflict and move your new test into the file tests/test_datasets_earth_relief.py.

Sorry for the trouble. Please let me know if you need any help resolving the conflicts.

Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
@core-man core-man requested review from seisman and weiji14 March 2, 2021 06:12
Copy link
Member

@seisman seisman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Ping @GenericMappingTools/python for further comments.

FYI, we're planning to make a patch release (v0.3.1) in mid-March. Since this PR adds a new feature, it should not be merged into the v0.3.1 release. We will merge this PR after the v0.3.1 release.

@seisman seisman marked this pull request as ready for review March 2, 2021 06:23
Copy link
Member

@weiji14 weiji14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be labelled as a 'feature' or 'enhancement'? I feel like we can sneak it in for v0.3.1, but also ok with saving if for v0.4.0 a month later.

pygmt/datasets/earth_relief.py Outdated Show resolved Hide resolved
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
@seisman seisman changed the title Allow load_earth_relief() to load the original land-only SRTM tiles Allow load_earth_relief() to load the original land-only 01s or 03s SRTM tiles Mar 15, 2021
@seisman
Copy link
Member

seisman commented Mar 15, 2021

This PR is ready to merge.

@weiji14 @michaelgrund @willschlitzer @meghanrjones Please see if you have further comments.

@seisman seisman merged commit 69417b4 into GenericMappingTools:master Mar 15, 2021
@core-man core-man deleted the load-landonly-srtm branch March 16, 2021 03:42
sixy6e pushed a commit to sixy6e/pygmt that referenced this pull request Dec 21, 2022
…RTM tiles (GenericMappingTools#976)

Allow the load_earth_relief function to load the original land-only 
01s or 03s SRTM tiles, by adding a new parameter `use_srtm` 
(default to False).

Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Brand new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow load_earth_relief() to load the original land-only SRTM tiles
4 participants