freegsnke.jtor_update module

Defines refined current-density profiles built on the native freegsnke.jtor classes.

Copyright 2025 UKAEA, UKRI-STFC, and The Authors, as per the COPYRIGHT and README files.

This file is part of FreeGSNKE.

FreeGSNKE is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

FreeGSNKE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with FreeGSNKE. If not, see <http://www.gnu.org/licenses/>.

class freegsnke.jtor_update.ConstrainBetapIp(eq: object, *args: object, **kwargs: object)[source]

Bases: ConstrainBetapIp, Jtor_universal

Betap–Ip constrained toroidal current profile with FreeGSNKE extensions.

Jtor(*args: object, **kwargs: object) → ndarray

Evaluate toroidal current density (Jtor), dispatching to either the refined or unrefined implementation.

This method acts as a unified interface: - If _refine_jtor is True, it calls Jtor_refined - Otherwise, it calls Jtor_unrefined

Parameters:
  • *args (object) – Positional arguments passed directly to the selected Jtor implementation.

  • **kwargs (object) – Keyword arguments passed directly to the selected Jtor implementation.

Returns:

Toroidal current density evaluated on the plasma grid.

Return type:

np.ndarray

Lao_parameters(n_alpha: int, n_beta: int, alpha_logic: bool = True, beta_logic: bool = True, Ip_logic: bool = True, nn: int = 100) → tuple[ndarray, ndarray][source]

Fit Lao85 profile parameters to the current pprime and ffprime profiles.

This method constructs a discrete sampling of the normalized flux coordinate and evaluates the current profile derivatives. It then fits a Lao85-type polynomial representation to obtain optimal alpha and beta parameters.

Parameters:
  • n_alpha (int) – Number of free parameters used in the pprime (alpha) expansion.

  • n_beta (int) – Number of free parameters used in the ffprime (beta) expansion.

  • alpha_logic (bool, optional) – If True, enforce boundary-consistent modification of the alpha basis.

  • beta_logic (bool, optional) – If True, enforce boundary-consistent modification of the beta basis.

  • Ip_logic (bool, optional) – If True, apply total current normalisation during fitting.

  • nn (int, optional) – Number of sampling points in the normalized flux coordinate.

Returns:

  • alpha (np.ndarray) – Fitted alpha coefficients for the pprime expansion.

  • beta (np.ndarray) – Fitted beta coefficients for the ffprime expansion.

__init__(eq: object, *args: object, **kwargs: object) → None[source]

Initialise the constrained profile.

Parameters:
  • eq (FreeGSNKE Equilibrium object) – Equilibrium object defining grid geometry and limiter structure.

  • *args (object) – Positional arguments passed to the parent profile constructor.

  • **kwargs (object) – Keyword arguments passed to the parent profile constructor.

copy() → ConstrainBetapIp[source]

Create a deep-ish copy of the profile object.

Returns:

A new instance with copied scalar parameters and shared/replicated internal state depending on attribute type.

Return type:

ConstrainBetapIp

class freegsnke.jtor_update.ConstrainPaxisIp(eq: object, *args: object, **kwargs: object)[source]

Bases: ConstrainPaxisIp, Jtor_universal

Paxis–Ip constrained toroidal current profile with FreeGSNKE extensions.

Jtor(*args: object, **kwargs: object) → ndarray

Evaluate toroidal current density (Jtor), dispatching to either the refined or unrefined implementation.

This method acts as a unified interface: - If _refine_jtor is True, it calls Jtor_refined - Otherwise, it calls Jtor_unrefined

Parameters:
  • *args (object) – Positional arguments passed directly to the selected Jtor implementation.

  • **kwargs (object) – Keyword arguments passed directly to the selected Jtor implementation.

Returns:

Toroidal current density evaluated on the plasma grid.

Return type:

np.ndarray

Lao_parameters(n_alpha: int, n_beta: int, alpha_logic: bool = True, beta_logic: bool = True, Ip_logic: bool = True, nn: int = 100) → tuple[ndarray, ndarray][source]

Fit Lao85 profile coefficients from pprime and ffprime evaluations.

This method samples the normalized flux coordinate and evaluates the pressure derivative (pprime) and flux function derivative (ffprime). It then computes best-fit Lao85 polynomial coefficients using a linear fitting procedure.

Parameters:
  • n_alpha (int) – Number of coefficients in the alpha (pprime) expansion.

  • n_beta (int) – Number of coefficients in the beta (ffprime) expansion.

  • alpha_logic (bool, optional) – If True, enforces boundary-consistent modification of the alpha basis.

  • beta_logic (bool, optional) – If True, enforces boundary-consistent modification of the beta basis.

  • Ip_logic (bool, optional) – If True, applies total current normalisation in the fitting procedure.

  • nn (int, optional) – Number of points used to sample the normalized flux coordinate.

Returns:

  • alpha (np.ndarray) – Fitted coefficients for the pprime expansion.

  • beta (np.ndarray) – Fitted coefficients for the ffprime expansion.

__init__(eq: object, *args: object, **kwargs: object) → None[source]

Initialise the constrained profile.

Parameters:
  • eq (FreeGSNKE Equilibrium object) – Equilibrium object defining grid geometry and limiter structure.

  • *args (object) – Positional arguments passed to the parent profile constructor.

  • **kwargs (object) – Keyword arguments passed to the parent profile constructor.

copy() → ConstrainPaxisIp[source]

Create a copy of the current profile instance.

Returns:

A copied instance with duplicated scalar parameters and appropriately handled internal state (deep or shallow depending on attribute type).

Return type:

ConstrainPaxisIp

class freegsnke.jtor_update.Fiesta_Topeol(eq: object, *args: object, **kwargs: object)[source]

Bases: Fiesta_Topeol, Jtor_universal

Fiesta Topeol constrained toroidal current profile with FreeGSNKE extensions.

Jtor(*args: object, **kwargs: object) → ndarray

Evaluate toroidal current density (Jtor), dispatching to either the refined or unrefined implementation.

This method acts as a unified interface: - If _refine_jtor is True, it calls Jtor_refined - Otherwise, it calls Jtor_unrefined

Parameters:
  • *args (object) – Positional arguments passed directly to the selected Jtor implementation.

  • **kwargs (object) – Keyword arguments passed directly to the selected Jtor implementation.

Returns:

Toroidal current density evaluated on the plasma grid.

Return type:

np.ndarray

Lao_parameters(n_alpha: int, n_beta: int, alpha_logic: bool = True, beta_logic: bool = True, Ip_logic: bool = True, nn: int = 100) → tuple[ndarray, ndarray][source]

Fit Lao85 profile coefficients from sampled pprime and ffprime data.

This method evaluates the pressure derivative (pprime) and flux function derivative (ffprime) on a uniform grid in the normalized flux coordinate, then fits Lao85 polynomial coefficients using a linear least-squares procedure.

Parameters:
  • n_alpha (int) – Number of coefficients in the alpha (pprime) expansion.

  • n_beta (int) – Number of coefficients in the beta (ffprime) expansion.

  • alpha_logic (bool, optional) – If True, enforces boundary-consistent modification of the alpha basis.

  • beta_logic (bool, optional) – If True, enforces boundary-consistent modification of the beta basis.

  • Ip_logic (bool, optional) – If True, applies total current normalisation in the fitting procedure.

  • nn (int, optional) – Number of sample points in the normalized flux coordinate.

Returns:

  • alpha (np.ndarray) – Fitted coefficients for the pprime expansion.

  • beta (np.ndarray) – Fitted coefficients for the ffprime expansion.

__init__(eq: object, *args: object, **kwargs: object) → None[source]

Initialise the Fiesta-Topeol constrained current profile.

Parameters:
  • eq (FreeGSNKE Equilibrium object) – Equilibrium object defining grid geometry and limiter structure.

  • *args (object) – Positional arguments passed to the parent profile constructor.

  • **kwargs (object) – Keyword arguments passed to the parent profile constructor.

copy() → Fiesta_Topeol[source]

Create a copy of the Fiesta-Topeol profile instance.

Returns:

A copied instance with duplicated scalar parameters and appropriately handled internal state (deep or shallow depending on attribute type).

Return type:

Fiesta_Topeol

class freegsnke.jtor_update.GeneralPprimeFFprime(eq: object, *args: object, **kwargs: object)[source]

Bases: GeneralPprimeFFprime, Jtor_universal

General unconstrained toroidal current profile with FreeGSNKE extensions.

Jtor(*args: object, **kwargs: object) → ndarray

Evaluate toroidal current density (Jtor), dispatching to either the refined or unrefined implementation.

This method acts as a unified interface: - If _refine_jtor is True, it calls Jtor_refined - Otherwise, it calls Jtor_unrefined

Parameters:
  • *args (object) – Positional arguments passed directly to the selected Jtor implementation.

  • **kwargs (object) – Keyword arguments passed directly to the selected Jtor implementation.

Returns:

Toroidal current density evaluated on the plasma grid.

Return type:

np.ndarray

__init__(eq: object, *args: object, **kwargs: object) → None[source]

Initialise the general pprime/ffprime current profile.

Parameters:
  • eq (FreeGSNKE Equilibrium object) – Equilibrium object defining grid geometry and limiter structure.

  • *args (object) – Positional arguments passed to the parent profile constructor.

  • **kwargs (object) – Keyword arguments passed to the parent profile constructor.

assign_profile_parameter() → None[source]

Reset profile parameter container.

This profile is fully non-parametric, so no scalar or vector parameter set is required; the parameter container is explicitly cleared.

copy() → GeneralPprimeFFprime[source]

Create a copy of the GeneralPprimeFFprime profile instance.

Returns:

A copied instance with all profile data and grid-dependent state duplicated and reinitialised appropriately.

Return type:

GeneralPprimeFFprime

class freegsnke.jtor_update.Jtor_universal(refine_jtor: bool = False)[source]

Bases: object

Wrapper class providing a unified interface for toroidal current density (Jtor) evaluation, with optional refinement.

This class selects between two implementations of the toroidal current density model depending on whether refinement is enabled:

  • Unrefined Jtor: fast, standard evaluation

  • Refined Jtor: higher-resolution or corrected evaluation using additional numerical processing

The interface ensures that downstream code can call Jtor() without needing to know which implementation is being used.

Jtor(*args: object, **kwargs: object) → ndarray[source]

Evaluate toroidal current density (Jtor), dispatching to either the refined or unrefined implementation.

This method acts as a unified interface: - If _refine_jtor is True, it calls Jtor_refined - Otherwise, it calls Jtor_unrefined

Parameters:
  • *args (object) – Positional arguments passed directly to the selected Jtor implementation.

  • **kwargs (object) – Keyword arguments passed directly to the selected Jtor implementation.

Returns:

Toroidal current density evaluated on the plasma grid.

Return type:

np.ndarray

Jtor_build(Jtor_part1: Callable[[...], tuple], Jtor_part2: Callable[[...], ndarray], core_mask_limiter: Callable[[...], tuple], R: ndarray, Z: ndarray, psi: ndarray, psi_bndry: float | None, mask_outside_limiter: ndarray, limiter_mask_out: ndarray) → tuple[ndarray, ndarray, ndarray, float, ndarray | None, ndarray, bool][source]

Construct the toroidal current density (Jtor) using a modular profile pipeline.

This function is the main assembly routine for the plasma current density. It combines: - geometric reconstruction of plasma boundaries (Jtor_part1), - limiter-aware core masking (core_mask_limiter), - and evaluation of the current profile itself (Jtor_part2).

The implementation is designed to support multiple profile parametrisations in a unified framework.

Parameters:
  • Jtor_part1 (callable) – Function that computes geometric plasma descriptors: returns (opt, xpt, diverted_core_mask, psi_bndry).

  • Jtor_part2 (callable) – Function that evaluates the toroidal current density jtor.

  • core_mask_limiter (callable) – Function that refines the core mask using limiter geometry.

  • R (np.ndarray) – Radial grid coordinates.

  • Z (np.ndarray) – Vertical grid coordinates.

  • psi (np.ndarray) – Poloidal flux on the grid.

  • psi_bndry (float or None) – Flux value at the last closed flux surface (LCFS), passed to Jtor_part1.

  • mask_outside_limiter (np.ndarray) – Boolean mask for points outside the limiter.

  • limiter_mask_out (np.ndarray) – Limiter boundary mask (including edge-adjacent region).

Returns:

  • jtor (np.ndarray) – Toroidal current density on the grid.

  • opt (np.ndarray) – O-point coordinates and flux value.

  • xpt (np.ndarray) – X-point coordinates and flux value.

  • psi_bndry (float) – Updated LCFS flux value.

  • diverted_core_mask (np.ndarray or None) – Core plasma mask from geometric reconstruction (None if no diverted core was found, i.e. a limiter plasma).

  • limiter_core_mask (np.ndarray) – Core mask refined with limiter constraints.

  • flag_limiter (bool) – True if the plasma is in a limiter (rather than diverted) configuration.

Jtor_refined(R: ndarray, Z: ndarray, psi: ndarray, psi_bndry: float | None = None, thresholds: tuple[float, float] | None = None) → ndarray[source]

Compute toroidal current density using subgrid refinement.

This method evaluates the unrefined current density first and then applies a subgrid refinement procedure in regions where higher resolution is required. The refinement is controlled by a threshold-based criterion acting on the current density and its gradients.

Parameters:
  • R (np.ndarray) – Radial grid coordinates.

  • Z (np.ndarray) – Vertical grid coordinates.

  • psi (np.ndarray) – Poloidal flux on the grid (typically ψ / 2π).

  • psi_bndry (float, optional) – Flux value at the last closed flux surface (LCFS). If None, it is determined internally.

  • thresholds (tuple of float, optional) – (jtor_threshold, gradient_threshold) controlling where refinement is applied. If None, the default self.refinement_thresholds is used.

Returns:

jtor – Refined toroidal current density on the computational grid.

Return type:

np.ndarray

Jtor_unrefined(R: ndarray, Z: ndarray, psi: ndarray, psi_bndry: float | None = None) → ndarray[source]

Compute the toroidal current density without subgrid refinement.

This method provides a direct replacement for the base profile current computation interface, using the internal Jtor pipeline but disabling any refined current reconstruction.

Parameters:
  • R (np.ndarray) – Radial grid coordinates.

  • Z (np.ndarray) – Vertical grid coordinates.

  • psi (np.ndarray) – Poloidal flux on the grid (Webers / 2π).

  • psi_bndry (float, optional) – Flux value at the last closed flux surface (LCFS). If None, it is determined internally.

Returns:

jtor – Toroidal current density on the computational grid.

Return type:

np.ndarray

__init__(refine_jtor: bool = False) → None[source]

Sets default unrefined Jtor.

Parameters:

refine_jtor (bool, optional) – If True, Jtor dispatches to the refined implementation.

copy(obj: Jtor_universal | None = None) → Jtor_universal[source]

Create a copy of the current Jtor_universal instance.

This method performs a selective copy of internal attributes, combining shallow copies, deep copies, and shared references depending on the nature of each attribute.

Parameters:

obj (Jtor_universal, optional) – Existing instance to copy attributes into. If None, a new instance of the same class is created.

Returns:

A copied instance of the current object.

Return type:

Jtor_universal

Notes

Copy semantics: - Immutable / scalar attributes are copied directly - Grid geometry and limiter masks are shared through limiter_handler - Selected complex objects are deep-copied (e.g. via copy.deepcopy) - Some large system objects are shared by reference (e.g. limiter_handler)

Optional attributes: The method safely ignores missing attributes using strict=False for certain fields.

Warning

This is not a full deep copy. Some internal objects are shared between the original and the copy, particularly: - limiter_handler - any attributes not explicitly copied via copy_into

diverted_critical(R: ndarray, Z: ndarray, psi: ndarray, psi_bndry: float | None = None, mask_outside_limiter: ndarray | None = None, rel_tolerance_xpt: float = 1e-10, starting_dx: float = 0.05) → tuple[ndarray, ndarray, ndarray, float][source]

Compute LCFS, O-point, X-point, and core mask using a contour-based fallback algorithm.

This method replaces the standard LCFS/X-point detection routine when it fails, providing a more robust (but more expensive) contour-tracking approach.

Parameters:
  • R (np.ndarray) – Radial grid coordinates.

  • Z (np.ndarray) – Vertical grid coordinates.

  • psi (np.ndarray) – Poloidal flux on the computational grid.

  • psi_bndry (float, optional) – Prescribed boundary flux value. If None, it is computed internally.

  • mask_outside_limiter (np.ndarray, optional) – Boolean mask identifying points outside the limiter.

  • rel_tolerance_xpt (float, optional) – Relative tolerance controlling convergence of X-point search.

  • starting_dx (float, optional) – Initial step size in normalized flux space for contour search.

Returns:

  • opt (np.ndarray, shape (1, 3)) – O-point coordinates and flux value [R, Z, psi].

  • xpt (np.ndarray, shape (1, 3)) – X-point coordinates and flux value [R, Z, psi].

  • diverted_core_mask (np.ndarray, shape (nx, ny)) – Boolean mask identifying plasma core region.

  • psi_bndry (float) – Flux value at the last closed flux surface (LCFS).

Raises:

ValueError – If there is no local maximum of the flux inside the limiter region, or if no closed flux contour encloses it.

diverted_critical_complete(R: ndarray, Z: ndarray, psi: ndarray, psi_bndry: float | None = None, mask_outside_limiter: ndarray | None = None, rel_tolerance_xpt: float = 0.0001, starting_dx: float = 0.05) → tuple[ndarray, ndarray, ndarray, float][source]

Robust LCFS, O-point, X-point, and core mask detection with fallback logic.

This method attempts to compute plasma boundary information using the primary routine Jtor_part1. If this fails (raises an exception), it falls back to a more robust but computationally expensive contour-based method implemented in diverted_critical.

Parameters:
  • R (np.ndarray) – Radial grid coordinates.

  • Z (np.ndarray) – Vertical grid coordinates.

  • psi (np.ndarray) – Poloidal flux on the computational grid.

  • psi_bndry (float, optional) – Prescribed boundary flux value. If None, it is computed internally.

  • mask_outside_limiter (np.ndarray, optional) – Boolean mask identifying points outside the limiter.

  • rel_tolerance_xpt (float, optional) – Convergence tolerance for X-point search in fallback method.

  • starting_dx (float, optional) – Initial step size for contour-based X-point search.

Returns:

  • opt (np.ndarray, shape (1, 3)) – O-point coordinates and flux value [R, Z, psi].

  • xpt (np.ndarray, shape (1, 3)) – X-point coordinates and flux value [R, Z, psi].

  • diverted_core_mask (np.ndarray) – Boolean mask of plasma core region.

  • psi_bndry (float) – Flux value at the last closed flux surface (LCFS).

select_refinement(eq: object, refine_jtor: bool, nnx: int | None, nny: int | None) → None[source]

Initialise optional subgrid refinement for toroidal current density (jtor).

This method enables and configures subgrid refinement of the plasma current density if requested, constructing the refinement handler and associated parameters.

Parameters:
  • eq (FreeGSNKE Equilibrium object) – Equilibrium object defining the computational domain and geometry.

  • refine_jtor (bool) – If True, enable subgrid refinement of the toroidal current density. If False, refinement is disabled.

  • nnx (int (even) or None) – Refinement factor in the R-direction (only used if refine_jtor is True).

  • nny (int (even) or None) – Refinement factor in the Z-direction (only used if refine_jtor is True).

set_masks(eq: object) → None[source]

Initialise grid geometry and limiter-related masks from an equilibrium object.

This method constructs and stores all spatial grid metadata, index mappings, and limiter masks required for subsequent calculations. It modifies the object in-place.

Parameters:

eq (FreeGSNKE Equilibrium object) – Equilibrium defining the computational domain, including 1D and 2D coordinate grids and limiter geometry.

Notes

Fixed grid arrays are shared with eq.limiter_handler and treated as read-only by profile calculations.

set_refinement_thresholds(thresholds: tuple[float, float] = (1.0, 1.0)) → None[source]

Set the criteria used to control jtor subgrid refinement.

These thresholds determine where refinement is applied based on the current density and its gradient.

Parameters:

thresholds (tuple of float, optional) – (jtor_threshold, gradient_threshold), where each value controls the activation of refinement criteria.

class freegsnke.jtor_update.Lao85(eq: object, *args: object, refine_jtor: bool = False, nnx: int | None = None, nny: int | None = None, **kwargs: object)[source]

Bases: Lao85, Jtor_universal

Lao 1985 constrained toroidal current profile with FreeGSNKE extensions.

Jtor(*args: object, **kwargs: object) → ndarray

Evaluate toroidal current density (Jtor), dispatching to either the refined or unrefined implementation.

This method acts as a unified interface: - If _refine_jtor is True, it calls Jtor_refined - Otherwise, it calls Jtor_unrefined

Parameters:
  • *args (object) – Positional arguments passed directly to the selected Jtor implementation.

  • **kwargs (object) – Keyword arguments passed directly to the selected Jtor implementation.

Returns:

Toroidal current density evaluated on the plasma grid.

Return type:

np.ndarray

Topeol_parameters(nn: int = 100, max_it: int = 100, tol: float = 1e-05) → ndarray[source]

Fit optimal Topeol profile parameters from target pprime and ffprime data.

This method determines the best-fitting parameters (alpha_m, alpha_n, beta_0) for a Topeol current profile by minimising a mismatch between the model and the target profile derivatives evaluated on a sampled normalized flux grid.

Parameters:
  • nn (int, optional) – Number of sampling points in the normalized flux interval (0, 1).

  • max_it (int, optional) – Maximum number of optimisation iterations.

  • tol (float, optional) – Convergence tolerance on parameter updates.

Returns:

pars – Optimised parameters (alpha_m, alpha_n, beta_0).

Return type:

np.ndarray, shape (3,)

__init__(eq: object, *args: object, refine_jtor: bool = False, nnx: int | None = None, nny: int | None = None, **kwargs: object) → None[source]

Initialise the Lao85 current profile.

Parameters:
  • eq (FreeGSNKE Equilibrium object) – Equilibrium object defining grid geometry and limiter structure.

  • *args (object) – Positional arguments passed to the parent profile constructor.

  • refine_jtor (bool, optional) – If True, enable subgrid refinement of the toroidal current density.

  • nnx (int or None, optional) – Refinement factor in the R-direction (must be even if used).

  • nny (int or None, optional) – Refinement factor in the Z-direction (must be even if used).

  • **kwargs (object) – Keyword arguments passed to the parent profile constructor.

copy() → Lao85[source]

Create a copy of the Lao85 profile instance.

Returns:

A copied instance with duplicated profile parameters and internal state (with controlled shallow/deep copying depending on attribute type).

Return type:

Lao85

class freegsnke.jtor_update.TensionSpline(eq: object, *args: object, **kwargs: object)[source]

Bases: TensionSpline, Jtor_universal

Tension spline constrained toroidal current profile with FreeGSNKE extensions.

Jtor(*args: object, **kwargs: object) → ndarray

Evaluate toroidal current density (Jtor), dispatching to either the refined or unrefined implementation.

This method acts as a unified interface: - If _refine_jtor is True, it calls Jtor_refined - Otherwise, it calls Jtor_unrefined

Parameters:
  • *args (object) – Positional arguments passed directly to the selected Jtor implementation.

  • **kwargs (object) – Keyword arguments passed directly to the selected Jtor implementation.

Returns:

Toroidal current density evaluated on the plasma grid.

Return type:

np.ndarray

__init__(eq: object, *args: object, **kwargs: object) → None[source]

Initialise the tension spline current profile.

Parameters:
  • eq (FreeGSNKE Equilibrium object) – Equilibrium object defining grid geometry and limiter structure.

  • *args (object) – Positional arguments passed to the parent profile constructor.

  • **kwargs (object) – Keyword arguments passed to the parent profile constructor.

assign_profile_parameter(pp_knots: ndarray, pp_values: ndarray, pp_values_2: ndarray, pp_sigma: ndarray, ffp_knots: ndarray, ffp_values: ndarray, ffp_values_2: ndarray, ffp_sigma: ndarray) → None[source]

Assign new spline parameters to the profile object.

Parameters:
  • pp_knots (np.ndarray) – Knot locations for pprime spline.

  • pp_values (np.ndarray) – Spline values for pprime.

  • pp_values_2 (np.ndarray) – Second derivative (or auxiliary) values for pprime spline.

  • pp_sigma (np.ndarray) – Regularisation / smoothing parameters for pprime spline.

  • ffp_knots (np.ndarray) – Knot locations for ffprime spline.

  • ffp_values (np.ndarray) – Spline values for ffprime.

  • ffp_values_2 (np.ndarray) – Second derivative (or auxiliary) values for ffprime spline.

  • ffp_sigma (np.ndarray) – Regularisation / smoothing parameters for ffprime spline.

copy() → TensionSpline[source]

Create a copy of the TensionSpline profile instance.

Returns:

A copied instance with all spline parameters duplicated and internal state consistently updated.

Return type:

TensionSpline