Skip to content

Commit

Permalink
Fix some titles and get the full sea ice diagnostics working again
Browse files Browse the repository at this point in the history
  • Loading branch information
dabail10 committed Jan 14, 2025
1 parent 8464969 commit 44fe9e6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 23 deletions.
8 changes: 4 additions & 4 deletions examples/coupled_model/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ timeseries:
level: 'lev'

ice:
vars: ['hi', 'hs', 'snowfrac', 'Tsfc'] #['process_all']
vars: ['aice','hi', 'hs'] #['process_all']
derive_vars: []
hist_str: 'h'
start_years: [2]
end_years: [102]
start_years: [1]
end_years: [100]
level: 'lev'

glc:
Expand Down Expand Up @@ -196,7 +196,7 @@ book_toc:

- caption: Sea Ice
chapters:
- file: ice/seaice
- file: ice/Hemis_seaice_visual_compare_full

#####################################
# Keys for Jupyter Book _config.yml #
Expand Down
42 changes: 24 additions & 18 deletions nblibrary/ice/Hemis_seaice_visual_compare_full.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"endyr1 = 2013\n",
"begyr2 = 1850\n",
"endyr2 = 2013\n",
"nyears = 35"
"climo_nyears = 35"
]
},
{
Expand Down Expand Up @@ -160,7 +160,7 @@
" + cbegyr1\n",
" + \"01-\"\n",
" + cendyr1\n",
" + \"02.nc\",\n",
" + \"12.nc\",\n",
" data_vars=\"minimal\",\n",
" compat=\"override\",\n",
" coords=\"minimal\",\n",
Expand Down Expand Up @@ -258,8 +258,8 @@
" vmax = cice_vars[var][0][\"levels\"][-1]\n",
" levels = np.array(cice_vars[var][0][\"levels\"])\n",
" title = cice_vars[var][1][\"title\"]\n",
" field1 = ds1_ann[var].isel(time=slice(-nyears, None)).mean(\"time\").squeeze()\n",
" field2 = ds2_ann[var].isel(time=slice(-nyears, None)).mean(\"time\").squeeze()\n",
" field1 = ds1_ann[var].isel(time=slice(-climo_nyears, None)).mean(\"time\").squeeze()\n",
" field2 = ds2_ann[var].isel(time=slice(-climo_nyears, None)).mean(\"time\").squeeze()\n",
" plot_diff(field1, field2, levels, case1, case2, title, \"N\", TLAT, TLON)"
]
},
Expand All @@ -283,8 +283,8 @@
" vmax = cice_vars[var][0][\"levels\"][1]\n",
" levels = np.array(cice_vars[var][0][\"levels\"])\n",
" title = cice_vars[var][1][\"title\"]\n",
" field1 = ds1_ann[var].isel(time=slice(-nyears, None)).mean(\"time\").squeeze()\n",
" field2 = ds2_ann[var].isel(time=slice(-nyears, None)).mean(\"time\").squeeze()\n",
" field1 = ds1_ann[var].isel(time=slice(-climo_nyears, None)).mean(\"time\").squeeze()\n",
" field2 = ds2_ann[var].isel(time=slice(-climo_nyears, None)).mean(\"time\").squeeze()\n",
" plot_diff(field1, field2, levels, case1, case2, title, \"S\", TLAT, TLON)"
]
},
Expand Down Expand Up @@ -644,10 +644,16 @@
"print(ds1[\"aice\"])\n",
"\n",
"aice1_month = (\n",
" ds1[\"aice\"][1535:1955, :, :].groupby(\"time.month\").mean(dim=\"time\", skipna=True)\n",
" ds1[\"aice\"]\n",
" .isel(time=slice(-climo_nyears, None))\n",
" .groupby(\"time.month\")\n",
" .mean(dim=\"time\", skipna=True)\n",
")\n",
"aice2_month = (\n",
" ds2[\"aice\"][923:1343, :, :].groupby(\"time.month\").mean(dim=\"time\", skipna=True)\n",
" ds2[\"aice\"]\n",
" .isel(time=slice(-climo_nyears, None))\n",
" .groupby(\"time.month\")\n",
" .mean(dim=\"time\", skipna=True)\n",
")\n",
"mask_tmp1 = np.where(np.logical_and(aice1_month > 0.15, ds1[\"TLAT\"] > 0), 1.0, 0.0)\n",
"mask_tmp2 = np.where(np.logical_and(aice2_month > 0.15, ds1[\"TLAT\"] > 0), 1.0, 0.0)\n",
Expand Down Expand Up @@ -725,9 +731,9 @@
"ds1_sep = ds1_area.sel(time=(ds1_area.time.dt.month == 9))\n",
"ds2_sep = ds2_area.sel(time=(ds2_area.time.dt.month == 9))\n",
"\n",
"x1 = np.linspace(1850, 2012, 163)\n",
"x2 = np.linspace(1850, 2013, 164)\n",
"x3 = np.linspace(1979, 2014, 36)\n",
"x1 = np.linspace(1, 18, 18)\n",
"x2 = np.linspace(1, 100, 100)\n",
"x3 = np.linspace(1, 36, 36)\n",
"\n",
"plt.plot(x1, ds1_sep)\n",
"plt.plot(x2, ds2_sep)\n",
Expand Down Expand Up @@ -763,9 +769,9 @@
"ds1_sep_sh = ds1_area_sh.sel(time=(ds1_area_sh.time.dt.month == 9))\n",
"ds2_sep_sh = ds2_area_sh.sel(time=(ds2_area_sh.time.dt.month == 9))\n",
"\n",
"x1 = np.linspace(1850, 2013, 163)\n",
"x2 = np.linspace(1850, 2014, 164)\n",
"x3 = np.linspace(1979, 2014, 36)\n",
"x1 = np.linspace(1, 18, 18)\n",
"x2 = np.linspace(1, 100, 100)\n",
"x3 = np.linspace(1, 36, 36)\n",
"\n",
"plt.plot(x1, ds1_sep_sh)\n",
"plt.plot(x2, ds2_sep_sh)\n",
Expand Down Expand Up @@ -827,10 +833,10 @@
},
"outputs": [],
"source": [
"uvel1 = ds1_ann[\"uvel\"].isel(time=slice(-nyears, None)).mean(\"time\").squeeze()\n",
"vvel1 = ds1_ann[\"vvel\"].isel(time=slice(-nyears, None)).mean(\"time\").squeeze()\n",
"uvel2 = ds2_ann[\"uvel\"].isel(time=slice(-nyears, None)).mean(\"time\").squeeze()\n",
"vvel2 = ds2_ann[\"vvel\"].isel(time=slice(-nyears, None)).mean(\"time\").squeeze()\n",
"uvel1 = ds1_ann[\"uvel\"].isel(time=slice(-climo_nyears, None)).mean(\"time\").squeeze()\n",
"vvel1 = ds1_ann[\"vvel\"].isel(time=slice(-climo_nyears, None)).mean(\"time\").squeeze()\n",
"uvel2 = ds2_ann[\"uvel\"].isel(time=slice(-climo_nyears, None)).mean(\"time\").squeeze()\n",
"vvel2 = ds2_ann[\"vvel\"].isel(time=slice(-climo_nyears, None)).mean(\"time\").squeeze()\n",
"\n",
"vect_diff(uvel1, vvel1, uvel2, vvel2, angle, \"N\", case1, case2, TLAT, TLON)"
]
Expand Down
2 changes: 1 addition & 1 deletion nblibrary/ice/Hemis_seaice_visual_compare_obs_lens.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@
"plt.plot(ext2_sh)\n",
"plt.plot(nsidc_clim_sh)\n",
"\n",
"plt.title(\"NH Climatological Seasonal Cycle\")\n",
"plt.title(\"SH Climatological Seasonal Cycle\")\n",
"plt.ylim((0, 25))\n",
"plt.xlabel(\"Month\")\n",
"plt.ylabel(\"Climatological Seasonal Cycle Ice Extent $m x 10^{12}$\")\n",
Expand Down

0 comments on commit 44fe9e6

Please sign in to comment.