Skip to content

Add mad_to_a95 conversion function#816

Merged
duserzym merged 3 commits into
PmagPy:masterfrom
LenGallo:add-mad-to-a95-function
Dec 16, 2025
Merged

Add mad_to_a95 conversion function#816
duserzym merged 3 commits into
PmagPy:masterfrom
LenGallo:add-mad-to-a95-function

Conversation

@LenGallo

@LenGallo LenGallo commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

Implements conversion from MAD (or aMAD) to a95 using Khokhlov & Hulot (2016, Table 8)

LenGallo and others added 2 commits December 5, 2025 15:08
Implements conversion from MAD (or aMAD) to a95 using Khokhlov & Hulot (2016, Table 8)
@Swanson-Hysell

Swanson-Hysell commented Dec 5, 2025

Copy link
Copy Markdown
Member

Thanks for this pull request!

I think it would be better to use the asymptotic n=100 value for all n_steps that are greater than 16. The value of 16 and the value of 100 are close so this is an appropriate approximation. I have made a commit that removes the strict logic and uses this asymptotic approach instead. I have also had it return a value error for n_steps < 3.

This simplifies the API.

@Swanson-Hysell

Copy link
Copy Markdown
Member

The other thing that we need to update is to enable the function to take an array for n_steps values if there is an array of MAD values. It is common with a set of data for there to be different n_steps for different specimens that would have different MADs.

@Swanson-Hysell

Swanson-Hysell commented Dec 5, 2025

Copy link
Copy Markdown
Member

I have now added the ability for the function to accept an array of n_steps values that can correspond with the MAD values. It can either accept a single value as before or accept an array of matching length. @LenGallo Can you give the updated function a test and make any additional changes you see fit?

@LenGallo

LenGallo commented Dec 8, 2025

Copy link
Copy Markdown
Contributor Author

Thanks @Swanson-Hysell for improving the implementation! I pulled the changes and tested mad_to_a95 with both scalar and array inputs for mad and n_steps. Everything behaves as expected!

@duserzym duserzym merged commit 0d70e26 into PmagPy:master Dec 16, 2025
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.

3 participants