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

load_earth_magnetic_anomaly: Add mag4km parameter to support earth_mag4km dataset #2239

Merged
merged 14 commits into from
Dec 13, 2022

Conversation

willschlitzer
Copy link
Contributor

@willschlitzer willschlitzer commented Dec 9, 2022

As referenced in this comment, this adds the mag4km option for the magnetic anomaly dataset.

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 wrapping a new module, open a 'Wrap new GMT module' issue and submit reasonably-sized PRs.
  • 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

@willschlitzer willschlitzer added the enhancement Improving an existing feature label Dec 9, 2022
@willschlitzer willschlitzer added this to the 0.8.0 milestone Dec 9, 2022
@willschlitzer willschlitzer self-assigned this Dec 9, 2022
Comment on lines 34 to 36
data = load_earth_magnetic_anomaly(
resolution="01d", registration="gridline", mag4km=False
)
Copy link
Member

Choose a reason for hiding this comment

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

I prefer the old test without mag4km=False, because it also checks if the default dataset type (i.e., earth_mag) is changed.

willschlitzer and others added 2 commits December 9, 2022 10:06
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
@willschlitzer willschlitzer changed the title WIP: Add mag4km parameter to load_earth_magnetic_anomaly Add mag4km parameter to load_earth_magnetic_anomaly Dec 9, 2022
@willschlitzer willschlitzer marked this pull request as ready for review December 9, 2022 15:11
@seisman seisman changed the title Add mag4km parameter to load_earth_magnetic_anomaly load_earth_magnetic_anomaly: Add mag4km parameter to support earth_mag4km dataset Dec 9, 2022
pygmt/datasets/earth_magnetic_anomaly.py Outdated Show resolved Hide resolved
pygmt/datasets/earth_magnetic_anomaly.py Outdated Show resolved Hide resolved
Comment on lines 55 to 59
Specifies using the observations at sea level only over oceanic
regions or over land and water at an altitude of 4 kilometers. The
default is ``False``, which uses an *earth_mag_type* of **earth_mag**\.
Setting ``mag4km`` to ``True`` sets the *earth_mag_type*
of **earth_mag4km**. The oceanic files are ~60% smaller.
Copy link
Member

Choose a reason for hiding this comment

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

I feel the description is a little difficult to understand. Maybe rewrite it to something like:

Choose the data version to use. The default is False, which is observed at sea level over oceanic regions and have no data over land. Setting mag4km to True to use a version where all observations are relative to an altitude of 4 km above the geoid and includes data over land.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed.

@seisman seisman added the final review call This PR requires final review and approval from a second reviewer label Dec 12, 2022
@willschlitzer willschlitzer merged commit 02ee79f into main Dec 13, 2022
@willschlitzer willschlitzer deleted the load-remote-dataset/magnetic-anomaly-4km branch December 13, 2022 23:05
@willschlitzer willschlitzer removed the final review call This PR requires final review and approval from a second reviewer label Dec 13, 2022
sixy6e pushed a commit to sixy6e/pygmt that referenced this pull request Dec 21, 2022
…g4km dataset (GenericMappingTools#2239)

* Add mag4km parameter to load_earth_magnetic_anomaly.py
* Add tests for mag4km and associated cache files
* Add test_earth_mag_incorrect_resolution_registration function
* Remove unnecessary file suffix from cache .grd files used by test_datasets_earth_magnetic_anomaly.py

Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Yvonne Fröhlich <94163266+yvonnefroehlich@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improving an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants