View source: R/map_linearinterpol_with_xtrafo.R
create_linearinterpol_with_xtrafo_map | R Documentation |
Creates a map to linearly interpolate the values at the source indices given on a one-dimensional mesh to the one-dimensional mesh associated with the variables at the target indices. It is possible to apply a shift and scaling to the target mesh to account for, e.g., an energy calibration error of an experiment. The transformation is given by x = α + β x' where x' is an x-value of the target mesh as stated by the user and the resulting x is the correct x-value that should be used for the linear interpolation.
create_linearinterpol_with_xtrafo_map()
The following fields are required in the parameter list to initialize the mapping:
mapname | Name of the mapping |
maptype | Must be "linearinterpol_with_xtrafo_map" |
src_idx | Vector of source indices |
tar_idx | Vector of target indices |
src_x | Vector with the mesh associated with the source indices |
tar_x | Vector with the mesh associated with the target indices |
zero_outside | Default is FALSE . If TRUE, y-values of target x-values outside
the limits of the source mesh will be zero, otherwise this situation
is not allowed. |
shiftx_idx | Index associated with the variable that contains α. |
scalex_idx | Index associated with the variable that contains β |
Returns a list of functions to operate with the mapping, see create_maptype_map
.
Other mappings:
create_compound_map()
,
create_convolution_with_xtrafo_map()
,
create_derivative2nd_map()
,
create_derivative_map()
,
create_linearinterpol_map()
,
create_linearmap_map()
,
create_maptype_map()
,
create_map()
,
create_nonlinear_map()
,
create_normerr_map()
,
create_product_map()
params <- list( mapname = "mylinearintmap", maptype = "linearinterpol_with_xtrafo_map", src_idx = 1:3, tar_idx = 4:6, src_x = c(1,5,10), tar_x = c(4,5,6), shiftx_idx = 7, scalex_idx = 8 ) mymap <- create_linearinterpol_with_xtrafo_map() mymap$setup(params) x <- c(1,2,3,0,0,0,0.5,1.1) mymap$propagate(x) mymap$jacobian(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.