From fc91d28d66671de71dcedf46ed41daab96f56596 Mon Sep 17 00:00:00 2001 From: nefrathenrici Date: Thu, 1 Feb 2024 15:40:18 -0800 Subject: [PATCH] a bit more readable --- post_processing/ci_plots.jl | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/post_processing/ci_plots.jl b/post_processing/ci_plots.jl index 82ad63daf9e..4ba0c06780e 100644 --- a/post_processing/ci_plots.jl +++ b/post_processing/ci_plots.jl @@ -686,13 +686,15 @@ function pair_edmf_names(short_names) for name in short_names up_index = findfirst(x -> x == name * "up", short_names) + dn_index = + findfirst(x -> x == replace(name, "up" => ""), short_names) + # Only updraft name if endswith(name, "up") - dn_index = - findfirst(x -> x == replace(name, "up" => ""), short_names) - # Check for updraft vars with no gridmean pair isnothing(dn_index) && push!(grouped_vars, tuple(name)) + # Only gridmean name elseif isnothing(up_index) push!(grouped_vars, tuple(name)) + # Pair gridmean/updraft name else push!(grouped_vars, tuple(name, short_names[up_index])) end @@ -730,18 +732,12 @@ function make_plots(::EDMFBoxPlots, simulation_path) short_name_tuples = pair_edmf_names(short_names) var_groups_zt = [ - tuple( - collect( - slice( - get(simdir; short_name, reduction, period), - x = 0.0, - y = 0.0, - ) for short_name in var_names - )..., + ( + slice(get(simdir; short_name, reduction, period), x = 0.0, y = 0.0) for short_name in var_names ) for var_names in short_name_tuples ] var_groups_z = [ - tuple(collect(slice(v, time = LAST_SNAP) for v in group)...) for + (collect(slice(v, time = LAST_SNAP) for v in group)...,) for group in var_groups_zt ] @@ -779,18 +775,16 @@ function make_plots(::EDMFSpherePlots, simulation_path) short_name_tuples = pair_edmf_names(short_names) var_groups_zt = [ - tuple( - collect( - slice( - get(simdir; short_name, reduction, period), - lon = 0.0, - lat = lat, - ) for short_name in var_names - )..., + ( + slice( + get(simdir; short_name, reduction, period), + lon = 0.0, + lat = lat, + ) for short_name in var_names ) for lat in latitudes, var_names in short_name_tuples ] var_groups_z = [ - tuple(collect(slice(v, time = LAST_SNAP) for v in group)...) for + (collect(slice(v, time = LAST_SNAP) for v in group)...,) for group in var_groups_zt ]