-
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_deflection to load "IGPP Earth east-west and north-south deflection" datasets #3728
Conversation
pygmt/datasets/earth_deflection.py
Outdated
] = "01d", | ||
region: Sequence[float] | str | None = None, | ||
registration: Literal["gridline", "pixel", None] = None, | ||
direction: Literal["edefl", "ndefl"] = "edefl", |
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.
If people have a more suitable name for this new parameter, feel free to make suggestions. I just picked the "east-west deflection" dataset as default.
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 the parameter is OK, but for the arguments, "edefl"/"ndefl" is not readable. Maybe "e"/"n" or "east"/"north" or "east_west"/"north_south", but I have to admit that I have no idea about the physical meaning of this dataset
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 comment #3728 (comment).
pygmt/datasets/earth_deflection.py
Outdated
] = "01d", | ||
region: Sequence[float] | str | None = None, | ||
registration: Literal["gridline", "pixel", None] = None, | ||
direction: Literal["east_west", "south_north"] = "east_west", |
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 it should be "north_south" rather than "south_north", mainly because:
- East and North are pointing to the positive values
- The GMT dataset names are "edefl" and "ndefl".
- The original source files are named as "east_xxx" and "north_xxx"
direction: Literal["east_west", "south_north"] = "east_west", | |
direction: Literal["east_west", "north_south"] = "east_west", |
I think we should also fix "south-north" to "north-south" in the remote-dataset page.
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.
Yes, I am also a bit wondering about the dataset names and coordinate system axes directions, and currently looking at in the literature about this naming.
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.
Just saw that the remote dataset docs are actually not consistent, and both "south-north"
(title and image describtion https://www.generic-mapping-tools.org/remote-datasets/earth-ndefl.html#igpp-earth-south-north-deflections) and "north-south" (in section usage https://www.generic-mapping-tools.org/remote-datasets/earth-ndefl.html#usage) are used.
Wikipedia says is's "east-west" and "north-south" (https://en.wikipedia.org/wiki/Vertical_deflection) and here https://geodesy.noaa.gov/GEOID/GSVS/deflection-vertical.shtml the deflection of the vertical is described via "east" and "north" components. So I think, as suggested by @seisman, we should use "north-south" and update the remote dataset docs. For the PyGMT side, I am wondering, maybe component
is better than direction
for the parameter name.
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.
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.
For the PyGMT side, I am wondering, maybe
component
is better thandirection
for the parameter name.
Yes, I think so.
Maybe we should at a note in the docs, that positive values mean a deflection to the east (north) and negative to the west (south) for the
edefl
(ndefl
) dataset; similar as we did it for the "distance to shoreline" dataset.
Sounds good.
…remote-earth-defl
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
The CI failures on macOS are unrelated to changes in this PR and will be tracked in #3732. Plan to merge this PR tomorrow if there are no further comments. |
Description of proposed changes
Add function
load_earth_deflection
to download the "IGPP Earth east-west and north-south deflection" datasets.Adresses #2431
Preview: https://pygmt-dev--3728.org.readthedocs.build/en/3728/api/generated/pygmt.datasets.load_earth_deflection.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