Skip to content

Add total_horizontal_gradient function and tests #560

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ErosKerouak
Copy link

@ErosKerouak ErosKerouak commented May 11, 2025

This pull request adds the total_horizontal_gradient function to harmonica._transformations, which computes the amplitude of the horizontal gradient (THDR) of a potential field grid using the horizontal derivatives in the easting and northing directions.

It also includes:

  • Unit tests based on a synthetic model
  • Validation of input grids with dimension and NaN checks

This function complements total_gradient_amplitude by providing a horizontal-only version frequently used in gravity and magnetic data interpretation.

Relevant issues/PRs:
Closes #559

Implements the computation of the total horizontal derivative (THDR) of a potential
field grid. This function calculates the square root of the sum of squares of the
horizontal derivatives in the easting and northing directions.
Includes tests for:
- Agreement with a synthetic model
- Rejection of 1D and 3D grids
- Handling of grids containing NaN values

Ensures correctness and robustness of the total_horizontal_gradient filter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add common amplitude-based filters for potential field interpretation (THDR, TDR, θ, TDX, etc.)
1 participant