From de22bbe208eb286d603e8bfa5c1dbdb10c5f19c6 Mon Sep 17 00:00:00 2001 From: Anna Jaruga Date: Wed, 24 Apr 2024 14:42:56 -0700 Subject: [PATCH] Try to speed up OSX CI plots --- .../KiD_driver/run_KiD_simulation.jl | 2 +- test/plotting_utils.jl | 24 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/test/experiments/KiD_driver/run_KiD_simulation.jl b/test/experiments/KiD_driver/run_KiD_simulation.jl index 51cdcbc8..d00dd9b9 100644 --- a/test/experiments/KiD_driver/run_KiD_simulation.jl +++ b/test/experiments/KiD_driver/run_KiD_simulation.jl @@ -140,7 +140,7 @@ function run_KiD_simulation(::Type{FT}, opts) where {FT} z_centers = parent(CC.Fields.coordinate_field(space)) plot_final_aux_profiles(z_centers, aux, precip, output = plot_folder) plot_animation(z_centers, solver, aux, moisture, precip, K1D, output = plot_folder) - #plot_timeheight(string("experiments/KiD_driver/", output_folder, "/Output.nc"), output = plot_folder) + plot_timeheight(string("experiments/KiD_driver/", output_folder, "/Output.nc"), output = plot_folder) end return solver diff --git a/test/plotting_utils.jl b/test/plotting_utils.jl index fb809684..26d0aeb8 100644 --- a/test/plotting_utils.jl +++ b/test/plotting_utils.jl @@ -162,13 +162,13 @@ function plot_timeheight(nc_data_file; output = "output") mkpath(path) ds = NC.NCDataset(joinpath(@__DIR__, nc_data_file)) - t_plt = collect(ds.group["profiles"]["t"]) - z_plt = collect(ds.group["profiles"]["zc"]) - q_tot_plt = collect(ds.group["profiles"]["q_tot"]) - q_liq_plt = collect(ds.group["profiles"]["q_liq"]) - q_ice_plt = collect(ds.group["profiles"]["q_ice"]) - q_rai_plt = collect(ds.group["profiles"]["q_rai"]) - q_sno_plt = collect(ds.group["profiles"]["q_sno"]) + t_plt = Array(ds.group["profiles"]["t"]) + z_plt = Array(ds.group["profiles"]["zc"]) + q_tot_plt = Array(ds.group["profiles"]["q_tot"]) + q_liq_plt = Array(ds.group["profiles"]["q_liq"]) + q_ice_plt = Array(ds.group["profiles"]["q_ice"]) + q_rai_plt = Array(ds.group["profiles"]["q_rai"]) + q_sno_plt = Array(ds.group["profiles"]["q_sno"]) p1 = Plots.heatmap(t_plt, z_plt, q_tot_plt .* 1e3, title = "q_tot [g/kg]", xlabel = "time [s]", ylabel = "z [m]") p2 = Plots.heatmap(t_plt, z_plt, q_liq_plt .* 1e3, title = "q_liq [g/kg]", xlabel = "time [s]", ylabel = "z [m]") p3 = Plots.heatmap(t_plt, z_plt, q_ice_plt .* 1e3, title = "q_ice [g/kg]", xlabel = "time [s]", ylabel = "z [m]") @@ -192,11 +192,11 @@ function plot_timeheight_no_ice_snow(nc_data_file; output = "output") mkpath(path) ds = NC.NCDataset(joinpath(@__DIR__, nc_data_file)) - t_plt = collect(ds.group["profiles"]["t"]) - z_plt = collect(ds.group["profiles"]["zc"]) - q_tot_plt = collect(ds.group["profiles"]["q_tot"]) - q_liq_plt = collect(ds.group["profiles"]["q_liq"]) - q_rai_plt = collect(ds.group["profiles"]["q_rai"]) + t_plt = Array(ds.group["profiles"]["t"]) + z_plt = Array(ds.group["profiles"]["zc"]) + q_tot_plt = Array(ds.group["profiles"]["q_tot"]) + q_liq_plt = Array(ds.group["profiles"]["q_liq"]) + q_rai_plt = Array(ds.group["profiles"]["q_rai"]) p1 = Plots.heatmap(t_plt, z_plt, q_tot_plt .* 1e3, title = "q_tot [g/kg]", xlabel = "time [s]", ylabel = "z [m]") p2 = Plots.heatmap(t_plt, z_plt, q_liq_plt .* 1e3, title = "q_liq [g/kg]", xlabel = "time [s]", ylabel = "z [m]") p3 = Plots.heatmap(t_plt, z_plt, q_rai_plt .* 1e3, title = "q_rai [g/kg]", xlabel = "time [s]", ylabel = "z [m]")