Skip to content

Commit

Permalink
fix convolution
Browse files Browse the repository at this point in the history
  • Loading branch information
palumbom committed Apr 11, 2024
1 parent 200ca34 commit 3faf5d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/observing/convolutions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@ end
function convolve_gauss(xs::AA{T,1}, ys::AA{T,1}; new_res::T=1.17e5,
oversampling::T=1.0) where T<:AbstractFloat
# get kernel
σ(x) = x / new_res / 2.354
σ(x) = x / new_res / (2.0 * sqrt(2 * log(2)))
g(x, n) = (one(T)/(σ(x) * sqrt(2.0 * π))) * exp(-0.5 * ((x - n)/σ(x))^2)
kernel = g.(xs, xs[Int(round(length(xs)/2))])


# pad the signal
signal = vcat(zeros(100), ys[:,1], zeros(100))
signal[1:100] .= first(ys[:,1])
signal[101:end-100] .= ys
signal[end-100:end] .= last(ys[:,1])

# do the convolution
Expand All @@ -151,7 +151,7 @@ end
function convolve_gauss(xs::AA{T,1}, ys::AA{T,2}; new_res::T=1.17e5,
oversampling::T=1.0) where T<:AbstractFloat
# get kernel
σ(x) = x / new_res / 2.354
σ(x) = x / new_res / (2.0 * sqrt(2 * log(2)))
g(x, n) = (one(T)/(σ(x) * sqrt(2.0 * π))) * exp(-0.5 * ((x - n)/σ(x))^2)
kernel = g.(xs, xs[Int(round(length(xs)/2))])

Expand Down
2 changes: 1 addition & 1 deletion src/structures/SolarData.jl
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function SolarData(fname::String; relative::Bool=true, extrapolate::Bool=true,
end
end

if extrapolate & (minimum(int1) < 0.75) & !(contains(fname, "FeI_5383"))
if extrapolate & (minimum(int1) < 0.75)# & !(contains(fname, "FeI_5383"))
extrapolate_input_data(bis, int1, wid, int2, parse_mu_string(mu))
end

Expand Down

0 comments on commit 3faf5d7

Please sign in to comment.