RvSpectML Internals
As a heads up, these functions and types are more likely to change going forward than functions and types that are exported.
Functions
General purpose
Base.append!
— MethodAppend second chunk list to the first.
Base.getindex
— MethodProvide direct access to data, an AbstractArray of ChunkOfSpectrum's via [] operator
Base.getindex
— MethodAllow direct access to data, an AbstractArray of ChunkOfSpectrum's via [] operator
Base.setindex!
— MethodProvide direct access to data, an AbstractArray of ChunkOfSpectrum's via [] operator
Base.setindex!
— MethodAllow direct access to data, an AbstractArray of ChunkOfSpectrum's via [] operator
RvSpectMLBase.allequal
— MethodReturn true if all elements of array are equal to each other.
RvSpectMLBase.calc_line_bisector_at_abs_depth
— Methodcalclinebisectoratabsdepth(λ, flux; absdepth ) Returns the line average of wavelengths (units of λ) at specified absolute line depth. Assumes continuum is the maximum flux provided.
RvSpectMLBase.calc_line_bisector_at_frac_depth
— Methodcalclinebisectoratfracdepth(λ, flux; fracdepth, lineminwindowfraction ) Returns the line average of wavelengths (units of λ) at specified fractional line depth. Assumes continuum is the maximum flux provided. Assumes the line's minimum flux occurs within lineminwindowfraction, a central fraction of the total λ window. Returns NaN if target flux cannot be found on either side of the line
RvSpectMLBase.calc_line_width
— Methodcalclinewidth(λ, flux; fracdepth, lineminwindowfraction ) Returns the line width (units of λ) for specified fractional line depth (default of 0.5). Assumes continuum is the maximum flux provided. Assumes the line's minimum flux occurs within lineminwindow_fraction, a central fraction of the total λ window. Returns NaN if target flux cannot be found on either side of the line
RvSpectMLBase.calc_snr
— Functioncalc_snr(flux, var)
calc_snr(spectrum, pixels, order_idx)
Calculate total SNR in (region of) spectra.
RvSpectMLBase.check_if_line_match
— Methodcheck_if_line_match ( λ, list ; threshold )
Return true if list contains a wavelength differing from λ by no more than threshold (in units of Δλ/λ)
RvSpectMLBase.find_cols_to_fit
— MethodReturn a range of columns indices with wavelengths between linelo and linehi
RvSpectMLBase.find_cols_to_fit
— MethodReturn a range of columns indices with wavelengths within Δ of line_center
RvSpectMLBase.find_which_line_fits_in_line_list
— Methodfindwhichlinefitsinlinelist( fitlist, linelist; threshold ) Return list of Bools indicatin which line(s) from fitlist match a line in linelist to within threshold (in units of Δλ/λ) Warning: Untested
RvSpectMLBase.findargminmax
— Methodfindargminmax(a)
Return (argmin, min, argmax, max) Adapapted from https://github.com/JuliaLang/julia/blob/697e782ab86bfcdd7fd15550241fe162c51d9f98/base/array.jl#L2191
RvSpectMLBase.instrument
— MethodGet instrument used for chunklisttimeseries.
RvSpectMLBase.interp_linear
— Method`interp_linear(;x1,x2,y1,y2,xpred) Return result of simple linear interpolant at xpred. Does not test that xpred is between x1 and x2.
RvSpectMLBase.is_in_wavelength_range_list
— Methodis_in_wavelength_range_list(λ_lo, λ_hi; list )
Return true if there is overlap between (λlo, λhi) and lambdalo and lambdahi for any row in list
TODO: test
RvSpectMLBase.is_in_wavelength_range_list
— Methodis_in_wavelength_range_list(λ; order, list )
Return true if λ is between lambdalo and lambdahi for any row in list
RvSpectMLBase.is_in_wavelength_range_list_any_order
— Methodis_in_wavelength_range_list_any_order(λ; list )
Return true if λ is between lambdalo and lambdahi for any row in list
RvSpectMLBase.make_spectral_time_series_common_wavelengths_with_selected_times
— Methodmakespectraltimeseriescommonwavelengthswithselectedtimes( input, timeidx ) Returns a SpectralTimeSeriesCommonWavelengths, retaining only those times and spectra specified by timeidx.
RvSpectMLBase.metadata
— MethodGet metadata[:key] of ith observation in chunklisttimeseries.
RvSpectMLBase.multiple_append!
— MethodA generalized version of the built in append!() function By Christian Gilbertson?
TODO: Ask Christian what the purpose of this is relative to std append
RvSpectMLBase.predict_intrinsic_stellar_line_width
— MethodEstimate line width based on stellar Teff (K) and optionally v_rot (m/s). Output in m/s.
RvSpectMLBase.searchsortednearest
— Functionsearchsortednearest(a<:AbstractVector, x::Real; assume_sorted = false )
searchsortednearest(a<:AbstractVector, x<:AbstractVector; assume_sorted = false )
Find the index of vector a where the value of a is closest to x. All vectors are assumed to already be sorted. To turn off assertions, set assume_sorted to true.
Credit: traktofon @ https://discourse.julialang.org/t/findnearest-function/4143/4 Vector Vector version by Christian Gilbertson? issorted assertion and optional assume_sorted added by Eric Ford
RvSpectMLBase.time
— MethodGet time of ith observation in chunklisttimeseries.
Interpolation
Modules = [RvSpectMLBase.LinearInterpolation ]
Public = false
Order = [ :function]
Instrument specific
RvSpectMLBase.TheoreticalInstrument.calc_λ
— Methodcalc_λs(inst)
Compute the wavelength for one pixel of a theoretical 1d instrument
RvSpectMLBase.TheoreticalInstrument.calc_λs
— Functioncalc_λs
Generate an array of n wavelengths uniformly spaced in log(lambda)
RvSpectMLBase.TheoreticalInstrument.calc_λs
— Methodcalc_λs(λ_min, λ_max, n)
Generate an array of n wavelengths uniformly spaced in log(lambda) from λmin to λmax.
RvSpectMLBase.TheoreticalInstrument.calc_λs
— Methodcalc_λs(inst)
Generate an array of wavelengths based on a theoretical instrument's properties
RvSpectMLBase.TheoreticalInstrument.calc_λs
— Methodcalc_λs(inst)
Generate an array of wavelengths based on a theoretical instrument's properties
RvSpectMLBase.TheoreticalInstrument.demo_generate_spectrum_line
— Methoddemo_generate_spectrum_line( inst )
Generate spectrum with one line for testing purposes.
Other
Types
General purpose
Interpolation
Modules = [RvSpectMLBase.LinearInterpolation ]
Public = false
Order = [:type ]