# Ask GRASS GIS where its Python packages are.
sys.path.append("grass", "--config", "python_path"], text=True).strip()
subprocess.check_output([
)
# Import the GRASS GIS packages we need.
import grass.script as gs
# Import GRASS Jupyter
import grass.jupyter as gj
Sensitivity Analysis
Combines the output from r.univar
for each model output into a signle dataframe and CSV file for analysis.
= pd.read_csv(os.path.join("output", "combined_stats", 'combined_analysis_7.csv'))
results_df results_df.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 5052 entries, 0 to 5051
Data columns (total 26 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 Unnamed: 0 5052 non-null int64
1 n 5052 non-null int64
2 null_cells 5052 non-null int64
3 cells 5052 non-null int64
4 min 5052 non-null float64
5 max 5052 non-null float64
6 range 5052 non-null float64
7 mean 5052 non-null float64
8 mean_of_abs 5052 non-null float64
9 stddev 5052 non-null float64
10 variance 5052 non-null float64
11 coeff_var 5048 non-null float64
12 sum 5052 non-null float64
13 first_quartile 5052 non-null float64
14 median 5052 non-null float64
15 third_quartile 5052 non-null float64
16 percentiles 5052 non-null object
17 run_time 5052 non-null float64
18 particles 5052 non-null float64
19 area_km2 5052 non-null float64
20 resolution 5052 non-null int64
21 scalar 5052 non-null int64
22 minute 5052 non-null int64
23 stat_type 5052 non-null object
24 ars 5004 non-null float64
25 Location 5052 non-null object
dtypes: float64(16), int64(7), object(3)
memory usage: 1.0+ MB
Extracts the history of each model output step to get values returned by SIMWE.
= pd.read_csv(os.path.join("output", "combined_stats", 'combined_simulations_7.csv'))
model_runs_df model_runs_df.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 8346 entries, 0 to 8345
Data columns (total 25 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 Unnamed: 0 8346 non-null int64
1 init.walk 8346 non-null int64
2 maxwalk 8346 non-null int64
3 remaining walkers 8346 non-null int64
4 duration (sec.) 8346 non-null int64
5 mean man 8346 non-null float64
6 mean infil 8346 non-null float64
7 Location 8346 non-null object
8 map_name 8346 non-null object
9 Cells 8346 non-null int64
10 Min Depth (m) 8346 non-null float64
11 Max Depth (m) 8346 non-null float64
12 Seed 8346 non-null int64
13 Resolution (m) 8346 non-null int64
14 scalar_str 8346 non-null int64
15 Particle Scalar 8346 non-null float64
16 Number of iterations (cells) 8346 non-null int64
17 Mean flow velocity (m/s) 8346 non-null float64
18 Time Step (s) 8346 non-null float64
19 Time at Step (s) 8346 non-null float64
20 Time at Step (min) 8346 non-null float64
21 Mean Source Rate (Rain Fall Excess) (m/s) 8346 non-null float64
22 Compute Time (s) 8346 non-null float64
23 particles 8346 non-null float64
24 Particle Density 8346 non-null float64
dtypes: float64(13), int64(10), object(2)
memory usage: 1.6+ MB
="Resolution (m)", kind="scatter") sns.pairplot(model_runs_df, hue
="Location", kind="scatter") sns.pairplot(model_runs_df, hue
= (results_df.groupby(by=['resolution', 'scalar', 'Location', 'stat_type', 'minute'])
grouped_results_df
.agg({'run_time': 'mean',
'particles': 'mean',
'cells': 'mean',
# 'area_km2': 'max',
# 'p_density': 'max',
# "minute": "mean",
'mean': "mean",
'ars': "mean",
# "std": "mean",
"max": "mean",
"min": "mean",
"stddev": "mean"
})
.reset_index()
)
'log10(particles)'] = np.log10(grouped_results_df['particles'])
grouped_results_df['log10(run_time)'] = np.log10(grouped_results_df['run_time'])
grouped_results_df['log10(ars)'] = np.log10(grouped_results_df['ars'])
grouped_results_df['run_time_min'] = grouped_results_df['run_time'] / 60.0
grouped_results_df[ grouped_results_df.head()
resolution | scalar | Location | stat_type | minute | run_time | particles | cells | mean | ars | max | min | stddev | log10(particles) | log10(run_time) | log10(ars) | run_time_min | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 1 | 1 | SFREC | average | 10 | 2780.749446 | 363592.0 | 491046.0 | 0.011785 | 0.960214 | 1.383436 | 0.000253 | 0.033582 | 5.560614 | 3.444162 | -0.017632 | 46.345824 |
1 | 1 | 1 | SFREC | average | 20 | 2780.749446 | 363592.0 | 491046.0 | 0.013080 | 0.960214 | 2.766822 | 0.000253 | 0.059275 | 5.560614 | 3.444162 | -0.017632 | 46.345824 |
2 | 1 | 1 | SFREC | average | 30 | 2780.749446 | 363592.0 | 491046.0 | 0.014045 | 0.960214 | 3.785676 | 0.000253 | 0.079292 | 5.560614 | 3.444162 | -0.017632 | 46.345824 |
3 | 1 | 1 | SFREC | average | 40 | 2780.749446 | 363592.0 | 491046.0 | 0.014865 | 0.960214 | 4.645530 | 0.000253 | 0.096456 | 5.560614 | 3.444162 | -0.017632 | 46.345824 |
4 | 1 | 1 | SFREC | average | 50 | 2780.749446 | 363592.0 | 491046.0 | 0.015598 | 0.960214 | 5.409575 | 0.000253 | 0.111816 | 5.560614 | 3.444162 | -0.017632 | 46.345824 |
model_runs_df.info()
# grouped_results_df['log10(particles)'] = np.log10(grouped_results_df['particles'])
'log10(Compute Time (s))'] = np.log10(model_runs_df['Compute Time (s)'])
model_runs_df[# grouped_results_df['run_time_min'] = grouped_results_df['run_time'] / 60.0
# grouped_results_df.head()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 8346 entries, 0 to 8345
Data columns (total 25 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 Unnamed: 0 8346 non-null int64
1 init.walk 8346 non-null int64
2 maxwalk 8346 non-null int64
3 remaining walkers 8346 non-null int64
4 duration (sec.) 8346 non-null int64
5 mean man 8346 non-null float64
6 mean infil 8346 non-null float64
7 Location 8346 non-null object
8 map_name 8346 non-null object
9 Cells 8346 non-null int64
10 Min Depth (m) 8346 non-null float64
11 Max Depth (m) 8346 non-null float64
12 Seed 8346 non-null int64
13 Resolution (m) 8346 non-null int64
14 scalar_str 8346 non-null int64
15 Particle Scalar 8346 non-null float64
16 Number of iterations (cells) 8346 non-null int64
17 Mean flow velocity (m/s) 8346 non-null float64
18 Time Step (s) 8346 non-null float64
19 Time at Step (s) 8346 non-null float64
20 Time at Step (min) 8346 non-null float64
21 Mean Source Rate (Rain Fall Excess) (m/s) 8346 non-null float64
22 Compute Time (s) 8346 non-null float64
23 particles 8346 non-null float64
24 Particle Density 8346 non-null float64
dtypes: float64(13), int64(10), object(2)
memory usage: 1.6+ MB
="darkgrid")
sns.set_theme(style"talk")
sns.set_context("crest", as_cmap=True)
sns.color_palette(= plt.subplots(figsize=(12, 8))
fig, ax
sns.lineplot(=model_runs_df,
data="particles",
x="init.walk",
y="Location",
hue="Resolution (m)",
style# size="scalar",
="bars",
err_style# errorbar=("se", 2),
="magma",
palette=True,
markers=0.75,
alpha=('ci', 95),
errorbar
)"upper left", bbox_to_anchor=(1, 1))
sns.move_legend(ax, "nwalk", fontsize=26)
plt.xlabel("init.walk", fontsize=26)
plt.ylabel(# plt.title("Resolution vs Run Time")
f"../output/nwalk_init_walk.png") plt.savefig(
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):

="darkgrid")
sns.set_theme(style"talk")
sns.set_context("crest", as_cmap=True)
sns.color_palette(= plt.subplots(figsize=(12, 8))
fig, ax
sns.lineplot(=model_runs_df,
data="Resolution (m)",
x="log10(Compute Time (s))",
y="Location",
hue="Particle Density",
style# size="scalar",
="bars",
err_style# errorbar=("se", 2),
="magma",
palette=True,
markers=0.75,
alpha=('ci', 95),
errorbar
)"upper left", bbox_to_anchor=(1, 1))
sns.move_legend(ax, "Resolution (m)", fontsize=26)
plt.xlabel("log10(Compute Time (s))", fontsize=26)
plt.ylabel(# plt.title("Resolution vs Run Time")
f"../output/compute_time_by_resolution.png") plt.savefig(
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):

="darkgrid")
sns.set_theme(style"talk")
sns.set_context("crest", as_cmap=True)
sns.color_palette(= plt.subplots(figsize=(12, 8))
fig, ax # model_runs_df['log10(run_time)'] = np.log10(model_runs_df['run_time'])
sns.lineplot(=model_runs_df,
data="Particle Density",
x="log10(Compute Time (s))",
y="Location",
hue="Resolution (m)",
style# size="AR",
="bars",
err_style# errorbar=("se", 2),
="magma",
palette=True,
markers=0.75,
alpha=('ci', 95),
errorbar
)"upper left", bbox_to_anchor=(1, 1))
sns.move_legend(ax, # g = sns.JointGrid(data=model_runs_df, x="Particle Density", y="log10(run_time)", space=0)
# g.plot_joint(sns.kdeplot,
# fill=True, clip=((0, 3), (-2.0, 3.0)),
# thresh=0, levels=100, cmap="rocket")
# g.plot_marginals(sns.histplot, palette="rocket", hue="Location", alpha=1, bins=25, data=model_runs_df)
0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2])
plt.xticks(["Particle Density", fontsize=26)
plt.xlabel("log10(Compute Time (s))", fontsize=26)
plt.ylabel(f"../output/compute_time_by_particle_density.png") plt.savefig(
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):

="darkgrid")
sns.set_theme(style"talk")
sns.set_context("crest", as_cmap=True)
sns.color_palette(= plt.subplots(figsize=(12, 8))
fig, ax
sns.lineplot(=model_runs_df,
data="Time at Step (min)",
x="Max Depth (m)",
y="Location",
hue="Resolution (m)",
style="Resolution (m)",
size="bars",
err_style# errorbar=("se", 2),
="magma",
palette=True,
markers=0.75,
alpha=('ci', 95),
errorbar
)"upper left", bbox_to_anchor=(1, 1))
sns.move_legend(ax, "Time at Step (min)", fontsize=26)
plt.xlabel("Max Depth (m)", fontsize=26)
plt.ylabel(# plt.title("Simulation Time Step vs Max Water Depth")
f"../output/simulated_timestep_max_water_depth.png") plt.savefig(
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):

="darkgrid")
sns.set_theme(style"paper")
sns.set_context("crest", as_cmap=True)
sns.color_palette(= sns.catplot(
g =model_runs_df,
data="Time at Step (min)",
x="Mean flow velocity (m/s)",
y="Location",
hue="Particle Density",
col="Resolution (m)",
row="YlGnBu_d",
palette=False,
sharex=False,
sharey# errorbar="se",
="strip",
kind=6, aspect=.75,
height
)=True) g.despine(left
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/axisgrid.py:118: UserWarning: The figure layout has changed to tight
self._figure.tight_layout(*args, **kwargs)

="darkgrid")
sns.set_theme(style"paper")
sns.set_context("crest", as_cmap=True)
sns.color_palette(= plt.subplots(figsize=(12, 8))
fig, ax
sns.lineplot(=results_df,
data="resolution",
x="run_time",
y="Location",
hue="scalar",
style# size="scalar",
="bars", errorbar=("se", 2),
err_style="magma",
palette=True,
markers=0.75,
alpha# errorbar=('ci', 95),
)"Resolution vs Run Time") plt.title(
="darkgrid")
sns.set_theme(style"paper")
sns.set_context("crest", as_cmap=True)
sns.color_palette(= plt.subplots(figsize=(12, 8))
fig, ax
sns.lineplot(=results_df,
data="scalar",
x="run_time",
y="Location",
hue="resolution",
style# size="scalar",
="bars", #errorbar=("se", 2),
err_style="magma",
palette=True,
markers=0.75,
alpha=('ci', 95),
errorbar
)"Particles Density vs Run Time")
plt.title(# plt.savefig(f"../output/agu2024_particles_run_time.png")
="darkgrid")
sns.set_theme(style"paper")
sns.set_context("crest", as_cmap=True)
sns.color_palette(# fig, ax = plt.subplots(figsize=(12, 8))
sns.relplot(=results_df, x="resolution", y="run_time",
data="Location",
col="Location", style="scalar",
hue="line"
kind
)
# sns.lineplot(
# data=grouped_results_df,
# x="scalar",
# y="run_time",
# hue="site_name",
# style="resolution",
# # size="scalar",
# err_style="bars", #errorbar=("se", 2),
# palette="magma",
# markers=True,
# alpha=0.75,
# errorbar=('ci', 95),
# )
"Particles Density vs Run Time") plt.title(
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/_oldcore.py:1119: FutureWarning: use_inf_as_na option is deprecated and will be removed in a future version. Convert inf values to NaN before operating instead.
with pd.option_context('mode.use_inf_as_na', True):
/home/coreywhite/.local/lib/python3.10/site-packages/seaborn/axisgrid.py:118: UserWarning: The figure layout has changed to tight
self._figure.tight_layout(*args, **kwargs)
Text(0.5, 1.0, 'Particles Density vs Run Time')

sns.relplot(=results_df, x="particles", y="run_time",
data="Location",
col="Location", style="scalar",
hue="line"
kind )
="darkgrid")
sns.set_theme(style"talk")
sns.set_context("crest", as_cmap=True)
sns.color_palette(= plt.subplots(figsize=(12, 8))
fig, ax # sns.lineplot(
# data=grouped_results_df.query("stat_type == 'average'"),
# # x="p_density",
# x="ars",
# y="max",
# # y="run_time_min",
# hue="site_name",
# size="scalar",
# palette="crest_r",
# markers=True,
# # style='resolution',
# alpha=0.75,
# errorbar=('ci', 95)
# )
# ax2 = plt.twinx()
sns.lineplot(=grouped_results_df.query("stat_type == 'average'"),
data# x="p_density",
="ars",
x="run_time",
y# y="run_time_min",
="Location",
hue# size="resolution",
="magma",
palette=True,
markers='resolution',
style=0.75,
alpha=('ci', 95),
errorbar# ax=ax2
)"ARS", fontsize=26)
plt.xlabel("Compute Time (s)", fontsize=26)
plt.ylabel(# plt.title("Run time vs. ARS", fontsize=32)
# plt.legend(title="Particle Density", fontsize=18)
"upper left", bbox_to_anchor=(1.25,1))
sns.move_legend(ax, # sns.move_legend(ax2, "upper left", bbox_to_anchor=(1.25,0.25))
# ax2.set_ylabel("Resolution (m)", fontsize=26)
# plt.savefig(os.path.join("../output", site, mapset, f'{site}_run_time_res_line_plot.png'))
f"../output/sensitivity7_run_time_ars_plot.png")
plt.savefig( plt.show()
# g = sns.JointGrid(data=grouped_results_df.query("stat_type == 'average'"), x="ars", y="run_time", space=0)
# g.plot_joint(sns.kdeplot,
# fill=True, clip=((0, 3), (0, 200)),
# thresh=0, levels=100, cmap="rocket")
# g.plot_marginals(sns.histplot, color="#03051A", alpha=1, bins=25)
# Plot sepal width as a function of sepal_length across days
= sns.lmplot(
g =grouped_results_df.query("stat_type == 'average'"),
data="ars", y="run_time", hue="Location",
x=5
height
)
# Use more informative axis labels than are provided by default
"ARS", "Compute Time (Sec)") g.set_axis_labels(
="darkgrid")
sns.set_theme(style"talk")
sns.set_context("crest", as_cmap=True)
sns.color_palette(= plt.subplots(figsize=(12, 8))
fig, ax =True, bottom=True)
sns.despine(fig, left# scalar_ranking = ["I1", "SI2", "SI1", "VS2", "VS1", "VVS2", "VVS1", "IF"]
sns.scatterplot(# x="ars",
# y="run_time",
="log10(ars)",
x="log10(run_time)",
y="Location", size="resolution",
hue="scalar",
style# palette="ch:r=-.2,d=.3_r",
="magma",
palette# hue_order=clarity_ranking,
=(10, 50), linewidth=0,
sizes=grouped_results_df.query("stat_type == 'average'"), ax=ax
data
)
# sns.regplot(
# data=grouped_results_df.query("stat_type == 'average' and Location == 'clay-center'"),
# x="ars",
# y="run_time",
# order=2,
# color="black",
# ci=95,
# scatter=False,
# line_kws=dict(linewidth=1, linestyle="--"),
# )
# sns.regplot(
# data=grouped_results_df.query("stat_type == 'average' and Location == 'coweeta'"),
# x="ars",
# y="run_time",
# order=2,
# color="black",
# ci=95,
# scatter=False,
# line_kws=dict(linewidth=1, linestyle="--"),
# )
# sns.regplot(
# data=grouped_results_df.query("stat_type == 'average' and Location == 'SJER'"),
# x="ars",
# y="run_time",
# order=2,
# color="black",
# ci=95,
# scatter=False,
# line_kws=dict(linewidth=1, linestyle="--"),
# )
"upper left", bbox_to_anchor=(1, 1))
sns.move_legend(ax,
"ARS", fontsize=26)
plt.xlabel("log10(Compute Time (Sec))", fontsize=26)
plt.ylabel(f"../output/sensitivity7_ars_run_time_loc_res_scalar_plot.png") plt.savefig(
="darkgrid")
sns.set_theme(style"talk")
sns.set_context("crest", as_cmap=True)
sns.color_palette(= plt.subplots(figsize=(12, 8))
fig, ax
sns.lineplot(=grouped_results_df,
data="log10(particles)",
x="log10(run_time)",
y="Location",
hue# size="resolution",
="resolution",
style# weights="error",
="magma",
palette=True,
markers=0.75,
alpha=('ci', 95),
errorbar
)"log10(Particles)", fontsize=26)
plt.xlabel("log10(Compute Time (s))", fontsize=26)
plt.ylabel("upper left", bbox_to_anchor=(1, 1))
sns.move_legend(ax,
# plt.title("Particles vs Run Time")
# plt.savefig(f"../output/agu2024_particles_run_time.png")
f"../output/particles_run_time.png") plt.savefig(
="darkgrid")
sns.set_theme(style"talk")
sns.set_context("crest", as_cmap=True)
sns.color_palette(= plt.subplots(figsize=(12, 8))
fig, ax
sns.lineplot(=grouped_results_df,
data="cells",
x="log10(particles)",
y="Location",
hue="scalar",
style="magma",
palette=True,
markers=0.75,
alpha=('ci', 95),
errorbar
)"upper left", bbox_to_anchor=(1, 1))
sns.move_legend(ax,
"Particles vs Resolution")
plt.title(# plt.savefig(f"../output/agu2024_particles_resolution.png")
="darkgrid")
sns.set_theme(style"talk")
sns.set_context("crest", as_cmap=True)
sns.color_palette(= plt.subplots(figsize=(12, 8))
fig, ax
sns.lineplot(=grouped_results_df.query("stat_type == 'average'"),
data="log10(particles)",
x="log10(run_time)",
y="cells",
hue="Location",
style# size="scalar",
="magma_r",
palette=True,
markers=0.75,
alpha=('ci', 95),
errorbar
)"upper left", bbox_to_anchor=(1, 1))
sns.move_legend(ax, "log10(Particles)", fontsize=26)
plt.xlabel("log10(Compute Time (s))", fontsize=26)
plt.ylabel(# plt.title("ARS vs log10(Run Time)")
f"../output/agu2024_ars_run_time.png") plt.savefig(
="darkgrid")
sns.set_theme(style"talk")
sns.set_context("crest", as_cmap=True)
sns.color_palette(= plt.subplots(figsize=(12, 8))
fig, ax
sns.lineplot(=grouped_results_df.query("stat_type == 'average'"),
data="log10(particles)",
x="max",
y="Location",
hue# style="minute",
="magma_r",
palette=True,
markers=0.75,
alpha=('ci', 95),
errorbar
)"upper left", bbox_to_anchor=(1, 1))
sns.move_legend(ax,
"log10(particles) by Max Depth") plt.title(
="darkgrid")
sns.set_theme(style"talk")
sns.set_context("crest", as_cmap=True)
sns.color_palette(= plt.subplots(figsize=(12, 8))
fig, ax
sns.lineplot(=grouped_results_df.query("stat_type == 'average'"),
data=grouped_results_df.query("stat_type == 'average'")["minute"].astype(int),
x="mean",
y="Location",
hue="resolution",
style="resolution",
size="magma",
palette=True,
markers=0.75,
alpha=('ci', 95),
errorbar
)# plt.title("Mean Depth by Output Step")
"Output Step (Minutes)", fontsize=26)
plt.xlabel("Mean Depth (m)", fontsize=26)
plt.ylabel("upper left", bbox_to_anchor=(1, 1))
sns.move_legend(ax,
f"../output/agu2024_minute_mean_resolution.png") plt.savefig(
="darkgrid")
sns.set_theme(style"talk")
sns.set_context("crest", as_cmap=True)
sns.color_palette(= plt.subplots(figsize=(12, 8))
fig, ax
sns.lineplot(=grouped_results_df.query("stat_type == 'maximum'"),
data=grouped_results_df.query("stat_type == 'maximum'")["minute"].astype(int),
x="mean",
y="Location",
hue="resolution",
size="resolution",
style="magma",
palette=True,
markers=0.75,
alpha=('ci', 95),
errorbar
)"Output Step (Minutes)", fontsize=26)
plt.xlabel("Maximum Depth (m)", fontsize=26)
plt.ylabel("upper left", bbox_to_anchor=(1, 1))
sns.move_legend(ax,
# plt.title("Maximum Depth by Output Step")
f"../output/agu2024_minute_max_resolution.png") plt.savefig(
="darkgrid")
sns.set_theme(style"paper")
sns.set_context("crest", as_cmap=True)
sns.color_palette(= plt.subplots(figsize=(12, 8))
fig, ax
sns.lineplot(=grouped_results_df.query("stat_type == 'minimum'"),
data=grouped_results_df.query("stat_type == 'minimum'")["minute"].astype(int),
x="mean",
y="Location",
hue="resolution",
style="resolution",
size="magma",
palette=True,
markers=0.75,
alpha=('ci', 95),
errorbar
)# plt.title("Min Depth by Time Step")
"Output Step (Minutes)", fontsize=26)
plt.xlabel("Minimum Depth (m)", fontsize=26)
plt.ylabel("upper left", bbox_to_anchor=(1, 1))
sns.move_legend(ax,
f"../output/agu2024_minute_min_resolution.png") plt.savefig(
="darkgrid")
sns.set_theme(style"talk")
sns.set_context("crest", as_cmap=True)
sns.color_palette(= plt.subplots(figsize=(12, 8))
fig, ax
sns.lineplot(=grouped_results_df.query("stat_type == 'stddev'"),
data=grouped_results_df.query("stat_type == 'stddev'")["minute"].astype(int),
x="mean",
y="Location",
hue="resolution",
style="resolution",
size="magma",
palette=True,
markers=0.75,
alpha=('ci', 95),
errorbar
)"Stddev Depth by Time Step")
plt.title("upper left", bbox_to_anchor=(1, 1))
sns.move_legend(ax,
f"../output/agu2024_minute_std_resolution.png") plt.savefig(
="darkgrid")
sns.set_theme(style"paper")
sns.set_context("crest", as_cmap=True)
sns.color_palette(= plt.subplots(figsize=(12, 8))
fig, ax
sns.lineplot(=grouped_results_df.query("stat_type == 'average' & Location == 'clay-center'"),
data=grouped_results_df.query("stat_type == 'average' & Location == 'clay-center'")["minute"].astype(int),
x="mean",
y="resolution",
hue# style="resolution",
="scalar",
size="summer",
palette=True,
markers=0.75,
alpha=('ci', 95),
errorbar
)
sns.lineplot(=grouped_results_df.query("stat_type == 'average' & Location == 'SJER'"),
data=grouped_results_df.query("stat_type == 'average' & Location == 'SJER'")["minute"].astype(int),
x="mean",
y="resolution",
hue# style="scalar",
="scalar",
size="cool",
palette=True,
markers=0.75,
alpha=('ci', 95),
errorbar
)"Min Depth by Time Step")
plt.title(f"../output/agu2024_minute_average_scalar.png") plt.savefig(