My Coding >
Programming language >
Python >
Python libraries and packages >
Python SciPy >
SciPy: Interpolation 3 dimension data
SciPy: Interpolation 3 dimension dataIn many calculations in the 1, 2 or 3 dimensional data we only have calculated values in the points of our calculating grid, but for the further analysis we need to know, at least approximated values in any points within the range of our domain. In this article I will show, how to interpolate 3D domain with SciPy library. Domain for interpolationFirst of all, load libraries
At the second step we need to make a function to calculate our test function and create domain for calculations.
for working with RegularGridInterpolator it is necessary to use mgrid, or meshgrid with options indexing='ij', sparse=True. Initializing and using InterpolatorWhen data is calculated in every point, it is necessary to initialize interpolator. At the moment, in 3D space, only "linear" and "nearest"methods are available.
When the interpolator is initialized, we can ise it for calculation values for any points within our domain.
The interpolation looks pretty close to real values.
|
Last 10 artitles
9 popular artitles
|
|
© 2020 MyCoding.uk -My blog about coding and further learning. This blog was writen with pure Perl and front-end output was performed with TemplateToolkit. |