| [ << ] | [ < ] | [ 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 correspondingly.
- MGL command: cumsum dat 'dir'
- Method on
mglData:voidCumSum (const char *dir) - Method on
mglDataC:voidCumSum (const char *dir) - C function:
voidmgl_data_cumsum (HMDTdat,const char *dir) - C function:
voidmgl_datac_cumsum (HADTdat,const char *dir) Cumulative summation of the data in given direction or directions.
- MGL command: integrate dat 'dir'
- Method on
mglData:voidIntegral (const char *dir) - Method on
mglDataC:voidIntegral (const char *dir) - C function:
voidmgl_data_integral (HMDTdat,const char *dir) - C function:
voidmgl_datac_integral (HADTdat,const char *dir) Integrates (like cumulative summation) the data in given direction or directions.
- MGL command: diff dat 'dir'
- Method on
mglData:voidDiff (const char *dir) - Method on
mglDataC:voidDiff (const char *dir) - C function:
voidmgl_data_diff (HMDTdat,const char *dir) - C function:
voidmgl_datac_diff (HADTdat,const char *dir) Differentiates the data in given direction or directions.
- MGL command: diff dat xdat ydat [zdat=0]
- Method on
mglData:voidDiff (const mglDataA &x,const mglDataA &y) - Method on
mglData:voidDiff (const mglDataA &x,const mglDataA &y,const mglDataA &z) - C function:
voidmgl_data_diff_par (HMDTdat,HCDTx,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 beDiff(y,x);.
- MGL command: diff2 dat 'dir'
- Method on
mglData:voidDiff2 (const char *dir) - Method on
mglDataC:voidDiff2 (const char *dir) - C function:
voidmgl_data_diff2 (HMDTdat,const char *dir) - C function:
voidmgl_datac_diff2 (HADTdat,const char *dir) Double-differentiates (like Laplace operator) the data in given direction.
- MGL command: sinfft dat 'dir'
- Method on
mglData:voidSinFFT (const char *dir) - C function:
voidmgl_data_sinfft (HMDTdat,const char *dir) Do Sine transform of the data in given direction or directions. The Sine transform is \sum a_j \sin(k j) (see http://en.wikipedia.org/wiki/Discrete_sine_transform#DST-I).
- MGL command: cosfft dat 'dir'
- Method on
mglData:voidCosFFT (const char *dir) - C function:
voidmgl_data_cosfft (HMDTdat,const char *dir) Do Cosine transform of the data in given direction or directions. The Cosine transform is \sum a_j \cos(k j) (see http://en.wikipedia.org/wiki/Discrete_cosine_transform#DCT-I).
- Method on
mglDataC:voidFFT (const char *dir) - C function:
voidmgl_datac_fft (HADTdat,const char *dir) Do Fourier transform of the data in given direction or directions. If dir contain ‘i’ then inverse Fourier is used. The Fourier transform is \sum a_j \exp(i k j) (see http://en.wikipedia.org/wiki/Discrete_Fourier_transform).
- MGL command: hankel dat 'dir'
- Method on
mglData:voidHankel (const char *dir) - Method on
mglDataC:voidHankel (const char *dir) - C function:
voidmgl_data_hankel (HMDTdat,const char *dir) - C function:
voidmgl_datac_hankel (HADTdat,const char *dir) Do Hankel transform of the data in given direction or directions. The Hankel transform is \sum a_j J_0(k j) (see http://en.wikipedia.org/wiki/Hankel_transform).
- MGL command: swap dat 'dir'
- Method on
mglData:voidSwap (const char *dir) - Method on
mglDataC:voidSwap (const char *dir) - C function:
voidmgl_data_swap (HMDTdat,const char *dir) - C function:
voidmgl_datac_swap (HADTdat,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:voidRoll (chardir,num) - Method on
mglDataC:voidRoll (chardir,num) - C function:
voidmgl_data_roll (HMDTdat,chardir,num) - C function:
voidmgl_datac_roll (HADTdat,chardir,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:voidMirror (const char *dir) - Method on
mglDataC:voidMirror (const char *dir) - C function:
voidmgl_data_mirror (HMDTdat,const char *dir) - C function:
voidmgl_datac_mirror (HADTdat,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:voidSew (const char *dir,mrealda=2*M_PI) - C function:
voidmgl_data_sew (HMDTdat,const char *dir,mrealda) 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:voidSmooth (const char *dir="xyz",mrealdelta=0) - Method on
mglDataC:voidSmooth (const char *dir="xyz",mrealdelta=0) - C function:
voidmgl_data_smooth (HMDTdat,const char *dir,mrealdelta) - C function:
voidmgl_datac_smooth (HADTdat,const char *dir,mrealdelta) 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:voidEnvelop (chardir='x') - C function:
voidmgl_data_envelop (HMDTdat,chardir) Find envelop for data values along direction dir.
- MGL command: norm dat
v1 v2 [sym=off dim=0] - Method on
mglData:voidNorm (mrealv1=0,mrealv2=1,boolsym=false,intdim=0) Normalizes the data to range [v1,v2]. If flag sym=
truethen 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:voidNormSl (mrealv1=0,mrealv2=1,chardir='z',boolkeep_en=true,boolsym=false) - C function:
voidmgl_data_norm_slice (HMDTdat,mrealv1,mrealv2,chardir,intkeep_en,intsym) Normalizes data slice-by-slice along direction dir the data in slices to range [v1,v2]. If flag sym=
truethen 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 March 21, 2014 using texi2html 5.0.
