Matematické rutiny a algoritmy IDL v5.3
Následuje stručný přehled procedur a funkcí IDL pro
zpracování dat, seřazených dle kategorie jejich použití.
Distribuce IDL obsahuje celý soubor matematických rutin a
numerických algoritmů nutných pro základní typy zpracování
dat. Algoritmy jsous vesměs převzaty z Numerical
Recipes in C: The Art of Scientific Computing (Second Edition).
Podrobný popis následujících rutin viz online help
a manuály IDL (Reference Guide).
Testování statusu matematických chyb
a strojových charakteristik (přesnost výpočtu).
- CHECK_MATH Return and clear
accumulated math error status.
- FINITE Returns TRUE if argument is
finite.
- MACHAR Returns machine-specific
parameters that affect floating-point arithmetics.
Různé speciální funkce.
- ABS, ROUND, FLOOR, CEIL - absolutní
hodnota, zaokrohlení, celá část
- CONJ, COMPLEXROUND - komplexně
sdružené hodnoty, zaokrohlení reálné a imaginární
části komplexního čísla
- SIN, COS, SINH, COSH, ASIN, ACOS,
TAN, TANH, ATAN - goniometrické, hyperbolické a k nim
inverzní funkce
- SQRT, ALOG, ALOG10, EXP - odmocnina,
přirozený, desítkový logaritmus, exponenciála
- EXPINT, ERRORF- En(x), erf(x)
- FACTORIAL - faktoriál nebo jeho
Stirlingova aproximace
- BESSELI, BESSELJ, BESSELK -
Besselovy funkce
- BETA, GAMMA, IBETA, IGAMMA, LNGAMMA
- úplné a neúplné Beta a Gama funkce, logaritmus Gama
funkce
- POLY - počítá hodnoty polynomiální
funkce zadané koeficienty
- PRIMES - hledá prvních K prvočísel
- VOIGT - profil intenzity atomové
absorpční čáry (VOIGT profile)
Základní práce s poli a obrazy - vytváření
polí:
- BYTARR, COMPLEXARR, DBLARR,
DCOMPLEXARR, FLTARR, INTARR, LON64ARR, LONARR, UINTARR,
ULON64ARR, ULONARR - vytváření polí nulových prvků
v různých datových typech
- OBJARR, PTRARR - vytváření polí
prázdných objektů a ukazatelů
- STRARR - vytváření polí prázdných
řetězců
- MAKE_ARRAY - univerzální rutina
pro vytvoření pole prvků požadovaného typu a počtu
dimenzí
- REPLICATE - vytvoření pole prvků
replikací hodnoty potřebného typu
- BINDGEN, CINDGEN, DINDGEN, DCINDGEN,
FINDGEN, INDGEN, L64INDGEN, LINDGEN, UINDGEN, UL64INDGEN,
ULINDGEN, SINDGEN - vytváření polí se vzestupně číslovanými
prvky v různých datových typech (hodnota prvku je
rovna jeho jednodimensionálnímu indexu)
- IDENTITY - jednotkové matice
- DIST - 2D pole, hodnoty prvků úměrné
frekvenci (vzdálenosti od nejbližšího rohu)
Manipulace s poli:
- INVERT - inverze čtvercové matice
(pole)
- REFORM - změna počtu a velikosti
dimenzí pole beze změny jeho obsahu (hodnot prvků)
- REVERSE - změna pořadí prvků
vektoru nebo pole
- ROTATE - rotace prvků 2D pole o 0°,
90°, 180°, 270° s možnou transpozicí
- ROT - rotace obrazu (2D pole) o
libovolný úhel (výpočet nových prvků interpolací)
- SHIFT - posun prvků pole
- SORT - setřídění prvků pole
dle velikosti s návratem odpovídajícího pole indexů
- TRANSPOSE - transpozice pole
- CROSSP - vektorový součin tříprvkových
vektorů
Další rutiny pro práci s poli a
obrazy:
- MIN, MAX - nalezení nejmenšího a
největšího prvku pole
- MEDIAN - nalezení mediánu pole
nebo mediánový filtr
- SIZE - údaje o velikosti a typu
pole
- UNIQ - indexy jedinečných prvků
pole
- WHERE - nalezení indexů nenulových
prvků pole
- REPLICATE_INPLACE - nahrazuje prvky
vybrané části pole určitou hodnotou
- BLAS_AXPY - přičítá ke stávajícímu
poli nebo jeho části násobek jiného pole
- VALUE_LOCATE - hledá intervaly v
daném monotoním vektoru, které ohraničují vyhledávané
hodnoty
Změna velikosti pole:
- REFORM - změna počtu a velikosti
dimenzí pole beze změny jeho obsahu (hodnot prvků)
- TOTAL - částečný nebo úplný
součet prvků pole
- CONGRID - změna velikosti pole (obrazu)
- REBIN - změna velikosti pole (obrazu)
v celočíselných násobcích
- EXPAND - změna velikosti pole (obrazu)
Přehled metod změny velikosti pole (obrazu) |
funkce |
zvětšení pole |
zmenšení pole |
pozn. |
REBIN( ) |
bilineární interpolace |
průměr z okolí bodu |
1-8D pole, jen celočíselné násobky/podíly
velikosti původní a nové dimenze |
REBIN(/SAMPLE) |
vzorkování nejbližších sousedů |
vzorkování nejbližších sousedů |
1-8D pole, jen celočíselné násobky/podíly
velikosti původní a nové dimenze |
CONGRID( ) |
vzorkování nejbližších
sousedů (1D, 2D)
lineární interpolace (3D) |
1D, 2D, 3D pole |
CONGRID(CUBIC=x) |
interpolace parametrickou
kubickou konvolucí |
1D, 2D pole |
CONGRID(/INTERP) |
lineární interpolace |
1D, 2D, 3D pole |
EXPAND( ) |
bilineární interpolace |
bilineární interpolace |
jen 2D pole |
|
Generování pseudonáhodných čísel a
rozdělení. Výpočty pravděpodobnosti.
- RANDOMN The Box-Muller method for
generating normally-distributed (Gaussian) random numbers.
- RANDOMU Returns one or more
uniformly-distributed, floating-point, (also binomial,
gamma, normal, Poisson distribution) pseudo-random
numbers .
- BINOMIAL, CHISQR_PDF, T_PDF, F_PDF,
GAUSS_PDF - pravděpodobnost P(X>V) pro náhodnou veličinu
X s kumulativním binomickým, chí-kvadrát, Studentovým,
F a normálním Gaussovým rozdělením
- CHISQR_TCF, T_CVF, F_TCV, GAUSS_TCV
- určení hraniční hodnoty V, kde P(X>V)=p pro náhodnou
veličinu X s chí-kvadrát, Studentovým, F a normálním
Gaussovým rozdělením
Výpočty korelací.
- A_CORRELATE Compute the
autocorrelation or autocovariance of a sample population
as a function of the lag.
- C_CORRELATE Compute the cross-correlation
or cross-covariance of a sample population as a function
of the lag.
- CORRELATE Compute the linear
correlation coefficient.
- M_CORRELATE Compute the multiple
correlation coefficient.
- P_CORRELATE Compute the partial
correlation coefficient.
- R_CORRELATE Compute the rank
correlation of two populations.
- RANK Compute the magnitude-based
ranks of a sample population X.
Prokládání křivek a ploch.
- COMFIT Gradient-expansion least
squares fit to paired data.
- CRVLENGTH Compute the length of a
curve with tabular representation.
- CURVEFIT Non-linear least squares
fit to a function.
- GAUSSFIT Fit sum of a gaussian and
a quadratic.
- LADFIT Least absolute deviation fit
to paired data.
- LINFIT Minimal Chi-square fit to
paired data.
- POLY_FIT Polynomial least squares
fit.
- POLYFITW Weighted polynomial least
squares fit.
- REGRESS Multiple linear regression.
- SFIT Determine a polynomial fit to
a surface.
- SVDFIT General least squares fit
using SVD.
Hledání vlastních čísel a vlastních
vektorů matic.
- EIGENQL Compute eigenvectors of a
real, symmetric array, given the array.
- EIGENVEC Compute eigenvectors of a
real, nonsymmetric array, given the array and its
eigenvalues.
- ELMHES Reduce a real, nonsymmetric
array to upper-Hessenberg form.
- HQR Compute the eigenvalues of an
upper-Hessenberg array.
- TRIQL Compute eigenvalues and
eigenvectors of a real, symmetric, tridiagonal array.
- TRIRED Use Householder’s method
to reduce a real, symmetric array to tridiagonal form.
Interpolace, změna mříže nezávislých
hodnot.
- BILINEAR Bilinear interpolation.
- GRID3 Smooth fit to a set of 3D
scattered nodes.
- INTERPOL Linear interpolation of
vectors.
- INTERPOLATE Compute linear,
bilinear, or trilinear interpolates.
- KRIG2D Interpolate regularly or
irregularly gridded points using kriging.
- MIN_CURVE_SURF Interpolate
regularly or irregularly gridded points using minimum
curvature spline surface.
- POLAR_SURFACE Interpolate a surface
from polar coordinates to rectangular coordinates.
- SPH_CUT Spherical gridding.
Scattered samples on the surface of a sphere are
interpolated to a regular grid.
- SPL_INIT Establish interpolating
spline for a data set (use with SPL_INTERP).
- SPL_INTERP Compute cubic-spline
interpolated values (use with SPL_INIT).
- SPLINE Cubic spline interpolation.
- SPLINE_P Parametric cubic spline
interpolation.
- TRIANGULATE Construct a Delaunay
triangulation of a planar set of points. With TRIGRID,
this procedure can interpolate irregularly-gridded data
to a regular grid.
- TRIGRID Compute a regular grid of
interpolated values.
- TRI_SURF Compute a regularly- or
irregularly-gridded set of points with a smooth quintic
surface.
- VORONOI Compute the Voronoi polygon
of a point.
- WARP_TRI Image array with a
specified geometric correction applied.
Statistické výpočty.
- HISTOGRAM - histogram, hustotní
funkce
- HIST_2D - bivarietní histogram
- MOMENT - Computes the mean,
variance, skewness, and kurtosis, mean absolute and
standard deviation of a sample population contained in an
n-element vector X.
- MAX, MIN - minimum a maximum
vektoru
- MEAN, VARIANCE, SKEWNESS, KURTOSIS
- STDDEV, MEANABSDEV - standardní
odchylka od průměru, střední absolutní odchylka od
průměru nebo mediánu
- MEDIAN - medián vektoru
Statistické testování hypotéz o
vztahu a vlastnostech souborů dat.
- CTI_TEST Construct contingency
table from observed frequency data.
- FV_TEST Compute the F-statistic for
two sample populations.
- KW_TEST Test the hypothesis that
three or more sample populations have the same mean of
distribution.
- LNP_TEST Compute the Lomb
Normalized Periodogram of two sample populations.
- MD_TEST Test the hypothesis that a
sample population is random.
- R_CORRELATE Compute the rank
correlation of two sample populations.
- R_TEST Test the hypothesis that a
binary population is random.
- RS_TEST Test the hypothesis that
two sample populations have the same mean of distribution.
- S_TEST Test the hypothesis that two
sample populations have the same mean of distribution.
- TM_TEST Compute the student’s t-statistic
for two sample populations.
- XSQ_TEST Compute the Chi-square
goodness-of-fit between observed and expected frequencies.
Algoritmy pro numerickou derivaci.
- DERIV Performs numerical
differentiation using 3-point, Lagrangian interpolation
and returns the derivative.
- DERIVSIG Computes the standard
deviation of a derivative as found by the DERIV function,
using the input variables of DERIV and the standard
deviations of those input variables.
Numerická integrace funkcí a tabelovaných
dat.
- CRVLENGTH Compute the length of a
curve with tabular representation.
- INT_2D Evaluate the double integral
of a bivariate function f(x, y).
- INT_3D Evaluate the triple integral
of a trivariate function f(x, y, z).
- INT_TABULATED Integrate a tabulated
data set { x i , y i = f (x i ) }.
- QROMB Evaluate integral over a
closed interval using Romberg’s method.
- QROMO Evaluate integral over an
open interval using a modified Romberg’s method.
- QSIMP Evaluate integral over a
closed interval using Simpson’s method.
Řešení soustav lineárních rovnic včetně
přeurčených a nedourčených soustav.
- CHOLDC Construct the Cholesky
decomposition of an array.
- CHOLSOL Solve sets of linear
equations (use with CHOLDC).
- COND Compute the condition number
of a square array.
- CRAMER Solve a linear system using
Cramer’s rule.
- DETERM Compute the determinant of a
square array.
- GS_ITER Solve a linear system using
Gauss-Seidel iteration.
- IDENTITY Create an identity array.
- INVERT Invert a square array.
- LU_COMPLEX Solve a complex linear
system or invert a complex array.
- LUDC Construct the LU Decomposition
of an array.
- LUMPROVE Iteratively improve the
solution vector of a set of linear equations.
- LUSOL Solve sets of linear
equations (use with LUDC).
- NORM Compute the infinity norm of a
square array or the Euclidean norm of a vector.
- SVDC Construct the Singular Value
Decomposition of an array.
- SVSOL Use back-substitution to
solve a set of simultaneous linear equations (use with
SVDC).
- TRACE Compute the trace of an array.
- TRISOL Solve a tridiagonal system
of linear equations.
Řešení nelineárních rovnic.
- BROYDEN Solve sets of non-linear
equations using a globally-convergent Broyden’s method.
- FX_ROOT Compute the real and
complex roots of a univariate non-linear function using Müller’s
method.
- FZ_ROOTS Compute the roots of a
complex polynomial.
- NEWTON Solve sets of non-linear
equations using a globally-convergent Newton’s method.
Optimalizační problémy.
- AMOEBA Multidimensional
minimization of a user supplied function using the
downhill simplex method.
- CONSTRAINED_MIN Solves nonlinear
optimization problems.
- DFPMIN Davidon-Fletcher-Powell
minimization of a user supplied function.
- POWELL Powell minimization of a
user supplied function.
Multivarietní analýza.
- CLUST_WTS Compute the cluster
weights of a multivariate data set.
- CLUSTER Compute a cluster analysis
classification of a multivariate data set.
- CORRELATE Compute the linear
correlation coefficient.
- CTI_TEST Construct contingency
table from observed frequency data.
- KW_TEST Test the hypothesis that
three or more sample populations have the same mean of
distribution.
- M_CORRELATE Compute the multiple
correlation coefficient.
- P_CORRELATE Compute the partial
correlation coefficient.
- PCOMP Compute the principal
components and derived variables of a multivariate data
set.
- STANDARDIZE Compute standardized
variables.
Zpracování řídkých matic.
Note that SPRSIN must be used to convert
to sparse storage format before the other routines can be used.
- FULSTR Restore a row-indexed sparse
array to full storage format.
- LINBCG Solve a system of linear
equations using the iterative biconjugate method.
- READ_SPR Read a row-indexed sparse
array from a file.
- SPRSAB Multiply two row-indexed
sparse arrays.
- SPRSAX Multiply a row-indexed
sparse array by a vector.
- SPRSIN Convert an array or list to
row-indexed sparse storage format.
- WRITE_SPR Write a row-indexed
sparse array to a file.
Zpracování časových řad.
- A_CORRELATE Compute the
autocorrelation or autocovariance of a sample population.
- C_CORRELATE Compute the cross-correlation
or cross-covariance of two sample populations.
- SMOOTH Smooth a time-series using a
moving average.
- TS_COEF Compute the coefficients
used in an autoregressive time-series forecasting model.
- TS_DIFF Compute forward differences
of a time-series.
- TS_FCAST Compute the future values
of a stationary time-series.
- TS_SMOOTH Compute central, backward,
or forward moving averages of a time-series.
Zpracování signálu - filtrace a
vyhlazení dat.
- A_CORRELATE Compute the
autocorrelation or autocovariance of a sample population.
- C_CORRELATE Compute the cross-correlation
or cross-covariance of two sample populations.
- SMOOTH Smooth a time-series using a
moving average (boxcar average).
- MEDIAN Median function and filter
for time-series cleaning.
- FFT Fast Fourier transformation.
- HANNING Hanning window function.
- HAMMING Hamming window function.
- HILBERT Hilbert transformation (time-domain
to time-domain).
- WTN Discrete wavelet transformation
- BLK_CON Discrete convolution an
input signal with an impulse-response sequence.
- CONVOL Discrete convolution of two
signals.
- DIGITAL_FILTER Computes impulse
response of FIR filter based on Kaiser's window
- LEEFILT Performs the Lee filter
algorithm on a vector a box of size 2N+1.
Zpracování obrazu.
- SMOOTH Smooth a time-series using a
moving average.
- FFT Fast Fourier transformation.
- ROBERTS Roberts gradient of an
image.
- SOBEL Sobel gradient operator.
- LEEFILT Performs the Lee filter
algorithm on an image array using a box of size 2N+1.
- THIN Returns the "skeleton"
of a bi-level image.
- DISSOLVE Provides a digital "dissolve"
effect for images.
- CONVOL Discrete convolution of
image with a selected kernel.
- HIST_EQUAL Histogram equalisation
of image, returns a histogram-equalized byte array.
- H_EQ_CT Histogram-equalizes the
color tables for an image or a region of the display.
- H_EQ_INT Interactively histogram-equalizes
the color tables of an image or a region of the display
- ADAPT_HIST_EQUAL Performs adaptive
histogram equalization, a form of automatic image
contrast enhancement
- DILATATE, ERODE Morphologic
dilation and erosion operators on binary and grayscale
images and vectors
- MORPH_OPEN, MORPH_CLOSE Opening and
closing operators to a binary or grayscale image
- MORPH_DISTANCE Estimates N-dimensional
distance maps
- MORPH_GRADIENT Applies the
morphological gradient operator to a grayscale image
- MORPH_HITORMISS, MORPH_THIN Applies
the hit-or-miss operator, thinning operation to a binary
image
- MORPH_TOPHAT Applies top-hat
operator to a grayscale image
- POLY_2D Performs polynomial warping
of images
- POLYWARP Determines coefficients of
the polynomial functions performing polynomial spatial
warping.
- WATERSHED Applies the morphological
watershed operator to a grayscale image.
- WARP_TRI Image array with a
specified geometric correction applied
Regions of interest.
- POLYFILLV Returns a vector
containing the one-dimensional subscripts of the array
elements contained inside a polygon defined by vectors X
and Y
- POLY_AREA Area of a polygon given the coordinates of its
vertices
- DEFROI Interactively defines an irregular region of
interest of an image using the image display system and
the cursor and mouse
- PROFILE Extracts a profile from an image and returns a
floating-point vector containing the values of the image
along the profile line marked by the user
- SEARCH2D Finds "objects" or regions of similar
data values within a 2D array of data.
- SEARCH3D Finds "objects" or regions of similar
data values within a 3D array of data.
Kódování barev, barevné škály.
- COLOR_CONVERT - převod mezi barevnými
soustavami RGB (Red Green Blue), HLS (Hue Lightness
Saturation) a HSV (Hue Saturation Value)
- HLS, HSV, PSEUDO - definice barevné
škály spirálou v HLS, HSV resp. LHB (Lightness Hue
Brightness) barevném systému
- COLOR_QUAN - převod true-color
obrazu (24bit/pixel) na pseudo-color obraz (8bit/pixel) a
odpovídající barevnou škálu (2-256 barev)
- REDUCE_COLORS - sníží počet
barev v obraze eliminací barev nepoužitých pro pixely
- MULTI - upraví současnou barevnou
škálu několikanásobným cyklickým přetočením
- GAMMA_CT - gama korekce barevné škály
- STRETCH - stlačí barevnou škálu do daného rozsahu
indexů
Promítání obrazu dle zeměpisné
projekce.
- MAP_IMAGE, MAP_PATCH deformuje
obraz podle nastavené zeměpisné projekce
Trasování vektorových polí.
- PARTICLE_TRACE - hledá cestu nehmotné částicer ve 2D
a 3D vektorovém poli
- STREAM_LINE Output a polygonal ribbon which is tangent to
a vector field along its length.
- VECTOR_FIELD
Rutiny použitelné v analytické
geometrii.
- PNT_LINE - vzdálenost bodu od přímky
- CIR_3PNT - střed a poloměr kružnice ze 3 zadaných bodů
(v 2D)
- SPH_4PNT - střed a poloměr kulové plochy ze 4 zadaných
bodů (v 3D)
- POLY_AREA - plocha mnohoúhelníku v 2D
3D transformace.
Zpracování objemových dat.
- PROJECT_VOL - projekce 3D objemových dat (poloprůhledný
prostor) do 2D roviny
- VOXEL_PROJ - projekce 3D objemových dat (poloprůhledný
prostor) do 2D roviny
- RECON3 Can reconstruct a three-dimensional data array
from two or more images (or projections) of an object
- RIEMANN Computes the "Riemann sum" (or its
inverse) which helps implement the backprojection
operator used to reconstruct the cross-section of an
object, given projections through the object from
multiple directions.
- POLYSHADE Returns a shaded-surface representation (2D
array) of one or more solids described by a set of
polygons
- SHADE_VOLUME Computes the polygons that describe a three
dimensional contour surface
- SEARCH3D Finds "objects" or regions of similar
data values within a 3D array of data
Polygonální a tetrahedrální sítě.
- MESH_CLIP, MESH_DECIMATE , MESH_ISSOLID , MESH_MERGE ,
MESH_NUMTRIANGLES , MESH_OBJ , MESH_SMOOTH , MESH_SURFACEAREA
, MESH_VALIDATE , MESH_VOLUME
- COMPUTE_MESH_NORMALS Computes normal vectors for a set of
polygons described by the input array
- POLYSHADE Returns a shaded-surface representation (2D
array) of one or more solids described by a set of
polygons.
- ISOCONTOUR, ISOSURFACE
- TETRA_CLIP, TETRA_SURFACE, TETRA_VOLUME
- VERT_T3D Transforms a 3D array by a 4x4 transformation
matrix and returns the transformed array
L.Přech,
poslední úpravy 17.1.2001