From e281f8a253c35dd01997f06dce3c5232b8d26217 Mon Sep 17 00:00:00 2001 From: valentijn7 Date: Fri, 13 Dec 2024 14:20:03 +0100 Subject: [PATCH] Loading or aggregating condition refined --- GoogleFloodHub/src/GRRR.ipynb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/GoogleFloodHub/src/GRRR.ipynb b/GoogleFloodHub/src/GRRR.ipynb index 729c0e9..509b4aa 100644 --- a/GoogleFloodHub/src/GRRR.ipynb +++ b/GoogleFloodHub/src/GRRR.ipynb @@ -2922,7 +2922,7 @@ }, { "cell_type": "code", - "execution_count": 552, + "execution_count": 603, "metadata": {}, "outputs": [], "source": [ @@ -3196,8 +3196,10 @@ " if not os.path.exists('../data/GRRR/aggregated/') or not os.path.exists('../data/GRRR/aggregated_rp/'):\n", " os.makedirs('../data/GRRR/aggregated/', exist_ok = True)\n", " os.makedirs('../data/GRRR/aggregated_rp/', exist_ok = True)\n", - " n_datasets_loaded = len([f for f in os.listdir('../data/GRRR/aggregated/') if f.endswith('.nc')])\n", - " n_rps_loaded = len([f for f in os.listdir('../data/GRRR/aggregated_rp/') if f.endswith('.nc')])\n", + " n_datasets_loaded = len([f for f in os.listdir('../data/GRRR/aggregated/') if \\\n", + " f.endswith(f'_{lt * 24}.nc')])\n", + " n_rps_loaded = len([f for f in os.listdir('../data/GRRR/aggregated_rp/') if \\\n", + " f.endswith(f'_{lt * 24}.nc')])\n", " if (n_to_load == n_datasets_loaded) and (n_to_load == n_rps_loaded):\n", " print('Loading in datasets...')\n", " dict_datasets_au = import_datasets_from_netcdf('../data/GRRR/aggregated/', lt)\n",