[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
8.21 Change data (MGL)
These commands 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 correspondingly.
- MGL command: integrate dat 'dir'
Integrates (like cumulative summation) the data in given direction or directions.
- MGL command: diff dat xdat ydat [zdat=0]
Differentiates the data dat specified parametrically in direction xdat with ydat, zdat=constant. Parameter zdat can be omitted that correspond to 2D case. 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 a x y
and usual derivative along ‘y’ will bediff a y x
.
- MGL command: diff2 dat 'dir'
Double-differentiates (like Laplace operator) the data in given direction.
- MGL command: sinfft dat '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'
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'
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'
Swaps the left and right part of the data in given direction (useful for Fourier spectrum).
- MGL command: roll dat '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'
Mirror the left-to-right part of the data in given direction. Looks like change the value index i->n-i.
- MGL command: sew dat ['dir'='xyz'
da=2*pi
] Remove value steps (like phase jumps after inverse trigonometric commands) with period da in given direction.
- MGL command: smooth data
type
['dir'='xyz'] Smooths the data on specified direction or directions by method Type. Now 4 methods are supported: ‘0’ does nothing, ‘1’ linear averaging by 3 points, ‘2’ linear averaging by 5 points, ‘3’ quadratic averaging by 5 points.
- MGL command: envelop dat ['dir'='x']
Find envelop for data values along direction dir. Only one direction can be specified at once.
- MGL command: normsl dat
v1 v2
['dir'='z'keep=on sym=off
] Normalizes data slice-by-slice along direction dir the data in slices to range [v1,v2]. If flag sym=
on
then symmetrical interval [-max(|v1|,|v2|), max(|v1|,|v2|)] is used. If keep is set then maximal value of k-th slice will be limited by \sqrt\sum a_ij(k)/\sum a_ij(0).
- MGL command: norm dat
v1 v2 [sym=off dim=0]
Normalizes the data to range [v1,v2]. If flag sym=
on
then symmetrical interval [-max(|v1|,|v2|), max(|v1|,|v2|)] is used. Modification will be applied only for slices >=dim.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |