create_convolution_with_xtrafo_map: Create a mapping for windowed averages including energy...

View source: R/map_convolution_with_xtrafo.R

create_convolution_with_xtrafo_mapR Documentation

Create a mapping for windowed averages including energy calibration

Description

Creates a map to calulate averages of a linear piecewise function whose functions values are given at the source indices. The averages are evaluated at the x-values of the mesh associated with the target indices. It is also possible to apply the transformation x = α + (1-β)x' to the x'-values of the target mesh before the averaging is performed.

Usage

create_convolution_with_xtrafo_map()

Details

The following fields are required in the parameter list to initialize the mapping:

mapname Name of the mapping
maptype Must be "convolution_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
winsize The average of the function at the source mesh is taken between x-winsize/2 and x+winsize/2
winsize_idx The index of the variable containing the window size. Only one of winsize and winsize_idx must be present.
shiftx Value of α
shiftx_idx Index associated with the variable that contains α. Only one of shiftx and shiftx_idx must be present.
scalex Value of β.
scalex_idx Index associated with the variable that contains β. Only one of scalex and scalex_idx must be present.

Value

Returns a list of functions to operate with the mapping, see create_maptype_map.

See Also

Other mappings: create_compound_map(), create_derivative2nd_map(), create_derivative_map(), create_linearinterpol_map(), create_linearinterpol_with_xtrafo_map(), create_linearmap_map(), create_maptype_map(), create_map(), create_nonlinear_map(), create_normerr_map(), create_product_map()

Examples

params <- list(
  mapname = "mylinearintmap",
  maptype = "convolution_with_xtrafo_map",
  src_idx = 1:3,
  tar_idx = 4:6,
  src_x = c(1,5,10),
  tar_x = c(4,5,6),
  winsize_idx = 7,
  shiftx_idx = 8,
  scalex_idx = 9
)
mymap <- create_convolution_with_xtrafo_map()
mymap$setup(params)
x <- c(1,2,3,0,0,0,2,1,0.1)
mymap$propagate(x)
mymap$jacobian(x)


gschnabel/nucdataBaynet documentation built on Feb. 3, 2023, 4:13 a.m.