Skip to content

Commit

Permalink
fix rmse
Browse files Browse the repository at this point in the history
  • Loading branch information
malmans2 committed Oct 9, 2023
1 parent d1941a5 commit 92cb912
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions notebooks/wp4/cmip6_sea_ice_evaluation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
" \"kiost_esm\",\n",
" \"miroc6\",\n",
" \"miroc_es2l\",\n",
" # \"mpi_esm1_2_hr\", # TODO: Memory error\n",
" \"mpi_esm1_2_hr\", # TODO: Memory error\n",
" \"mpi_esm1_2_lr\",\n",
" \"mri_esm2_0\",\n",
" \"nesm3\",\n",
Expand Down Expand Up @@ -257,17 +257,21 @@
"\n",
"\n",
"def get_monthly_interpolated_data(ds, add_stde, check_values, **regrid_kwargs):\n",
" std_names = [\"latitude\", \"longitude\", \"sea_ice_area_fraction\"]\n",
" if add_stde:\n",
" std_names.append(\"sea_ice_area_fraction standard_error\")\n",
" ds = ds.cf[std_names].cf.reset_coords(std_names[2:])\n",
" stde = ds.cf[\"sea_ice_area_fraction standard_error\"]\n",
"\n",
" ds = ds.cf[[\"latitude\", \"longitude\", \"sea_ice_area_fraction\"]]\n",
"\n",
" if regrid_kwargs:\n",
" ds = interpolate_to_satellite_grid(ds, **regrid_kwargs)\n",
"\n",
" ds = ds.sortby(\"time\").resample(time=\"MS\").mean()\n",
" ds[\"time\"].attrs[\"long_name\"] = \"time\"\n",
"\n",
" if add_stde:\n",
" with xr.set_options(keep_attrs=True):\n",
" ds = ds.merge((stde**2).resample(time=\"MS\").mean() ** (1 / 2))\n",
"\n",
" if check_values:\n",
" ds = ds.where(\n",
" ds.cf[\"sea_ice_area_fraction\"].any(set(ds.dims) - {\"time\"}).compute(),\n",
Expand Down

0 comments on commit 92cb912

Please sign in to comment.