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

implement midpoint derivative calculation #709

Open
Swanson-Hysell opened this issue Feb 5, 2024 · 0 comments
Open

implement midpoint derivative calculation #709

Swanson-Hysell opened this issue Feb 5, 2024 · 0 comments

Comments

@Swanson-Hysell
Copy link
Member

Currently within ipmag.curie() there is code to calculate the derivative which is then smoothed. It seems preferable to use the midpoint temperature (i.e. T_mid = (T[i + 1] + T[i]) / 2) for the derivative rather than the original T array values in order to associate the derivative value between the two points from which it is calculated.

Here is the current relevant code:

    # calculate first derivative
    d1, T_d1 = [], []
    for i in range(len(M_smooth) - 1):
        Dy = M_smooth[i - 1] - M_smooth[i + 1]
        Dx = T[i - 1] - T[i + 1]
        d1.append(Dy/Dx)
    T_d1 = T[1:len(T - 1)]
    d1 = np.array(d1, 'f')
    d1_smooth = smooth(d1, window_len)
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

No branches or pull requests

1 participant