convolve.spectrum: Convolve a spectrum with a given kernel

Description Usage Arguments Details Value Author(s) See Also

View source: R/convolve.spectrum.R

Description

The generic function convolve.spectrum convolves spectrum with a given kernel kern. The more user-friendly functions convolve.spectrum.Angstrom and convolve.spectrum.velocity perform convolutions with Gaussian and Gauss-Hermite kernels in linear and logarithmic (or velocity) wavelength space, respectively.

Usage

1
2
3
4
  convolve.spectrum(spectrum, kern)
  convolve.spectrum.velocity(spectrum, p, LOSVD=c("gauss", "gh",
       "gauss.hermite"), nsig=8)
  convolve.spectrum.Angstrom(spectrum, sigma, nsig=8)

Arguments

spectrum

a data frame with columns lambda, value and optionally contsub containing a spectrum. The spectrum has to be sampled on a logarithmic wavelength grid.

kern

a dataframe with components x and y specifying a kernel used for the convolution. A Gaussian kernel can be built using build.kernel

p

a vector of parameters for building a Gauss-Hermite kernel. If LOSVD=="gauss", p[3] and p[4] are ignored and set to zero. p[1] and p[2] are expected in physical units, km/s.

LOSVD

Shape of the LOSVD to be fit to the spectrum. Defaults to Gaussian but can also be set to a Gauss-Hermite series, to order 4.

sigma

the dispersion of the Gaussian kernel. For convolve.spectrum.Angstrom this is in the same units as spectrum$lambda (e.g. Angstrom).

nsig

the extent of the Gaussian or Gauss-Hermite kernel in terms of the parameter sigma or p[2].

Details

The function convolve.spectrum is primarily meant to be called by convolve.spectrum.velocity and convolve.spectrum.Angstrom, which include building the respective kernel.

Value

An object of class spectrum with the same components as the input spectrum.

Author(s)

Oliver Czoske

See Also

build.kernel


oczoske/slacR documentation built on May 20, 2019, 8:23 p.m.