hgrv: Apply the Hermite-Gaussian Radial Velocity (HGRV) Estimation...

Description Usage Arguments Value Examples

View source: R/hgrv.R

Description

This function applies the HGRV method as given in Holzer et al. (2020) to a given observed spectrum, using the estimated template from the estimate_template function and the parameters component of the output from the Gaussfit function. The result is an estimate of the relative radial velocity present in the observed spectrum in units of m/s.

Usage

1
hgrv(obs_wvl, obs_flx, tmp_wvl, tmp_flx, Features, obs_err = NULL, cntm = NULL)

Arguments

obs_wvl

the vector of wavelengths of the observed spectrum

obs_flx

the vector of normalized flux of the observed spectrum

tmp_wvl

the vector of wavelengths of the template spectrum

tmp_flx

the vector of normalized flux of the template spectrum

Features

a dataframe with the wavelength bounds and fitted Gaussian parameters for each absorption feature. The parameters component of the output from the Gaussfit function provides this.

obs_err

the vector of uncertainties in the normalized flux of the observed spectrum (must be the same length as obs_wvl and obs_flx)

cntm

the vector of continuum values used to normalize the flux of the observed spectrum (must be the same length as obs_wvl and obs_flx)

Value

a list with the following components

rv

the estimated radial velocity in units of m/s

rv_err

the standard error of the estimated radial velocity in units of m/s

n

the number of data points used in the weighted linear regression

data

a list with the observed wavelengths (wvl), the difference flux (diff_flux), the explanatory variable constructed as a sum of first-degree generalized Hermite-Gaussian functions (hgvar), and the weights (weights) used in the regression.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data(template)
ftrs = findabsorptionfeatures(template$Wavelength,
                              template$Flux,
                              pix_range = 8, gamma = 0.05,
                              alpha = 0.07, minlinedepth = 0.015)
gapp = Gaussfit(template$Wavelength, template$Flux, ftrs)
data(observed_spec)
hgrv_output = hgrv(observed_spec$Wavelength, observed_spec$Flux,
                   template$Wavelength, template$Flux, gapp$parameters,
                   obs_err = observed_spec$Uncertainty)
plot(hgrv_output$data$hgvar, hgrv_output$data$diff_flux)
abline(a=0, b=hgrv_output$rv)
abline(a=0, b=hgrv_output$rv - 3*hgrv_output$rv_err, lty=2)
abline(a=0, b=hgrv_output$rv + 3*hgrv_output$rv_err, lty=2)

rvmethod documentation built on Aug. 10, 2020, 5:07 p.m.