pytmosph3r.util.math

Module Contents

nmin(x, y)[source]
nmax(x, y)[source]
nround(x, y)[source]
interp1d(xx, yy, xkind='linear', ykind='linear', **kwargs)[source]
bilinear_interpolation_array(z00, z10, z01, z11, x, y, res)[source]

2D interpolation Applies linear interpolation across x and y between xmin,xmax and ymin,ymax. x, y and z must be 1D-arrays of the same length.

Parameters:
  • z00 (array) – Array corresponding to xmin,ymin

  • z10 (array) – Array corresponding to xmax,ymin

  • z01 (array) – Array corresponding to xmin,ymax

  • z11 (array) – Array corresponding to xmax,ymax

  • x (array) – weights on x coord

  • y (array) – weights on y coord

interp_ind_weights(x_to_interp, x_grid)[source]

Finds the indices and weights to interpolate from a x_grid to a x_to_interp.

roots(a, b, c)[source]

Find roots of a polynomial, i.e., find x for \(ax^2 + bx + c = 0\).