-
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 load_earth_magnetic_anomaly function for Earth magnetic anomaly dataset #2196
Conversation
@willschlitzer Before you start to spend more time working on this PR, do you think we should have a more general function (e.g, |
@seisman Good idea. I'll get working on it (hopefully later this weekend). Should it go in something like |
I think the "datasets" directory is a better place. |
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 a few minor comments on the docstrings. Will do a more thorough review once the changes from #2200 are merged into this PR.
Co-authored-by: Dongdong Tian <[email protected]>
dataset_prefix = "earth_mag_" | ||
dataset_name = "earth_magnetic_anomaly" | ||
grid = _load_remote_dataset( | ||
dataset_name=dataset_name, | ||
dataset_prefix=dataset_prefix, |
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.
Maybe I'm missing some context, but is there a need to declare two extra variables instead of using them directly in the function?
dataset_prefix = "earth_mag_" | |
dataset_name = "earth_magnetic_anomaly" | |
grid = _load_remote_dataset( | |
dataset_name=dataset_name, | |
dataset_prefix=dataset_prefix, | |
grid = _load_remote_dataset( | |
dataset_name="earth_magnetic_anomaly", | |
dataset_prefix="earth_mag_", |
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'll make part of this change; I'm planning on adding in mag4km
in a later PR, so there will be a new parameter and some logic to set the prefix.
name="magnetic_anomaly", | ||
long_name="Earth magnetic anomaly", | ||
units="nT", | ||
extra_attributes={"horizontal_datum": "WGS84"}, |
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'm not an expert in magnetic anomalies, but having a horizontal_datum
seems strange. Is the magnetic anomaly referenced to the geoid somehow?
Also, not related to this PR, but I notice that horizontal_datum
is also set as an attribute for the earth_age
dataset at L96. Is seafloor crustal age also measured relative to a datum?
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.
Please see my comment #2200 (comment).
I think horizontal_datum
means the coordinate system for longitude/latitude.
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.
AFAIK, the datum in GMT is mainly related to the ellipsoid and its positioning. As you can see from gmt mapproject -Qd
, the positioning of the ellipsoid is given as the difference in three directions between the center of the ellipsoid and the center of the earth. As to earth_age
, I think it does not have height information, horizontal_datum
is enough. I don't konw much about magnetic anomalies.
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'm going to leave horizontal_datum
in; per my understanding (and from the comments above) it is the system that aligns coordinates with the actual locations on Earth. So I assume it still applies to the magnetic anomaly map?
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, leave it in. Thanks for the clarification everyone!
I'm wondering if you also want to add the dataset |
I was planning on adding it and an inline example in a later PR. |
…maly' into load-remote-dataset/magnetic-anomaly
Co-authored-by: Dongdong Tian <[email protected]>
…ericMappingTools/pygmt into load-remote-dataset/magnetic-anomaly
…ataset (GenericMappingTools#2196) Co-authored-by: Wei Ji <[email protected]> Co-authored-by: Dongdong Tian <[email protected]>
Add a function to import the magnetic anomaly dataset.
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