Skip to content

Add theta_map function and tests #561

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 4 commits into
base: main
Choose a base branch
from

Conversation

ErosKerouak
Copy link

This pull request adds the theta_map function to harmonica._transformations.

The theta map is a commonly used edge-enhancement filter. It calculates the arctangent of the horizontal gradient magnitude divided by the total gradient amplitude.

Changes included in this PR:

  • New theta_map function with full docstring and mathematical formula
  • Unit tests against a synthetic model
  • Error handling for invalid input grids (1D, 3D, or containing NaNs)

Relevant issues/PRs:
Closes #559
Continues work from #560

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.
Implements the theta map filter.
The function computes the arctangent of the horizontal gradient magnitude over
the total gradient amplitude. Includes a detailed docstring with formula and references.
Includes:
- Validation against synthetic model using finite differences and FFT
- Input error handling for 1D, 3D, and NaN-containing grids
- Integration of theta_map import for test discovery
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