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 control over spherical harmonics expansion degree #21

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

Conversation

ruboerner
Copy link

Purpose

This pull request introduces enhancements to three functions igrf, igrf_gc, and igrf_V within the repository. These changes provide users with greater control over the spherical harmonics expansion by allowing them to specify the minimum and maximum degree of the expansion.

Key Changes

New Arguments:

  • Added two new optional arguments (min_degree and max_degree) to the modified functions.
  • These arguments enable users to compute:
    • The pure dipole field by setting min_degree=1 and max_degree=1.
    • The multi-pole contribution by adjusting these parameters to desired values.

Improved Flexibility:

Users can now isolate specific contributions to the global magnetic field of the Earth.

Backward Compatibility:

Default values ensure that the original behavior of the functions is preserved when the new arguments are not provided.

Testing Instructions

Pull this branch and install the updated package.

Test the modified functions with various min_degree and max_degree combinations:

  • Example 1: min_degree=1, max_degree=1(pure dipole field).
  • Example 2: min_degree=2, max_degree=13 (multi-pole contributions).
  • Example 3: Default behavior (no arguments).

Verify that results match expectations for the original behavior when no new arguments are provided.

Please provide feedback or suggest further refinements if needed.

Add lowest and highest degree of series expansion.
Add lower and upper index for expansion evaluation also for igrf()
Add more descriptive parameters
@smithara
Copy link
Member

Thank you for the contribution! It makes sense. I will check it and merge it in soon

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.

2 participants