Skip to content

Commit

Permalink
args
Browse files Browse the repository at this point in the history
  • Loading branch information
palumbom committed Nov 3, 2023
1 parent 47adf3a commit 2010b92
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/observing/convolutions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ function convolve_gauss(xs::AA{T,1}, ys::AA{T,2}; new_res::T=1.17e5,
# get kernel
# TODO: wavelength dependent kernel width???
σ = mean(xs) / new_res / 2.354

# TODO: sigma as argument
g(x, n) = (one(T)/* sqrt(2.0 * π))) * exp(-0.5 * ((x - n)/σ)^2)
kernel = g.(xs, xs[Int(round(length(xs)/2))])

Expand All @@ -175,6 +177,7 @@ function convolve_gauss(xs::AA{T,1}, ys::AA{T,2}; new_res::T=1.17e5,
signal[end-100:end] .= last(ys[:,t])

# perform the convolution
# TODO: fft plan (outside loop?)
signal .= imfilter(signal, reflect(centered(kernel./maximum(kernel))), Fill(0))
signal ./= maximum(signal[101:end-100])

Expand Down

0 comments on commit 2010b92

Please sign in to comment.