Helper Functions

Below are listed some helper functions for reference.

Spectra.normal_distFunction
normal_dist(x, amplitude, mean, sigma)
normal_dist(x, p)

Normal distribution with parameters amplitude, mean, sigma or a vector p = [amplitude, mean, sigma].

Notes:

  • normaldist(x, p) is a shorthand for normaldist(x, p[1], p[2], p[3])
source
Spectra.polyFunction
poly(p::Vector{Float64},x::Vector{Float64})

Build a polynomial curve given parameters p::Vector{Float64} at the x::Vector{Float64} values.

For a linear curve, p = [1.0,1.0], for a second order polynomial, p = [1.0,1.0,1.0], etc.;

source
Spectra.xshift_directFunction
xshift_direct(original_x::Array{Float64}, original_y::Array{Float64}, p::Float64)

Correct a spectrum for a p shift in X. Used in xshift_correction.

Inputs

original_x: Array{Float64}
	x values
original_y: Array{Float64}
	y values associated with x
p: Array{Float64}
	value of how much x should be shifted

Outputs

original_x: Array{Float64}
	same as input
corrected_y: Array{Float64}
	the y values corrected from the p shift in original_x
p: Array{Float64}
	same as input.
source