Skip to content
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
deps/deps.jl
*.mem
*.h5
fftw_wisdom.lock
Comment thread
jtravs marked this conversation as resolved.
Outdated
.vscode/settings.json
14 changes: 10 additions & 4 deletions src/LinearOps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,23 @@ import Luna.PhysData: wlfreq
function make_const_linop(grid::Grid.RealGrid, βfun, αfun, frame_vel)
β = similar(grid.ω)
βfun(β, grid.ω, 0)
α = αfun(grid.ω, 0)
α = zeros(length(grid.ω))
α[2:end] .= αfun(grid.ω[2:end], 0)
α[α .> 300] .= 300
β1 = 1/frame_vel(0)
linop = @. -im*(β-β1*grid.ω) - α/2
linop[1] = 1
linop[1] = 0
return linop
end

function make_const_linop(grid::Grid.EnvGrid, βfun, αfun, frame_vel, β0ref)
β = similar(grid.ω)
βfun(β, grid.ω, 0)
α = αfun(grid.ω, 0)
α[α .> 300] .= 300
β1 = 1/frame_vel(0)
linop = -im.*(β .- β1.*(grid.ω .- grid.ω0) .- β0ref) .- α./2
linop[.!grid.sidx] .= 1
linop[.!grid.sidx] .= 0
return linop
end

Expand Down Expand Up @@ -62,7 +65,9 @@ function make_const_linop(grid::Grid.RealGrid, modes, λ0; ref_mode=1)
βconst = zero(grid.ω)
βconst[2:end] = Modes.β.(modes[i], grid.ω[2:end])
βconst[1] = 1
α = Modes.α.(modes[i], grid.ω)
α = zeros(length(grid.ω))
α[2:end] .= Modes.α.(modes[i], grid.ω[2:end])
α[α .> 300] .= 300
Comment thread
jtravs marked this conversation as resolved.
Outdated
linops[:,i] = im.*(-βconst .+ grid.ω./vel) .- α./2
end
linops
Expand All @@ -82,6 +87,7 @@ function make_const_linop(grid::Grid.EnvGrid, modes, λ0; ref_mode=1, thg=false)
βconst[grid.sidx] = Modes.β.(modes[i], grid.ω[grid.sidx])
βconst[.!grid.sidx] .= 1
α = Modes.α.(modes[i], grid.ω)
α[α .> 300] .= 300
linops[:,i] = -im.*(βconst .- (grid.ω .- grid.ω0)./vel .- βref) .- α./2
end
linops
Expand Down
Loading