Skip to content

Commit

Permalink
Fix climo_nyears
Browse files Browse the repository at this point in the history
  • Loading branch information
dabail10 committed Mar 7, 2025
1 parent fc3c638 commit 2712cd5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions nblibrary/ice/Hemis_seaice_visual_compare_contour.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@
"ds1_ann = ds1.resample(time=\"YS\").mean(dim=\"time\")\n",
"ds2_ann = ds2.resample(time=\"YS\").mean(dim=\"time\")\n",
"\n",
"climo_nyears = min(climo_nyears, len(ds1_ann.time))\n",
"climo_nyears = min(climo_nyears, len(ds2_ann.time))\n",
"\n",
"with open(\"cice_masks.yml\", \"r\") as file:\n",
" cice_masks = yaml.safe_load(file)\n",
"\n",
Expand Down
11 changes: 7 additions & 4 deletions nblibrary/ice/Hemis_seaice_visual_compare_obs_lens.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@
"ds1_ann = ds1.resample(time=\"YS\").mean(dim=\"time\")\n",
"ds2_ann = ds2.resample(time=\"YS\").mean(dim=\"time\")\n",
"\n",
"climo_nyears = min(climo_nyears, len(ds1_ann.time))\n",
"climo_nyears = min(climo_nyears, len(ds2_ann.time))\n",
"\n",
"with open(\"cice_masks.yml\", \"r\") as file:\n",
" cice_masks = yaml.safe_load(file)\n",
"\n",
Expand Down Expand Up @@ -1309,19 +1312,19 @@
"\n",
"# Set up axes\n",
"if first_year > 1:\n",
" model_start_year1 = end_year - len(ds1_mar_nh.time)\n",
" model_start_year1 = end_year - len(ds1_mar_nh.time) + 1\n",
" model_end_year1 = end_year\n",
" model_start_year2 = base_end_year - len(ds2_mar_nh.time)\n",
" model_start_year2 = base_end_year - len(ds2_mar_nh.time) + 1\n",
" model_end_year2 = base_end_year\n",
" lens1_start_year = ds_cesm1_aicetot_nh.year[60]\n",
" lens1_end_year = ds_cesm1_aicetot_nh.year[95]\n",
" lens2_start_year = ds_cesm2_aicetot_nh.year[110]\n",
" lens2_end_year = ds_cesm2_aicetot_nh.year[145]\n",
"else:\n",
" model_start_year1 = 1\n",
" model_end_year1 = climo_nyears\n",
" model_end_year1 = len(ds1_mar_nh.time) + 1\n",
" model_start_year2 = 1\n",
" model_end_year2 = climo_nyears\n",
" model_end_year2 = len(ds2_mar_nh.time) + 1\n",
" lens1_start_year = 1\n",
" lens1_end_year = 36\n",
" lens2_start_year = 1\n",
Expand Down

0 comments on commit 2712cd5

Please sign in to comment.