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

Add total_field_anomaly function #510

Merged
merged 10 commits into from
Aug 12, 2024
Merged

Add total_field_anomaly function #510

merged 10 commits into from
Aug 12, 2024

Conversation

indiauppal
Copy link
Member

@indiauppal indiauppal commented Jun 14, 2024

Add new function that computes the total field anomaly from the magnetic field components and the inclination and declination of the IGRF. Include the function in the API index and add tests for it.

Relevant issues/PRs:
Fixes #506

>>> print(tfa)
50000.0
"""
b_e, b_n, b_u = magnetic_field

Choose a reason for hiding this comment

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

You could add a small check to control that the parameter declination is indeed in degree.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the suggestion @VascoSch92. It's hard to implement such checks. There's no way we can identify if the user passed an angle in radians or in degrees, besides making assumptions upon its value. I think documenting the argument properly, and keeping the consistency among the package (all inclination and declination angles, along with all longitude and latitude angles in Harmonica as expected in degrees) is enough to make users aware what is expected for these arguments.

Choose a reason for hiding this comment

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

you are right :-)

@leouieda leouieda changed the title Compute total field anomaly from the anomalous magnetic field. Compute total field anomaly from the anomalous magnetic field Jun 18, 2024
@santisoler santisoler added this to the v0.7.0 milestone Aug 9, 2024
@santisoler santisoler changed the title Compute total field anomaly from the anomalous magnetic field Add total_field_anomaly function Aug 12, 2024
@santisoler santisoler changed the title Add total_field_anomaly function Add total_field_anomaly function Aug 12, 2024
@santisoler santisoler merged commit 3576545 into fatiando:main Aug 12, 2024
19 checks passed
@indiauppal indiauppal deleted the tfa branch August 12, 2024 16:01
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.

Compute total field anomaly from magnetic field components
3 participants