From e50a38484148cd7c445e9974806bdc35c9f336c3 Mon Sep 17 00:00:00 2001 From: nefrathenrici Date: Fri, 3 May 2024 15:17:10 -0700 Subject: [PATCH] Remove old plotting env --- plot/Project.toml | 11 --- ...ence_sphere_held_suarez_rhoe_equilmoist.jl | 71 ------------------- 2 files changed, 82 deletions(-) delete mode 100644 plot/Project.toml delete mode 100644 plot/convergence_sphere_held_suarez_rhoe_equilmoist.jl diff --git a/plot/Project.toml b/plot/Project.toml deleted file mode 100644 index 90923398..00000000 --- a/plot/Project.toml +++ /dev/null @@ -1,11 +0,0 @@ -[deps] -CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0" -CalibrateAtmos = "4347a170-ebd6-470c-89d3-5c705c0cacc2" -ClimaComms = "3a4d1b5c-c61d-41fd-a00a-5873ba7a1b0d" -ClimaCore = "d414da3d-4745-48bb-8d80-42e94e092884" -Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" -EnsembleKalmanProcesses = "aa8a2aa5-91d8-4396-bcef-d4f2ec43552d" -JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819" -NetCDF = "30363a11-5582-574a-97bb-aa9a979735b9" -TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76" -YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6" diff --git a/plot/convergence_sphere_held_suarez_rhoe_equilmoist.jl b/plot/convergence_sphere_held_suarez_rhoe_equilmoist.jl deleted file mode 100644 index fd434fb4..00000000 --- a/plot/convergence_sphere_held_suarez_rhoe_equilmoist.jl +++ /dev/null @@ -1,71 +0,0 @@ -import EnsembleKalmanProcesses as EKP -using EnsembleKalmanProcesses.ParameterDistributions -using EnsembleKalmanProcesses.TOMLInterface -using Distributions -import JLD2 -import Statistics: mean -import YAML -import TOML -import CairoMakie: Makie - -function convergence_plot(eki, prior, theta_star, output_dir = "output") - u_vec = EKP.get_u(eki) - - error_vec = Float64[] - spread_vec = Float64[] - for ensemble in u_vec - ensemble_error = 0 - ensemble_spread = 0 - ensemble_mean = mean(ensemble) - for i in ensemble - ensemble_error += abs(i - theta_star)^2 - ensemble_spread += abs(i - ensemble_mean)^2 - - end - ensemble_error /= length(ensemble) - ensemble_spread /= length(ensemble) - - push!(error_vec, ensemble_error) - push!(spread_vec, ensemble_spread) - end - - phi_vec = transform_unconstrained_to_constrained(prior, u_vec) - u_series = [getindex.(u_vec, i) for i in 1:10] - phi_series = [getindex.(phi_vec, i) for i in 1:10] - - f = Makie.Figure(title = "Convergence Plot", resolution = (800, 800)) - - ax = Makie.Axis( - f[1, 1], - xlabel = "Iteration", - ylabel = "Error", - xticks = 0:50, - ) - Makie.lines!(ax, 0.0:(length(error_vec) - 1), error_vec) - - ax = Makie.Axis( - f[1, 2], - xlabel = "Iteration", - ylabel = "Spread", - xticks = 0:50, - ) - Makie.lines!(ax, 0.0:(length(spread_vec) - 1), spread_vec) - - ax = Makie.Axis( - f[2, 1], - xlabel = "Iteration", - ylabel = "Unconstrained Parameters", - xticks = 0:50, - ) - Makie.lines!.(ax, tuple(0.0:(length(u_series[1]) - 1)), u_series) - - ax = Makie.Axis( - f[2, 2], - xlabel = "Iteration", - ylabel = "Constrained Parameters", - xticks = 0:50, - ) - Makie.lines!.(ax, tuple(0.0:(length(phi_series[1]) - 1)), phi_series) - Makie.hlines!(ax, [65.0], color = :red, linestyle = :dash) - Makie.save(joinpath(output_dir, "convergence.png"), f) -end