You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When new interpolators are added to Raysect (see raysect/source#393), they should replace the existing Cherab interpolators in the Cherab code. This will solve #233 and slightly improve overall performance.
Here are the classes, functions and demo scripts that need to be updated:
Also the mappers IsoMapper2D and IsoMapper3D refer to Interpolate1DCubic in their docstrings.
The new Raysect interpolators lack the following features of Cherab interpolators:
A. Optional support for length 1 arrays.
B. Quadratic extrapolation for cubic splines in 2D and 3D cases.
C. Continuity of second derivative in 1D cubic spline (default option in Interpolate1DCubic).
Also cubic splines in Raysect and Cherab interpolate data at edge intervals differently (quadratic in Cherab vs cubic in Raysect).
Feature A is used in the items 2 - 5.
Feature B is used in the items 3 - 13.
Feature C is used in the items 2 - 5, 14, 21 - 23.
I suggest the following solution:
Check for length 1 arrays in the items 2 - 5 explicitly and use Constant1D in 1D case and custom function wrappers in 2D case.
Drop feature C. It should be used with caution anyway in case of sharp features in the data arrays.
Should we add deprecation warnings to Cherab interpolators?
Also replacing the Cherab cubic interpolators with the Raysect ones in the item 23 causes lsq_linear() to freeze in cherab.tools.plasmas.ionisation_balance_fractional_abundance_point(). This does not happen with Cherab interpolators even if continuity_order is set to 1. Switching to linear interpolation for 1D data in the item 23 solves the problem.
I'll create a draft pull request with the changes I've already made to test the new Raysect interpolators.
When new interpolators are added to Raysect (see raysect/source#393), they should replace the existing Cherab interpolators in the Cherab code. This will solve #233 and slightly improve overall performance.
Here are the classes, functions and demo scripts that need to be updated:
cherab.core.model.attenuator.SingleRayAttenuatorcherab.openadas.rates.cx.BeamCXPECcherab.openadas.rates.beam.BeamStoppingRatecherab.openadas.rates.beam.BeamPopulationRatecherab.openadas.rates.beam.BeamEmissionPECcherab.openadas.rates.pec.ImpactExcitationPECcherab.openadas.rates.pec.RecombinationPECcherab.openadas.rates.atomic.IonisationRatecherab.openadas.rates.atomic.RecombinationRatecherab.openadas.rates.atomic.ThermalCXRatecherab.openadas.rates.radiated_power.LineRadiationPowercherab.openadas.rates.radiated_power.ContinuumPowercherab.openadas.rates.radiated_power.CXRadiationPowercherab.tools.equilibrium.efit.EFITEquilibriumcherab.tools.plasmas.ionisation_balance.interpolators1d_fractional()cherab.tools.plasmas.ionisation_balance.interpolators2d_fractional()cherab.tools.plasmas.ionisation_balance.interpolators1d_from_elementdensity()cherab.tools.plasmas.ionisation_balance.interpolators1d_match_plasma_neutrality()cherab.tools.plasmas.ionisation_balance.interpolators2d_from_elementdensity()cherab.tools.plasmas.ionisation_balance.interpolators2d_match_plasma_neutrality()demos/equilibrium/equilibrium.pydemos/plasmas/ionisation_balance_1d.pydemos/plasmas/ionisation_balance_2d.pyAlso the mappers
IsoMapper2DandIsoMapper3Drefer toInterpolate1DCubicin their docstrings.The new Raysect interpolators lack the following features of Cherab interpolators:
A. Optional support for length 1 arrays.
B. Quadratic extrapolation for cubic splines in 2D and 3D cases.
C. Continuity of second derivative in 1D cubic spline (default option in
Interpolate1DCubic).Also cubic splines in Raysect and Cherab interpolate data at edge intervals differently (quadratic in Cherab vs cubic in Raysect).
Feature A is used in the items 2 - 5.
Feature B is used in the items 3 - 13.
Feature C is used in the items 2 - 5, 14, 21 - 23.
I suggest the following solution:
Constant1Din 1D case and custom function wrappers in 2D case.Should we add deprecation warnings to Cherab interpolators?
Also replacing the Cherab cubic interpolators with the Raysect ones in the item 23 causes
lsq_linear()to freeze incherab.tools.plasmas.ionisation_balance_fractional_abundance_point(). This does not happen with Cherab interpolators even ifcontinuity_orderis set to 1. Switching to linear interpolation for 1D data in the item 23 solves the problem.I'll create a draft pull request with the changes I've already made to test the new Raysect interpolators.