pysrw.lib.uti_math#
Functions
|
Finds array (or list) maximum (or minimum), index and value :param _ar: array (or list) to find max. |
|
The function searches x-values (roots) where y=0 (after normalization to values between 0 and 1 and shifting the values down by 0.5 (default value)) based on linear interpolation, and calculates full width at half maximum (FWHM). |
|
Select point using a normal (Gaussian) distribution |
|
elect point using a Flory–Schulz distribution |
|
Select point using a uniform distribution |
|
Integrates 2d array (or list) within given limits :param _ar: input array to integrate :param _ar_align: input array alignment (1- _ar is 1d array with C-type data alignment, 2- _ar is 2d array) :param _x_grid: list/array specifying grid vs one dimensions (_x_grid[0] is start, _x_grid[1] is end, _x_grid[2] is number of points) :param _y_grid: list/array specifying grid vs another dimensions (_y_grid[0] is start, _y_grid[1] is end, _y_grid[2] is number of points) :param _x_lim: list/array specifying inegration limits vs one dimensions (_x_lim[0] is start, _x_lim[1] is end) :param _y_lim: list/array specifying inegration limits vs another dimensions (_y_lim[0] is start, _y_lim[1] is end) |
|
Integrates array (or list), eventually making a copy of it before the integration :param _ar: array to integrate :param _h: step size :param _dupl: duplicate the magnetic field object or not |
|
Interpolate 1D function value tabulated on equidistant mesh, using polynomial interpolation :param _x: argument at which function value should be calculated :param _x_min: minimal argument value of the tabulated function :param _x_step: step of mesh at which function is tabulated :param _nx: number of points in mesh at which function is tabulated :param _ar_f: tabulated function list or array :param _ord: order of polynomial interpolation (1- linear, 2- quadratic, 3- cubic) :param _ix_per: argument index period of function data alignment (e.g. to interpolate one component of complex data, or in one dimension of multi-dimensional data) :param _ix_ofst: argument index offset of function data alignment :return: function value found by polynomial interpolation. |
|
Interpolate linearly 1D function value tabulated on non-equidistant (irregular) mesh :param _x: argument at which function value should be calculated :param _ar_x: array or list of increasing argument values, at which the function is tabulated :param _ar_f: array or list of tabulated values corresponding to arguments in _ar_x :param _ord: order of polynomial interpolation (1- linear, 2- quadratic, 3- cubic) :return: function value found by polynomial interpolation |
|
Interpolate 2D function value tabulated on equidistant rectangular mesh and represented by C-aligned flat array, using polynomial interpolation :param _x: first argument at which function value should be calculated :param _y: second argument at which function value should be calculated :param _x_min: minimal value of the first argument of the tabulated function :param _x_step: step of the first argument at which function is tabulated :param _nx: number of points vs first argument at which function is tabulated :param _y_min: minimal value of the second argument of the tabulated function :param _y_step: step of the second argument at which function is tabulated :param _ny: number of points vs second argument at which function is tabulated :param _ar_f: function tabulated on 2D mesh, aligned as "flat" C-type list or array (first argument is changing most frequently) :param _ord: "order" of polynomial interpolation (1- bi-linear (on 4 points), 2- "bi-quadratic" (on 6 points), 3- "bi-cubic" (on 12 points)) :param _ix_per: period of first argument index of the function data alignment (e.g. to interpolate one component of complex data, or in one dimension of multi-dimensional data) :param _ix_ofst: offset of the first argument index in function data alignment :return: function value found by 2D polynomial interpolation. |
|
|
|
|
|
|
|
|
|
Prints matrix _A |
|
Multiplies matrix _A by matrix or by vector _B |
|
Returns transposed matrix |
|
|
|
Sets up matrix and vector describing rotation about axis _V passing through a point _P about an angle _ang :param _V: vector (array of 3 Cartesian coordinates) defining rotation axis :param _ang: rotation angle [rad] :param _P: point (array of 3 Cartesian coordinates) rotation axis passes through :returns list containing the 3x3 matrix and 3-element vector |
|
Returns vector product of 3d vectors V1 and V2 |
|
Multiplies vector _V (in place) by number _a |
|
Returns vector norm (/length) |
|
Normalizes vector (in place, i.e. without creating new vector). |
|
Returns scalar product of vectors V1 and V2 |