manpagez: man pages & more
info mathgl_en
Home | html | info | man
 [ << ] [ < ] [ Up ] [ > ] [ >> ] [Top] [Contents] [Index] [ ? ]

## 6.7 Data changing

These functions change the data in some direction like differentiations, integrations and so on. The direction in which the change will applied is specified by the string parameter, which may contain ‘x’, ‘y’ or ‘z’ characters for 1-st, 2-nd and 3-d dimension correspondengly.

MGL command: cumsum dat 'dir'
Method on mglData: void CumSum (const char *dir)
C function: void mgl_data_cumsum (HMDT dat, const char *dir)

Cumulative summation of the data in given direction or directions.

MGL command: integrate dat 'dir'
Method on mglData: void Integral (const char *dir)
C function: void mgl_data_integral (HMDT dat, const char *dir)

Integrates (like cumulative summation) the data in given direction or directions.

MGL command: diff dat 'dir'
Method on mglData: void Diff (const char *dir)
C function: void mgl_data_diff (HMDT dat, const char *dir)

Differentiates the data in given direction or directions.

MGL command: diff dat xdat ydat [zdat=0]
Method on mglData: void Diff (const mglData &x, const mglData &y)
Method on mglData: void Diff (const mglData &x, const mglData &y, const mglData &z)
C function: void mgl_data_diff_par (HMDT dat, HCDT x, HCDTy, HCDTz)

Differentiates the data specified parametrically in direction x with y, z=constant. Parametrical differentiation uses the formula (for 2D case): da/dx = (a_j*y_i-a_i*y_j)/(x_j*y_i-x_i*y_j) where a_i=da/di, a_j=da/dj denotes usual differentiation along 1st and 2nd dimensions. The similar formula is used for 3D case. Note, that you may change the order of arguments – for example, if you have 2D data a(i,j) which depend on coordinates {x(i,j), y(i,j)} then usual derivative along ‘x’ will be Diff(x,y); and usual derivative along ‘y’ will be Diff(y,x);.

MGL command: diff2 dat 'dir'
Method on mglData: void Diff2 (const char *dir)
C function: void mgl_data_diff2 (const char *dir)

Double-differentiates (like Laplace operator) the data in given direction.

MGL command: sinfft dat 'dir'
Method on mglData: void SinFFT (const char *dir)
C function: void mgl_data_sinfft (HMDT dat, const char *dir)

Do Sine transform of the data in given direction or directions. The Sine transform is \sum a_i \sin(k i).

MGL command: cosfft dat 'dir'
Method on mglData: void CosFFT (const char *dir)
C function: void mgl_data_cosfft (HMDT dat, const char *dir)

Do Cosine transform of the data in given direction or directions. The Cosine transform is \sum a_i \cos(k i).

MGL command: hankel dat 'dir'
Method on mglData: void Hankel (const char *dir)
C function: void mgl_data_hankel (HMDT dat, const char *dir)

Do Hankel transform of the data in given direction or directions. The Hankel transform is \sum a_i J_0(k i).

MGL command: swap dat 'dir'
Method on mglData: void Swap (const char *dir)
C function: void mgl_data_swap (HMDT dat, const char *dir)

Swaps the left and right part of the data in given direction (useful for Fourier spectrum).

MGL command: roll dat 'dir' num
Method on mglData: void Roll (char dir, num)
C function: void mgl_data_roll (HMDT dat, char dir, num)

Rolls the data along direction dir. Resulting array will be out[i] = ini[(i+num)%nx] if dir='x'.

MGL command: mirror dat 'dir'
Method on mglData: void Mirror (const char *dir)
C function: void mgl_data_mirror (HMDT dat, const char *dir)

Mirror the left-to-right part of the data in given direction. Looks like change the value index i->n-i. Note, that the similar effect in graphics you can reach by using options (see section Command options), for example, surf dat; xrange 1 -1.

MGL command: sew dat ['dir'='xyz' da=2*pi]
Method on mglData: void Sew (const char *dir, float da=2*M_PI)
C function: void mgl_data_sew (HMDT dat, const char *dir, float da)

Remove value steps (like phase jumps after inverse trigonometric functions) with period da in given direction.

MGL command: smooth data type ['dir'='xyz']
Method on mglData: void Smooth (const char *dir="xyz", float delta=0)
C function: void mgl_data_smooth (HMDT dat, const char *dir, float delta)

Smooths the data on specified direction or directions. String dirs specifies the dimensions which will be smoothed. It may contain characters: ‘x’ for 1st dimension, ‘y’ for 2nd dimension, ‘z’ for 3d dimension. If string dir contain: ‘0’ then does nothing, ‘3’ – linear averaging over 3 points, ‘5’ – linear averaging over 5 points. By default quadratic averaging over 5 points is used.

MGL command: envelop dat ['dir'='x']
Method on mglData: void Envelop (char dir='x')
C function: void mgl_data_envelop (HMDT dat, char dir)

Find envelop for data values along direction dir.

MGL command: norm dat v1 v2 [sym=off dim=0]
Method on mglData: void Norm (float v1=0, float v2=1, bool sym=false, int dim=0)

Normalizes the data to range [v1,v2]. If flag sym=true then symmetrical interval [-max(|v1|,|v2|), max(|v1|,|v2|)] is used. Modification will be applied only for slices >=dim.

MGL command: normsl dat v1 v2 ['dir'='z' keep=on sym=off]
Method on mglData: void NormSl (float v1=0, float v2=1, char dir='z', bool keep_en=true, bool sym=false)
C function: void mgl_data_norm_slice (HMDT dat, float v1, float v2, char dir, int keep_en, int sym)

Normalizes data slice-by-slice along direction dir the data in slices to range [v1,v2]. If flag sym=true then symmetrical interval [-max(|v1|,|v2|), max(|v1|,|v2|)] is used. If keep_en is set then maximal value of k-th slice will be limited by \sqrt{\sum a_ij(k)/\sum a_ij(0)}.

 [ << ] [ < ] [ Up ] [ > ] [ >> ] [Top] [Contents] [Index] [ ? ]

This document was generated on April 13, 2012 using texi2html 5.0.

© manpagez.com 2000-2018