Skip to content

Commit

Permalink
rico series compariso update'
Browse files Browse the repository at this point in the history
git pc
  • Loading branch information
pdziekan committed Dec 12, 2022
1 parent e2033e4 commit e4a1110
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 31 deletions.
14 changes: 14 additions & 0 deletions Matplotlib_common/latex_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"T" : "T [K]",
"rv" : "$q_v$ [g/kg]",
"RH" : "RH",
"RH_max" : "RH max",
"S_drop" : "$S_{drop}$",
"Sigma2_S" : "$S$ variance",
"Sigma2_S_drop" : "$S_{drop}$ variance",
Expand All @@ -30,8 +31,10 @@
"surf_precip" : 'Surf. precip. [mm/day]',
"acc_precip" : 'Acc. precip. [mm]',
"cl_nc" : '$N_c$ [cm$^{-3}$]',
"cl_nc_rico" : '$N_c$ [cm$^{-3}$]',
# "cl_nr" : '$N_{r>25\mu m}$ [cm$^{-3}$]',
"cl_nr" : '$N_{r}$ [cm$^{-3}$]',
"cl_nr_rico" : '$N_{r}$ [cm$^{-3}$]',
"cl_gccn_conc" : '$N_{GCCN}$ [cm$^{-3}$]',
"thl" : r'$\theta_l$ [K]',
"00rtot" : '$q_{t}$ [g/kg]',
Expand Down Expand Up @@ -63,6 +66,9 @@
"cl_accr25_rico" : 'accr. rate [g m$^{-3}$ d$^{-1}$]',
"cl_acnv25_dycoms" : 'acnv. rate [g m$^{-3}$ d$^{-1}$]',
"cl_accr25_dycoms" : 'accr. rate [g m$^{-3}$ d$^{-1}$]',
"cloud_avg_supersat" : '$<S>$ in cloud [\%]',
"cl_meanr" : '$<r>$ in cloud [um]',
"sd_conc" : '$<SD>$'
}


Expand All @@ -79,4 +85,12 @@
9 : "(j)",
10 : "(k)",
11 : "(l)",
12 : "(m)",
13 : "(n)",
14 : "(o)",
15 : "(p)",
16 : "(q)",
17 : "(r)",
18 : "(s)",
19 : "(t)",
}
10 changes: 4 additions & 6 deletions Matplotlib_common/read_UWLCM_arrays.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
import numpy as np

def read_my_array(file_obj):
arr_name = file_obj.readline()
file_obj.readline() # discarded line with size of the array
line = file_obj.readline()
line = line.split(" ")
del line[0]
del line[len(line)-1]
arr = list(map(float,line))
return np.array(arr), arr_name
return np.array(arr)

def read_my_var(file_obj, var_name):
file_obj.seek(0)
while True:
arr, name = read_my_array(file_obj)
if(str(name).strip() == str(var_name).strip()):
break
return arr
arr_name = file_obj.readline()
if(str(arr_name).strip() == str(var_name).strip()):
return read_my_array(file_obj)

#def plot_my_array(axarr, plot_iter, time, val, nploty, xlabel=None, ylabel=None, varlabel=None , linestyle='--', dashes=(5,2), xlim=None, ylim=None, xscale="linear", yscale="linear"):
# x = int(plot_iter / nploty)
Expand Down
4 changes: 2 additions & 2 deletions cases/RICO11/Rico_series_comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
# activate latex text rendering
rc('text', usetex=True)

rico_vars = ["lwp", "rwp", "cloud_cover_rico", "min_cloud_base_rico", "inversion_height_rico", "cl_nc", "cl_nr", "surf_precip", "acc_precip", "cl_acnv25_rico", "cl_accr25_rico"]#, "surf_flux_latent", "surf_flux_sensible" ]
rico_vars = ["lwp", "rwp", "cloud_cover_rico", "min_cloud_base_rico", "inversion_height_rico", "cl_nc_rico", "cl_nr_rico", "surf_precip", "acc_precip", "RH_max", "cloud_avg_supersat", "wvarmax", "cl_meanr", "sd_conc"]#, "cl_acnv25_rico", "cl_accr25_rico"]#, "surf_flux_latent", "surf_flux_sensible" ]
#rico_vars = ["clb_bigrain_mean_rd","clb_bigrain_mean_kappa","clb_bigrain_mean_conc","clb_bigrain_mean_inclt", "cl_nr"]

# variables that need rescaling of the yrange to the limited x range of 1-6h
rescale_vars = ["lwp", "cloud_cover_rico", "min_cloud_base_rico", "inversion_height_rico", "cl_nc"]# rico_vars

# init the plot
nplotx = 3
nplotx = 4
nploty= 4
fig, axarr = plt.subplots(nplotx,nploty)
x_arr = np.arange(nplotx)
Expand Down
82 changes: 59 additions & 23 deletions cases/RICO11/plot_ranges.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"prflux" : "linear",
"cl_nc" : "linear",
"cl_nr" : "linear",
"cl_nc_rico" : "linear",
"cl_nr_rico" : "linear",
"clfrac" : "linear",
"wvar" : "linear",
"w3rd" : "linear",
Expand Down Expand Up @@ -32,6 +34,10 @@
"inversion_height_rico" : "linear",
"cl_acnv25_rico" : "linear",
"cl_accr25_rico" : "linear",
"RH_max" : "linear",
"cloud_avg_supersat" : "linear",
"cl_meanr" : "linear",
"sd_conc" : "linear",
}

yscaledict = {
Expand All @@ -41,6 +47,8 @@
"prflux" : "linear",
"cl_nc" : "linear",
"cl_nr" : "linear",
"cl_nc_rico" : "linear",
"cl_nr_rico" : "linear",
"clfrac" : "linear",
"wvar" : "linear",
"w3rd" : "linear",
Expand Down Expand Up @@ -68,6 +76,10 @@
"inversion_height_rico" : "linear",
"cl_acnv25_rico" : "linear",
"cl_accr25_rico" : "linear",
"RH_max" : "linear",
"cloud_avg_supersat" : "linear",
"cl_meanr" : "linear",
"sd_conc" : "linear",
}

xlimdict_profs = {
Expand All @@ -77,6 +89,8 @@
"prflux" : None,#(0,20),
"cl_nc" : None,#(0,90),
"cl_nr" : None,#(0,90),
"cl_nc_rico" : None,#(0,90),
"cl_nr_rico" : None,#(0,90),
"clfrac" : None,
"wvar" : None,
"w3rd" : None,
Expand All @@ -85,7 +99,11 @@
"gccn_rw_cl" : None,#(0,90),
"non_gccn_rw_cl" : None,#(0,12),
"base_prflux_vs_clhght" : None,#(1,10000)
"base_prflux_vs_clhght number of occurances" : None#(1,10000)
"base_prflux_vs_clhght number of occurances" : None,#(1,10000)
"RH_max" : None,
"cloud_avg_supersat" : None,
"cl_meanr" : None,
"sd_conc" : None,
}

ylimdict_profs = {
Expand All @@ -95,6 +113,8 @@
"prflux" : (0,3000),
"cl_nc" : (0,3000),
"cl_nr" : (0,3000),
"cl_nc_rico" : (0,3000),
"cl_nr_rico" : (0,3000),
"clfrac" : (0,3000),
"wvar" : (0,3000),
"w3rd" : (0,3000),
Expand All @@ -103,37 +123,49 @@
"gccn_rw_cl" : (0,3000),
"non_gccn_rw_cl" : (0,3000),
"base_prflux_vs_clhght" : (0,2500),
"base_prflux_vs_clhght number of occurances" : (0,2500)
"base_prflux_vs_clhght number of occurances" : (0,2500),
"RH_max" : (0,3000),
"cloud_avg_supersat" : (0,3000),
"cl_meanr" : (0,3000),
"sd_conc" : (0,3000),
}

xlimdict_series = {
"clfrac" : (2,10),
"cl_nc" : (2,10),
"cl_nr" : (2,10),
"lwp" : (2,10),
"rwp" : (2,10),
"er" : (2,10),
"wvarmax" : (2,10),
"surf_precip" : (2,10),
"acc_precip" : (2,10),
"cl_gccn_conc" : (2,10),
"cloud_base" : (2,10),
"clb_bigrain_mean_rd" : (2,10),
"clb_bigrain_mean_kappa" : (2,10),
"clb_bigrain_mean_conc" : (2,10),
"clb_bigrain_mean_inclt" : (2,10),
"clb_bigrain_mean_gccn_fraction" : (2,10),
"cloud_cover_rico" : (2,10),
"min_cloud_base_rico" : (2,10),
"inversion_height_rico" : (2,10),
"cl_acnv25_rico" : (2,10),
"cl_accr25_rico" : (2,10),
"clfrac" : (0,5),
"cl_nc" : (0,5),
"cl_nr" : (0,5),
"cl_nc_rico" : (0,5),
"cl_nr_rico" : (0,5),
"lwp" : (0,5),
"rwp" : (0,5),
"er" : (0,5),
"wvarmax" : (0,5),
"surf_precip" : (0,5),
"acc_precip" : (0,5),
"cl_gccn_conc" : (0,5),
"cloud_base" : (0,5),
"clb_bigrain_mean_rd" : (0,5),
"clb_bigrain_mean_kappa" : (0,5),
"clb_bigrain_mean_conc" : (0,5),
"clb_bigrain_mean_inclt" : (0,5),
"clb_bigrain_mean_gccn_fraction" : (0,5),
"cloud_cover_rico" : (0,5),
"min_cloud_base_rico" : (0,5),
"inversion_height_rico" : (0,5),
"cl_acnv25_rico" : (0,5),
"cl_accr25_rico" : (0,5),
"RH_max" : (0,5),
"cloud_avg_supersat" : (0,5),
"cl_meanr" : (0,5),
"sd_conc" : (0,5),
}

ylimdict_series = {
"clfrac" : None,
"cl_nc" : None,#(-1,155),
"cl_nr" : None,#(-0.02,.55),
"cl_nc_rico" : None,#(-1,155),
"cl_nr_rico" : None,#(-0.02,.55),
"lwp" : None,#(-1,45),
"rwp" : None,#(-1,15),
"er" : None,
Expand All @@ -152,4 +184,8 @@
"inversion_height_rico" : None,#(1000,3000),
"cl_acnv25_rico" : None,
"cl_accr25_rico" : None,
"RH_max" : None,
"cloud_avg_supersat" : None,
"cl_meanr" : None,
"sd_conc" : None,
}

0 comments on commit e4a1110

Please sign in to comment.