-
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
Remote datasets: Add "load_earth_dist" to load "GSHHG Earth distance to shoreline" dataset #3706
Conversation
/format |
Thanks for working on this function. I feel we should first update the upstream documentation to clarify the following points: |
assert data.attrs["units"] == "km" | ||
assert data.attrs["horizontal_datum"] == "WGS84" | ||
assert data.shape == (181, 361) | ||
assert data.gmt.registration == 0 |
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.
Need to update to the new syntax in #3696, depending on which PR is merged first.
Co-authored-by: Dongdong Tian <[email protected]>
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.
Looks good to me. The dataset image will be updated automatically when the upstream PR is merged.
Currently we use both, the abbreviation and the complete word for units in pygmt/pygmt/datasets/load_remote_dataset.py Lines 113 to 115 in b90fa46
but pygmt/pygmt/datasets/load_remote_dataset.py Lines 135 to 137 in b90fa46
I think we should decide on one way and update the dictionary in Edit: |
That's a good point. The CF convention mentions that the unit string must be recognized by the UDUNIT package. I quickly read the UNUNIT documentation, I think valid values are |
This section (http://cfconventions.org/Data/cf-conventions/cf-conventions-1.12/cf-conventions.html#_dimensional_vertical_coordinate) says:
So I think |
Submitted PR #3725 for updating this for all datasets. |
Description of proposed changes
Add
load_earth_dist
to download the "GSHHG Earth distance to shoreline" dataset and load into axarray.DataArray
:Adresses #2431
Preview: https://pygmt-dev--3706.org.readthedocs.build/en/3706/api/generated/pygmt.datasets.load_earth_dist.html
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 command is:
/format
: automatically format and lint the code