hgrv {rvmethod} | R Documentation |
Apply the Hermite-Gaussian Radial Velocity (HGRV) Estimation Method
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
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 |
obs_err |
the vector of uncertainties in the normalized flux of the observed spectrum (must be the same length as |
cntm |
the vector of continuum values used to normalize the flux of the observed spectrum (must be the same length as |
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 ( |
Examples
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)