jesterTOV.utils module#

Utility functions and constants for neutron star physics calculations.

Interpolation and Numerical Functions#

cubic_spline(xq, xp, fp)

Cubic spline interpolation using interpax.

interp_in_logspace(x, xs, ys)

Perform logarithmic interpolation.

cumtrapz(y, x)

Cumulatively integrate y(x) using the composite trapezoidal rule.

sigmoid(x)

Sigmoid activation function.

Physics Calculations#

cubic_root_for_proton_fraction(coefficients)

Vectorized version of cubic_root_for_proton_fraction.

calculate_rest_mass_density(e, p)

Compute rest-mass density from energy density and pressure.

locate_lowest_non_causal_point(cs2)

Find the first point where the equation of state becomes non-causal.

limit_by_MTOV(pc, m, r, l)

Truncate neutron star family at maximum TOV mass.