Skip to content

PhiNormSpline inconsistencies #15

Description

@aszharov

Hello!
It seems to me that I've noticed the inconsistency within _getPhiNormSpline and _getPhiNormToPsiNormSpline.
In this part of code

x = (
    numpy.linspace(0, 1, num=self.getQProfile()[idx].size) *
    (self.getFluxLCFS()[idx] - self.getFluxAxis()[idx])
)
phi_norm_meas = numpy.insert(
    scipy.integrate.cumtrapz(self.getQProfile()[idx], x=x),
    0, 0
)
phi_norm_meas = phi_norm_meas / phi_norm_meas[-1]

spline = trispline.UnivariateInterpolator(
    numpy.linspace(0.0, 1.0, len(phi_norm_meas)),
    phi_norm_meas,
    k=k
)

self.getQProfile()[idx].size will return the size of the time scale instead of size of the psinorm scale.

I drew this conclusion from the documentation where
q – Array-like, (S, M). q profile evaluated at S values of psinorm from 0 to 1, given at M times.

Please correct me if self.getQProfile()[:, idx].size is not a solution to the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions