Skip to content

Commit

Permalink
adjust wavefield plots and heights
Browse files Browse the repository at this point in the history
  • Loading branch information
fgasdia committed Mar 16, 2024
1 parent f058204 commit 29ed585
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
12 changes: 6 additions & 6 deletions examples/wavefieldintegration.jl
Original file line number Diff line number Diff line change
Expand Up @@ -245,24 +245,24 @@ TO
#
# Let's reproduce the wavefields in figure 2 of Pitteway (1965).

zs = 110e3:-500:50e3
zs = 110e3:-50:50e3
zskm = zs/1000

e = LMP.integratewavefields(zs, ea, frequency, bfield, day; unscale=true)
e = LMP.integratewavefields(zs, ea, frequency, bfield, day)

ex1 = getindex.(e, 1)
ey1 = getindex.(e, 2)
ex2 = getindex.(e, 5)
hx2 = getindex.(e, 7)

function plotfield(field; kwargs...)
p = plot(real(field), zskm; color="black", linewidth=1.5, legend=false,
p = plot(real(field), zskm; color="black", linewidth=1.2, legend=false,
xlims=(-0.8, 0.8), label="real",
framestyle=:grid, kwargs...)
plot!(p, imag(field), zskm; color="black",
linewidth=1.5, linestyle=:dash, label="imag")
plot!(p, abs.(field), zskm; color="black", linewidth=3, label="abs")
plot!(p, -abs.(field), zskm; color="black", linewidth=3, label="")
linewidth=1.2, linestyle=:dash, label="imag")
plot!(p, abs.(field), zskm; color="black", linewidth=2, label="abs")
plot!(p, -abs.(field), zskm; color="black", linewidth=2, label="")
return p
end

Expand Down
4 changes: 2 additions & 2 deletions src/LongwaveModePropagator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Parameters for the `LongwaveModePropagator` module with defaults:
IntegrationParams(solver=Vern7(), tolerance=1e-5)`:
parameters passed to `DifferentialEquations.jl` for integration of the ionosphere
reflection coefficient.
- `wavefieldheights::H = range(topheight, 0, length=513)`: heights in meters at which
- `wavefieldheights::H = range(topheight, 0, length=2049)`: heights in meters at which
wavefields will be integrated.
- `wavefieldintegrationparams::IntegrationParams{T2} =
IntegrationParams(solver=Tsit5(), tolerance=1e-6)`:
Expand Down Expand Up @@ -123,7 +123,7 @@ See also: [`IntegrationParams`](@ref)
susceptibilitysplinestep::Float64 = 10.0
grpfparams::GRPFParams = DEFAULT_GRPFPARAMS
integrationparams::IntegrationParams{T} = IntegrationParams()
wavefieldheights::H = range(topheight, 0; length=513)
wavefieldheights::H = range(topheight, 0; length=2049)
wavefieldintegrationparams::IntegrationParams{T2} =
IntegrationParams(solver=Tsit5(), tolerance=1e-6)
radiationresistancecorrection::Bool = false
Expand Down
4 changes: 3 additions & 1 deletion src/Wavefields.jl
Original file line number Diff line number Diff line change
Expand Up @@ -345,12 +345,14 @@ savevalues(u, t, integrator) = ScaleRecord(integrator.p.z,

"""
integratewavefields(zs, ea::EigenAngle, frequency::Frequency, bfield::BField,
species; params=LMPParams())
species; params=LMPParams(), unscale=true)
Compute wavefields vectors `e` at `zs` by downward integration over heights `zs`.
`params.wavefieldintegrationparams` is used by this function rather than
`params.integrationparams`.
`unscale` corrects scaling of wavefields with `unscalewavefields`.
"""
function integratewavefields(zs, ea::EigenAngle, frequency::Frequency, bfield::BField,
species; params=LMPParams(), unscale=true)
Expand Down

0 comments on commit 29ed585

Please sign in to comment.