Skip to content

Commit

Permalink
formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
haakon-e committed Feb 28, 2025
1 parent 9c27cc2 commit 4b68eee
Show file tree
Hide file tree
Showing 13 changed files with 304 additions and 191 deletions.
24 changes: 12 additions & 12 deletions docs/src/plots/P3AspectRatioPlot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ import CloudMicrophysics.Parameters as CMP
import CloudMicrophysics.P3Scheme as P3

axis_theme = Theme(
Axis = (
xscale = log10,
xminorticksvisible = true, xminorticks = IntervalsBetween(5),
xticks = [0.01, 0.1, 1, 10],
limits = ((0.01, 10.0), (0, 1.05)),
xgridvisible = false, ygridvisible = false,
xlabel = "D (mm)",
),
linewidth = 3,
VLines = (
linewidth = 1.5,
)
Axis = (
xscale = log10,
xminorticksvisible = true,
xminorticks = IntervalsBetween(5),
xticks = [0.01, 0.1, 1, 10],
limits = ((0.01, 10.0), (0, 1.05)),
xgridvisible = false,
ygridvisible = false,
xlabel = "D (mm)",
),
linewidth = 3,
VLines = (linewidth = 1.5,),
)

logocolors = Makie.Colors.JULIA_LOGO_COLORS
Expand Down
7 changes: 5 additions & 2 deletions docs/src/plots/P3Melting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ FT = Float64
# parameters
tps = TD.Parameters.ThermodynamicsParameters(FT)
params = CMP.ParametersP3(
CP.create_toml_dict(FT; override_file=Dict("Heymsfield_mu_coeff1" => Dict( "value" => 3.0)));
slope_law=:constant
CP.create_toml_dict(
FT;
override_file = Dict("Heymsfield_mu_coeff1" => Dict("value" => 3.0)),
);
slope_law = :constant,
)
vel = CMP.Chen2022VelType(FT)
aps = CMP.AirProperties(FT)
Expand Down
24 changes: 12 additions & 12 deletions docs/src/plots/P3SchemePlots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ import CloudMicrophysics.Parameters as CMP
import CloudMicrophysics.P3Scheme as P3

axis_theme = Theme(
Axis = (
xscale = log10,
xminorticksvisible = true, xminorticks = IntervalsBetween(5),
xticks = [0.01, 0.1, 1, 10],
limits = ((0.01, 10.0), nothing),
xgridvisible = false, ygridvisible = false,
),
linewidth = 3,
VLines = (
linewidth = 1.5,
)
Axis = (
xscale = log10,
xminorticksvisible = true,
xminorticks = IntervalsBetween(5),
xticks = [0.01, 0.1, 1, 10],
limits = ((0.01, 10.0), nothing),
xgridvisible = false,
ygridvisible = false,
),
linewidth = 3,
VLines = (linewidth = 1.5,),
)

logocolors = Makie.Colors.JULIA_LOGO_COLORS
Expand Down Expand Up @@ -96,4 +96,4 @@ end

fig = with_theme(p3_relations_plot, axis_theme)
save("P3Scheme_relations.svg", fig)
fig
fig
19 changes: 9 additions & 10 deletions docs/src/plots/P3SlopeParameterizations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,29 @@ FT = Float64
slope_power_law = CMP.ParametersP3(FT).slope

# Constant parameterization
slope_constant = CMP.ParametersP3(
CP.create_toml_dict(FT; override_file=Dict("Heymsfield_mu_coeff1" => Dict( "value" => 3.0)));
slope_law=:constant
).slope
override_file = Dict("Heymsfield_mu_coeff1" => Dict("value" => 3.0))
params = CMP.ParametersP3(CP.create_toml_dict(FT; override_file))
slope_constant = params.slope

logλs = @. log(10.0 ^ FT(2:0.01:6))

logλs = @. log(10.0^FT(2:0.01:6))

function make_slope_plot(slope_law, title)
fig = Figure(size=(400, 300), figure_padding = 20)
fig = Figure(size = (400, 300), figure_padding = 20)

ax = Axis(fig[1,1]; title, xscale = log10, xlabel = "λ", ylabel = "μ")
ax = Axis(fig[1, 1]; title, xscale = log10, xlabel = "λ", ylabel = "μ")

lines!(ax, exp.(logλs), P3.get_μ.(slope_law, logλs))

return fig
end

fig = with_theme(theme_minimal()) do
fig = with_theme(theme_minimal()) do
make_slope_plot(slope_power_law, "μ as a function of λ (power law)")
end
save("P3SlopeParameterizations_power_law.svg", fig)

fig = with_theme(theme_minimal()) do
fig = with_theme(theme_minimal()) do
make_slope_plot(slope_constant, "μ as a constant")
end
save("P3SlopeParameterizations_constant.svg", fig)

Loading

0 comments on commit 4b68eee

Please sign in to comment.