An interpolated scan is created at specified resolutions resx
, resy
in x and y direction.
The interpolation is based on na.approx
from the zoo
package. It is possible to create interpolations at a higher resolution than the one specified in the data itself, but it is not recommended to do so.
x3p_interpolate
can also be used as a way to linearly interpolate any missing values in an existing scan without changing the resolution.
Usage
x3p_interpolate(x3p, resx = 1e-06, resy = resx, maxgap = 1)
interpolate_x3p(x3p, resx = 1e-06, resy = resx, maxgap = 1)
Examples
logo <- x3p_read(system.file("csafe-logo.x3p", package="x3ptools"))
# resolution:
logo$header.info$incrementX
#> [1] 6.45e-07
# change resolution to 1 micron = 1e-6 meters
logo2 <- x3p_interpolate(logo, resx = 1e-6)
logo2$header.info$incrementX
#> [1] 1e-06