shareloc.math_utils

This module contains the mathematical functions for shareloc

Module Contents

Functions

inter(mats, delta_shift_col, delta_shift_row, ...)

Shared computation part for interpolation

interpol_bilin_grid(mats, nb_rows, nb_cols, ...)

bilinear interpolation on multi layer matrix

interpol_bilin(mat, nb_rows, nb_cols, delta_shift_row, ...)

bilinear interpolation on multi layer matrix

interpol_bilin_vectorized(mats, nb_rows, nb_cols, ...)

bilinear interpolation on multi points and layer matrix

shareloc.math_utils.inter(mats, delta_shift_col, delta_shift_row, lower_shift_col, lower_shift_row)[source]

Shared computation part for interpolation

Parameters:
  • mats (list) – multi layer grid (: , nb_rows,nb_cols)

  • delta_shift_col (float) – position (columns)

  • delta_shift_row (float) – position (line)

  • lower_shift_col (int) – lower integer position (columns)

  • lower_shift_row (int) – lower integer position (line)

Return type:

list

shareloc.math_utils.interpol_bilin_grid(mats, nb_rows, nb_cols, delta_shift_row, delta_shift_col)[source]

bilinear interpolation on multi layer matrix :param mats: multi layer grid (: , nb_rows,nb_cols) :type mats: list :param nb_rows: line number of mats :type nb_rows: int :param nb_cols: column number of mats :type nb_cols: int :param delta_shift_row: position (line) :type nb_cols: float :param delta_shift_col: position (column) :type nb_cols: float :return interpolated value on each layer :rtype list

Parameters:
  • mats (list) –

  • nb_rows (int) –

  • nb_cols (int) –

  • delta_shift_row (float) –

  • delta_shift_col (float) –

Return type:

list

shareloc.math_utils.interpol_bilin(mat, nb_rows, nb_cols, delta_shift_row, delta_shift_col)[source]

bilinear interpolation on multi layer matrix :param mat: multi layer grid (nb_rows,nb_cols, :) :type mat: np.ndarray :param nb_rows: line number of mats :type nb_rows: int :param nb_cols: column number of mats :type nb_cols: int :param delta_shift_row: position (line) :type nb_cols: float :param delta_shift_col: position (column) :type nb_cols: float :return interpolated value on each layer :rtype: float

Parameters:
  • mat (numpy.ndarray) –

  • nb_rows (int) –

  • nb_cols (int) –

  • delta_shift_row (float) –

  • delta_shift_col (float) –

Return type:

float

shareloc.math_utils.interpol_bilin_vectorized(mats, nb_rows, nb_cols, delta_shift_row, delta_shift_col)[source]

bilinear interpolation on multi points and layer matrix :param mats: multi layer grid (: , nb_rows,nb_cols) :type mats: list :param nb_rows: line number of mats :type nb_rows: int :param nb_cols: column number of mats :type nb_cols: int :param delta_shift_row: position (line) :type nb_cols: float :param delta_shift_col: position (column) :type nb_cols: float :return interpolated value on each layer :rtype list

Parameters:
  • mats (list) –

  • nb_rows (int) –

  • nb_cols (int) –

  • delta_shift_row (float) –

  • delta_shift_col (float) –

Return type:

list