Functions Exported by RvSpectMLBase

General purpose

Base.lengthMethod

Return number of times/ChunkLists in a ChunkListTimeseries

source
RvSpectMLBase.apply_doppler_boost!Function
`apply_doppler_boost!(spectrum, doppler_factor)`
`apply_doppler_boost!(spectra, df)`

Apply Doppler boost to spectra's λ's and update its metadata[:doppler_factor], so it will know how to undo the transform.

Arguments:

  • spectrum::AbstractSpectra: spectrum to be boosted
  • doppler_factor: boost factor (1 = noop)

or:

  • spectra: spectra to be boosted
  • df: DataFrame provides :drift and :ssb_rv (in m/s) for calculating the Doppler boost for each spectrum

Returns spectrum/spectra with λ boosted TODO: Improve documentation formatting. This can serve as a template.

source
RvSpectMLBase.code_to_include_param_jlMethod

code_to_include_param_jl( ; path_to_search, filename, verbose )

Returns a Code object. After res = code_toread_param_jl( path_to_search ), execute eval(res) to actually include the param.jl file. This is useful since it allows variables to be placed into caller's namespace.

Warning: Malicious users could insert arbitrary code into param.jl. Don't be a malicous user.

source
RvSpectMLBase.filter_bad_chunksMethod

Return (chunktimeseries) that have been trimmed of any chunks that are bad based on any spectra in the chunktimeseries. For now just checks for NaNs. Instruments can provide their own checks. Inputs:

  • chunk_timeseries: ChunkListTimeseries

Optional arguemnts:

  • verbose: print debugging info (false)

Returns:

  • ChunkListTimeseries that has removed problematic chunks.
source
RvSpectMLBase.findall_lineFunction

Return list of (pixels, order_idx) pairs that contain pixels with desireed wavelengths. Excludes locations that contain any pixels with var == NaN.

source
RvSpectMLBase.get_λ_rangeMethod

Return the largest minimum wavelength and smallest maximum wavelength across an array of spectra. Calls getλrange(AbstractSpectra2D) that should be specialized for each instrument.

source
RvSpectMLBase.make_chunk_list_around_linesMethod

make_chunk_list_around_lines( spectra, line_list) Return a ChunkList of best regions of spectrum with lines in lineline. linelist is a DataFrame containing :lambdalo and :lambdahi. Pads edges by Δ.

source
RvSpectMLBase.make_grid_for_chunkMethod

make_grid_for_chunk Create a range with equal spacing between points with end points set based on union of all chunks in timeseries.

Arguments:

  • timeseries: ChunkListTimeseries
  • chunk index:
  • oversample_factor: (1)
source
RvSpectMLBase.make_orders_into_chunksFunction

make_orders_into_chunks Return a ChunkList with a region of spectrum from each order in orderstouse.

Arguments

  • spectra<:AbstractSpectra
  • inst: Instrument trait that provides default values

Optional arguments

  • orderstouse: Range or Array (orderstouse(inst))
  • pixelstouse: Array of Ranges (each from mincol to maxcol)

or

  • mincol: (mincol_default(inst,order)) and
  • maxcol: (maxcol_default(inst,order))
source
RvSpectMLBase.read_data_pathsMethod

read_data_paths( ; path_to_search, filename, verbose ) Looks for datapaths.jl and includes it to set datapaths

Warning: Malicious users could insert arbitrary code into data_paths.jl. Don't be a malicous user.

source

Functions to be Provided for Each Instrument

Example Instrument

RvSpectMLBase.TheoreticalInstrument.generate_spectra_timeseriesMethod

generate_spectra_timeseries(line_list, inst; time, rv, ssbz, snr_per_pixel, line_width, add_noise ) Generate a time series of spectra using times, a line_list (as DataFrame with columns lambda and weight) and a theoretical instrument. Optionally, specify times, rv's, barycentric corrections, etc.

source
RvSpectMLBase.TheoreticalInstrument.generate_spectrumMethod

generate_spectrum(line_list, inst; time, rv, ssbz, snr_per_pixel, line_width, add_noise ) Generate a spectrum using a line_list (as DataFrame with columns lambda and weight) and theoretical instrument. Optionally, specify times, rv's, barycentric corrections, etc.

source

Other