Skip to content

Commit

Permalink
Analysis of experiments
Browse files Browse the repository at this point in the history
  • Loading branch information
Pperezhogin committed Jan 16, 2025
1 parent f234a19 commit 6567b0d
Show file tree
Hide file tree
Showing 12 changed files with 3,576 additions and 3,321 deletions.
41 changes: 38 additions & 3 deletions experiments/ANN-Results/helpers_mom6/collection_of_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,9 @@ def plot_ssh(self, exps, labels=None, target=None, ncols=3):
label = 'SSH error [m]'
lines = False
ssh.plot.contourf(levels=levels, cmap='bwr', linewidths=1, extend='both', cbar_kwargs={'label': label})
if lines:
Cplot = ssh.plot.contour(levels=levels, colors='k', linewidths=1)
plt.gca().clabel(Cplot, Cplot.levels)
#if lines:
# Cplot = ssh.plot.contour(levels=levels, colors='k', linewidths=1)
# plt.gca().clabel(Cplot, Cplot.levels)
plt.xticks((0, 5, 10, 15, 20))
plt.yticks((30, 35, 40, 45, 50))
plt.xlabel('Longitude')
Expand All @@ -255,6 +255,41 @@ def plot_ssh(self, exps, labels=None, target=None, ncols=3):

plt.tight_layout()

def plot_SGSmean(self, exps, labels=None, target=None, ncols=3, zl=0):
if labels is None:
labels=exps
nfig = len(exps)
ncol = min(ncols,nfig)
nrows = nfig / ncols
if nrows > 1:
nrows = int(np.ceil(nrows))
else:
nrows = 1

plt.figure(figsize=(5*ncol,4*nrows))
plt.subplots_adjust(hspace=0.3, wspace=0.3)

for ifig, exp in enumerate(exps):
plt.subplot(nrows,ncol,ifig+1)
try:
data = self[exp].SGS_mean.isel(zl=zl) * 1e+7

cmap = plt.cm.seismic
vmin,vmax,ci = -1.45,1.45,0.1
cilev = np.arange(vmin,vmax+ci,ci)
norm = plt.matplotlib.colors.BoundaryNorm(boundaries=cilev, ncolors=cmap.N)

label = 'Time-mean zonal acceleration\n by subgrid eddies, $10^{-7}\mathrm{m}\mathrm{s}^{-2}$'
data.plot.pcolormesh(cmap=cmap, norm=norm, cbar_kwargs={'label': label})
plt.xticks((0, 5, 10, 15, 20))
plt.yticks((30, 35, 40, 45, 50))
plt.xlabel('Longitude')
plt.ylabel('Latitude')
plt.title(labels[ifig])
except:
pass
plt.tight_layout()

def plot_ssh_std(self, exps, labels=None, target='R64_R2', ncols=3):
if labels is None:
labels=exps
Expand Down
4 changes: 4 additions & 0 deletions experiments/ANN-Results/helpers_mom6/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ def h_mean(self):
@netcdf_property
def e_mean(self):
return self.ea.sel(Time=self.Averaging_time).mean(dim='Time')

@netcdf_property
def SGS_mean(self):
return self.mom.ZB2020u.sel(Time=self.Averaging_time).mean(dim='Time')

def average(self, prop):
return eval(f'self.{prop}').sel(Time=self.Averaging_time).mean(dim='Time')
Expand Down
542 changes: 542 additions & 0 deletions experiments/ANN-Results/notebooks-paper/1-check-fluxes.ipynb

Large diffs are not rendered by default.

863 changes: 863 additions & 0 deletions experiments/ANN-Results/notebooks-paper/1-offline.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2150,7 +2150,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
"version": "3.11.11"
}
},
"nbformat": 4,
Expand Down
598 changes: 529 additions & 69 deletions experiments/ANN-Results/offline_analysis/16-online-generalization.ipynb

Large diffs are not rendered by default.

3,972 changes: 1,305 additions & 2,667 deletions experiments/ANN-Results/offline_analysis/28-update-dataset.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit 6567b0d

Please sign in to comment.