Functions Exported by RvSpectML
General purpose
RvSpectML.bin_spectra_consecutive — Methodbinspectraconsecutive Bins consecutive spectra from a SpectralTimeSeriesCommonWavelengths object
WARNING: Simply takes consecutive spectra, so some bins may be from spectra that weren't taken close together. TODO: Create version that pays attention to timestamps.
RvSpectML.bin_spectra_max_Δt — Methodbinspectramax_Δt Bins spectra from a SpectralTimeSeriesCommonWavelengths object with a maximum spacing between observation times
RvSpectML.bin_spectra_nightly — Methodbinspectranightly Bins spectra from a SpectralTimeSeriesCommonWavelengths object with a maximum spacing between observation times
RvSpectML.bin_times_consecutive — Methodbintimesconsecutive( times, n ) Computes mean times from conseuctive bins of n times (to go with binconsecutivespectra). Returns floor(length(times)/n) elements.
WARNING: Simply takes consecutive times, so some bins may be from spectra that weren't taken close together. TODO: Create version that pays attention to timestamps.
RvSpectML.calc_d2fluxdlnlambda2! — MethodEstimate numerical second derivative of fluxes given wavelengths.
RvSpectML.calc_d2fluxdlnlambda2 — MethodEstimate numerical second derivative of fluxes given wavelengths.
RvSpectML.calc_depth_and_expected_rv_precission — Methodcalc_depth_and_expected_rv_precission(spectrum, pixels_index, order_index; smooth_factor) Calculate expected RV uncertainty for one portion of spectrum given by pixels and order indicies. Assumes only photon noise with given variances. Returns (depth, exp_σ_rv)
RvSpectML.calc_dfluxdlnlambda! — MethodEstimate numerical derivative of fluxes given wavelengths.
RvSpectML.calc_dfluxdlnlambda — MethodEstimate numerical derivative of fluxes given wavelengths.
RvSpectML.calc_formal_rv_precission — Methodcalc_formal_rv_precission(spectra, chunklist_timeseries; smooth_factor) Calculate expected RV uncertainty for each spectrum in an array of spectra and corresponding chunklist_timeseries, Assumies only photon noise with given variances.
RvSpectML.calc_formal_rv_precission — Methodcalc_formal_rv_precission(spectrum, chunklist; smooth_factor) Calculate expected RV uncertainty for one spectrum and corresponding chunklist, Assumes only photon noise with given variances.
RvSpectML.numerical_deriv — Methodnumerical_deriv( x, y) Calculate simple estimate of numerical derivative
RvSpectML.rms_rvs_within_night — Methodrmsrvwithin_night(times, rvs) Return RMS of RVs taken within the same night
RV-Related Algorithms
Interpolation Algorithms
RvSpectML.LinearInterpolation.interp_chunk_to_grid_linear! — Methodinterp_chunk_to_grid_linear!( flux_out, var_out, chunk_of_spectrum, wavelengths ) Return spectra interpolated onto a grid of points using linear interpolation.
Arguments:
- flux_out: (results stored into this array)
- var_out: (results stored into this array)
- chunkofspectrum
- wavelengths: AbstractRange or AbstractArray of locations where chunk is to be interpolated to
Optional Arguments:
- Filter: Vector with pre-allocated workspace (if length>=1)
Returns
- flux_out
RvSpectML.LinearInterpolation.interp_chunk_to_grid_linear — Methodinterp_chunk_to_grid_linear( chunk_of_spectrum, wavelengths ) Return spectra interpolated onto a grid of points using linear interpolation.
Arguments:
- chunkofspectrum
- wavelengths: AbstractRange or AbstractArray of locations where chunk is to be interpolated to
Returns
- flux_out
RvSpectML.LinearInterpolation.interp_chunk_to_shifted_grid_linear! — Methodinterp_chunk_to_grid_linear!( flux_out, var_out, chunk_of_spectrum, wavelengths ) Return spectra interpolated onto a grid of points using linear interpolation.
Arguments:
- flux_out: (results stored into this array)
- var_out: (results stored into this array)
- chunkofspectrum
- wavelengths: AbstractRange or AbstractArray of locations where chunk is to be interpolated to
- boostfactor: divide wavelengths by boostfactor
Optional Arguments:
- Filter: Vector with pre-allocated workspace (if length>=1)
Returns
- flux_out
RvSpectML.LinearInterpolation.interp_chunk_to_shifted_grid_linear — Method`interpchunktoshiftedgridlinear( chunkofspectrum, wavelengths, boostfactor ) Return spectra interpolated onto a grid of points using linear interpolation.
Arguments:
- chunkofspectrum
- wavelengths: AbstractRange or AbstractArray of locations where chunk is to be interpolated to
- boostfactor: divide wavelengths by boostfactor
Optional Arguments:
- Filter: Vector with pre-allocated workspace (if length>=1)
Returns
- flux_out
RvSpectML.LinearInterpolation.make_interpolator_linear_var — MethodReturn interpolator for variances in spectra.
RvSpectML.SincInterpolation.interp_chunk_to_grid_sinc! — Methodinterp_chunk_to_grid_sinc!( flux_out, var_out, chunk_of_spectrum, wavelengths ) Return spectra interpolated onto a grid of points using sinc interpolation.
Arguments:
- flux_out: (results stored into this array)
- var_out: (results stored into this array)
- chunkofspectrum
- wavelengths: AbstractRange or AbstractArray of locations where chunk is to be interpolated to
Optional Arguments:
- Filter: Vector with pre-allocated workspace (if length>=1)
Returns
- flux_out
RvSpectML.SincInterpolation.interp_chunk_to_grid_sinc — Methodinterp_chunk_to_grid_sinc( chunk_of_spectrum, wavelengths ) Return spectra interpolated onto a grid of points using sinc interpolation.
Arguments:
- chunkofspectrum
- wavelengths: AbstractRange or AbstractArray of locations where chunk is to be interpolated to
Returns
- flux_out
RvSpectML.SincInterpolation.interp_chunk_to_shifted_grid_sinc! — Methodinterp_chunk_to_shifted_grid_sinc!( flux_out, var_out, chunk_of_spectrum, wavelengths, boost_factor ) Return spectra interpolated onto a grid of points using sinc interpolation.
Arguments:
- flux_out: (results stored into this array)
- var_out: (results stored into this array)
- chunkofspectrum
- wavelengths: AbstractRange or AbstractArray of locations where chunk is to be interpolated to
- boostfactor: divide wavelengths by boostfactor
Optional Arguments:
- Filter: Vector with pre-allocated workspace (if length>=1)
Returns
- flux_out
RvSpectML.SincInterpolation.interp_chunk_to_shifted_grid_sinc — Methodinterp_chunk_to_shifted_grid_sinc( chunk_of_spectrum, wavelengths, boost_factor ) Return spectra interpolated onto a grid of points using sinc interpolation.
Arguments:
- chunkofspectrum
- wavelengths: AbstractRange or AbstractArray of locations where chunk is to be interpolated to
- boostfactor: divide wavelengths by boostfactor
Optional Arguments:
- Filter: Vector with pre-allocated workspace (if length>=1)
Returns
- flux_out
RvSpectML.SincInterpolation.spectra_interpolate — MethodOriginal author: Joe Ninan Converted to Julia and optimized by Christian Gilbertson Further adapted/optimized by Eric Ford Additional optimizations possible by preallocating arrasy for minargs, Nminargs, minvalues, FilterValues and OldYCoords.
RvSpectML.TemporalGPInterpolation.construct_gp_posterior — Methodconstruct_gp_posterior(xobs, yobs; sigmasq_obs, use_logx, use_logy, smooth_factor, boost_factor ) Inputs:
- xobs: x locations where data is provided
- yobs: y values of data to condition on
Optional Inputs:
- sigmasq_obs: variances for y values being conditioned on
- use_logx: If true, take log's of x values before fitting GP
- use_logy: If true, perform log transform on y's
- smooth_factor: scales GP hyperparameters so as to result in smoother GP posterior (1)
- boostfactor: scales xobs by 1/boostfactor (1)
Returns:
- Posterior GP at locations xpred given training data
RvSpectML.TemporalGPInterpolation.construct_gp_prior — Methodconstruct_gp_prior() Returns a GP prior using a Matern 5/2 kernel and specified parameters Optional Inputs:
- smoothfactorσ²: Multiplies variance for GP kernel (1)
- smoothfactorl: Multiplies length scale for GP kernel (1)
- σ²: Variance for GP kernel (0.5)
- l: length scale for GP kernel (5.8e-5)
RvSpectML.TemporalGPInterpolation.interp_chunk_to_grid_gp_temporal! — Methodinterp_chunk_to_grid_gp_temporal( chunk_of_spectrum, wavelengths ) Return spectra interpolated onto a grid of points using linear interpolation.
Arguments:
- chunkofspectrum
- wavelengths: AbstractRange or AbstractArray of locations where chunk is to be interpolated to
Returns
- flux_out
RvSpectML.TemporalGPInterpolation.interp_chunk_to_grid_gp_temporal — Methodinterp_chunk_to_grid_gp_temporal( chunk_of_spectrum, wavelengths ) Return spectra interpolated onto a grid of points using linear interpolation.
Arguments:
- chunkofspectrum
- wavelengths: AbstractRange or AbstractArray of locations where chunk is to be interpolated to
Returns
- flux_out
RvSpectML.TemporalGPInterpolation.interp_chunk_to_shifted_grid_gp_temporal! — Methodinterp_chunk_to_grid_gp_temporal!( flux_out, var_out, chunk_of_spectrum, wavelengths ) Return spectra interpolated onto a grid of points using linear interpolation.
Arguments:
- flux_out: (results stored into this array)
- var_out: (results stored into this array)
- chunkofspectrum
- wavelengths: AbstractRange or AbstractArray of locations where chunk is to be interpolated to
- boostfactor: divide wavelengths by boostfactor
Optional Arguments:
- Filter: Vector with pre-allocated workspace (if length>=1)
Returns
- flux_out
RvSpectML.TemporalGPInterpolation.interp_chunk_to_shifted_grid_gp_temporal — Method`interpchunktoshiftedgridgptemporal( chunkofspectrum, wavelengths, boost_factor ) Return spectra interpolated onto a grid of points using linear interpolation.
Arguments:
- chunkofspectrum
- wavelengths: AbstractRange or AbstractArray of locations where chunk is to be interpolated to
- boostfactor: divide wavelengths by boostfactor
Optional Arguments:
- Filter: Vector with pre-allocated workspace (if length>=1)
Returns
- flux_out
RvSpectML.TemporalGPInterpolation.predict_mean — Methodpredictgpmean(gp, xpred ; uselogx, uselogy) Inputs:
- gp:
- xpred: Locations to predict GP at
Optional inputs:
- use_logx: If true, apply log transform to xpred before evaluating GP
Returns vector of means of GP posterior at locations in xpred.
Other
RvSpectML.Pipeline.prepare_line_list — Methodpreparelinelist( linelistfn, allspectra, pipeline; recalc, convertairtovacuum, orderstouse, Δvtoavoidtellurics, vcentertoavoidtellurics ) linelistfn is the full path to the line list file linelistfn is loaded as a VALD mask if it contains substring "VALD", and linelistfn is loaded as an ESPRESSO mask if it contains the substring "espresso.mas". convertairtovacuum is a boolean (defualt value true) that determines whether to convert to vaccum wavelengths when loading VALD and ESPRESSO masks.