diff --git a/notebooks/errors/cds-error-2025-09-08-cmip6-noresm2.ipynb b/notebooks/errors/cds-error-2025-09-08-cmip6-noresm2.ipynb new file mode 100644 index 0000000..afe6407 --- /dev/null +++ b/notebooks/errors/cds-error-2025-09-08-cmip6-noresm2.ipynb @@ -0,0 +1,1874 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "a86ae071-35c6-4f99-bfbc-fac2c68bd7c6", + "metadata": {}, + "source": [ + "# Issue with CMIP6 noresm2 dataset\n", + "\n", + "When: 2025-09-08\n", + "Versions: clisops = 0.16.2, rook = 0.17.2\n", + "\n", + "Here is an issue with multi-year queries for NorESM2-MM and NorESM2-LM combined with geographic subsetting (even if you ask the full Globe in the geographic subset boundaries) are failing in the CDS. \n", + "\n", + "For instance the following request fails:\n", + "\n", + "```\n", + "import cdsapi\n", + "\n", + "dataset = \"projections-cmip6\"\n", + "request = {\n", + " \"temporal_resolution\": \"monthly\",\n", + " \"experiment\": \"ssp2_4_5\",\n", + " \"variable\": \"sea_surface_temperature\",\n", + " \"model\": \"noresm2_mm\",\n", + " \"month\": [\"04\"],\n", + " \"year\": [\"2050\", \"2051\"],\n", + " \"area\": [90, -180, -90, 180]\n", + "}\n", + "\n", + "client = cdsapi.Client()\n", + "client.retrieve(dataset, request).download()\n", + "```\n", + "\n", + "If you select just one year that is OK. If you don't use geographic subsetting then that is OK too. \n", + "\n", + "Do you have any idea what can be wrong?\n" + ] + }, + { + "cell_type": "markdown", + "id": "b8c50b39-757d-4eb3-878a-2edcebfba8b6", + "metadata": {}, + "source": [ + "## Search Catalog" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "50323ad7-9ca6-427e-8aa4-bf795b60dbe9", + "metadata": {}, + "outputs": [], + "source": [ + "import intake" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "07dce0ae-3450-4552-b7c0-8f13668ae948", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['c3s-cmip5',\n", + " 'c3s-cmip5-daily-pressure-level',\n", + " 'c3s-cmip5-daily-single-level',\n", + " 'c3s-cmip5-monthly-pressure-level',\n", + " 'c3s-cmip5-monthly-single-level',\n", + " 'c3s-cmip6',\n", + " 'c3s-cmip6-decadal',\n", + " 'c3s-cordex',\n", + " 'c3s-ipcc-atlas',\n", + " 'c3s-cica-atlas-v01',\n", + " 'c3s-cica-atlas']" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cat_url = \"https://raw.githubusercontent.com/cp4cds/c3s_34g_manifests/master/intake/catalogs/c3s.yaml\"\n", + "\n", + "cat = intake.open_catalog(cat_url)\n", + "list(cat)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "ba5a79ab-10f6-436b-ae58-8cc0710c0b51", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
ds_idpathsizemip_eraactivity_idinstitution_idsource_idexperiment_idmember_idtable_idvariable_idgrid_labelversionstart_timeend_timebboxlevel
0c3s-cmip6.ScenarioMIP.MOHC.UKESM1-0-LL.ssp245....ScenarioMIP/MOHC/UKESM1-0-LL/ssp245/r1i1p1f2/A...28037112c3s-cmip6ScenarioMIPMOHCUKESM1-0-LLssp245r1i1p1f2Amontsgnv201905072015-01-16T00:00:002049-12-16T00:00:000.94, -89.38, 359.06, 89.38NaN
1c3s-cmip6.ScenarioMIP.MOHC.UKESM1-0-LL.ssp245....ScenarioMIP/MOHC/UKESM1-0-LL/ssp245/r1i1p1f2/A...38838222c3s-cmip6ScenarioMIPMOHCUKESM1-0-LLssp245r1i1p1f2Amontsgnv201905072050-01-16T00:00:002100-12-16T00:00:000.94, -89.38, 359.06, 89.38NaN
2c3s-cmip6.ScenarioMIP.NCAR.CESM2.ssp370.r4i1p1...ScenarioMIP/NCAR/CESM2/ssp370/r4i1p1f1/Amon/pr...104081588c3s-cmip6ScenarioMIPNCARCESM2ssp370r4i1p1f1Amonprgnv202005282015-01-15T12:00:002064-12-15T12:00:000.00, -90.00, 358.75, 90.00NaN
3c3s-cmip6.ScenarioMIP.NCAR.CESM2.ssp370.r4i1p1...ScenarioMIP/NCAR/CESM2/ssp370/r4i1p1f1/Amon/pr...74977662c3s-cmip6ScenarioMIPNCARCESM2ssp370r4i1p1f1Amonprgnv202005282065-01-15T12:00:002100-12-15T12:00:000.00, -90.00, 358.75, 90.00NaN
4c3s-cmip6.ScenarioMIP.AS-RCEC.TaiESM1.ssp370.r...ScenarioMIP/AS-RCEC/TaiESM1/ssp370/r1i1p1f1/Am...144277888c3s-cmip6ScenarioMIPAS-RCECTaiESM1ssp370r1i1p1f1Amonrlutgnv202010142015-01-16T12:00:002100-12-16T12:00:000.00, -90.00, 358.75, 90.00NaN
\n", + "
" + ], + "text/plain": [ + " ds_id \\\n", + "0 c3s-cmip6.ScenarioMIP.MOHC.UKESM1-0-LL.ssp245.... \n", + "1 c3s-cmip6.ScenarioMIP.MOHC.UKESM1-0-LL.ssp245.... \n", + "2 c3s-cmip6.ScenarioMIP.NCAR.CESM2.ssp370.r4i1p1... \n", + "3 c3s-cmip6.ScenarioMIP.NCAR.CESM2.ssp370.r4i1p1... \n", + "4 c3s-cmip6.ScenarioMIP.AS-RCEC.TaiESM1.ssp370.r... \n", + "\n", + " path size mip_era \\\n", + "0 ScenarioMIP/MOHC/UKESM1-0-LL/ssp245/r1i1p1f2/A... 28037112 c3s-cmip6 \n", + "1 ScenarioMIP/MOHC/UKESM1-0-LL/ssp245/r1i1p1f2/A... 38838222 c3s-cmip6 \n", + "2 ScenarioMIP/NCAR/CESM2/ssp370/r4i1p1f1/Amon/pr... 104081588 c3s-cmip6 \n", + "3 ScenarioMIP/NCAR/CESM2/ssp370/r4i1p1f1/Amon/pr... 74977662 c3s-cmip6 \n", + "4 ScenarioMIP/AS-RCEC/TaiESM1/ssp370/r1i1p1f1/Am... 144277888 c3s-cmip6 \n", + "\n", + " activity_id institution_id source_id experiment_id member_id table_id \\\n", + "0 ScenarioMIP MOHC UKESM1-0-LL ssp245 r1i1p1f2 Amon \n", + "1 ScenarioMIP MOHC UKESM1-0-LL ssp245 r1i1p1f2 Amon \n", + "2 ScenarioMIP NCAR CESM2 ssp370 r4i1p1f1 Amon \n", + "3 ScenarioMIP NCAR CESM2 ssp370 r4i1p1f1 Amon \n", + "4 ScenarioMIP AS-RCEC TaiESM1 ssp370 r1i1p1f1 Amon \n", + "\n", + " variable_id grid_label version start_time end_time \\\n", + "0 ts gn v20190507 2015-01-16T00:00:00 2049-12-16T00:00:00 \n", + "1 ts gn v20190507 2050-01-16T00:00:00 2100-12-16T00:00:00 \n", + "2 pr gn v20200528 2015-01-15T12:00:00 2064-12-15T12:00:00 \n", + "3 pr gn v20200528 2065-01-15T12:00:00 2100-12-15T12:00:00 \n", + "4 rlut gn v20201014 2015-01-16T12:00:00 2100-12-16T12:00:00 \n", + "\n", + " bbox level \n", + "0 0.94, -89.38, 359.06, 89.38 NaN \n", + "1 0.94, -89.38, 359.06, 89.38 NaN \n", + "2 0.00, -90.00, 358.75, 90.00 NaN \n", + "3 0.00, -90.00, 358.75, 90.00 NaN \n", + "4 0.00, -90.00, 358.75, 90.00 NaN " + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df_cmip6 = cat['c3s-cmip6'].read()\n", + "df_cmip6.head()" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "f29bf370-1cd4-4f30-804c-577721a14283", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
ds_idpathsizemip_eraactivity_idinstitution_idsource_idexperiment_idmember_idtable_idvariable_idgrid_labelversionstart_timeend_timebboxlevel
36111c3s-cmip6.ScenarioMIP.NCC.NorESM2-MM.ssp245.r1...ScenarioMIP/NCC/NorESM2-MM/ssp245/r1i1p1f1/Omo...20210689c3s-cmip6ScenarioMIPNCCNorESM2-MMssp245r1i1p1f1Omontosgnv201911082015-01-16T12:00:002020-12-16T12:00:000.00, -80.11, 359.99, 89.76NaN
36112c3s-cmip6.ScenarioMIP.NCC.NorESM2-MM.ssp245.r1...ScenarioMIP/NCC/NorESM2-MM/ssp245/r1i1p1f1/Omo...32280986c3s-cmip6ScenarioMIPNCCNorESM2-MMssp245r1i1p1f1Omontosgnv201911082021-01-16T12:00:002030-12-16T12:00:000.00, -80.11, 359.99, 89.76NaN
36113c3s-cmip6.ScenarioMIP.NCC.NorESM2-MM.ssp245.r1...ScenarioMIP/NCC/NorESM2-MM/ssp245/r1i1p1f1/Omo...32288906c3s-cmip6ScenarioMIPNCCNorESM2-MMssp245r1i1p1f1Omontosgnv201911082031-01-16T12:00:002040-12-16T12:00:000.00, -80.11, 359.99, 89.76NaN
36114c3s-cmip6.ScenarioMIP.NCC.NorESM2-MM.ssp245.r1...ScenarioMIP/NCC/NorESM2-MM/ssp245/r1i1p1f1/Omo...32303821c3s-cmip6ScenarioMIPNCCNorESM2-MMssp245r1i1p1f1Omontosgnv201911082041-01-16T12:00:002050-12-16T12:00:000.00, -80.11, 359.99, 89.76NaN
36115c3s-cmip6.ScenarioMIP.NCC.NorESM2-MM.ssp245.r1...ScenarioMIP/NCC/NorESM2-MM/ssp245/r1i1p1f1/Omo...32304586c3s-cmip6ScenarioMIPNCCNorESM2-MMssp245r1i1p1f1Omontosgnv201911082051-01-16T12:00:002060-12-16T12:00:000.00, -80.11, 359.99, 89.76NaN
36116c3s-cmip6.ScenarioMIP.NCC.NorESM2-MM.ssp245.r1...ScenarioMIP/NCC/NorESM2-MM/ssp245/r1i1p1f1/Omo...32298230c3s-cmip6ScenarioMIPNCCNorESM2-MMssp245r1i1p1f1Omontosgnv201911082061-01-16T12:00:002070-12-16T12:00:000.00, -80.11, 359.99, 89.76NaN
36117c3s-cmip6.ScenarioMIP.NCC.NorESM2-MM.ssp245.r1...ScenarioMIP/NCC/NorESM2-MM/ssp245/r1i1p1f1/Omo...32306503c3s-cmip6ScenarioMIPNCCNorESM2-MMssp245r1i1p1f1Omontosgnv201911082071-01-16T12:00:002080-12-16T12:00:000.00, -80.11, 359.99, 89.76NaN
36118c3s-cmip6.ScenarioMIP.NCC.NorESM2-MM.ssp245.r1...ScenarioMIP/NCC/NorESM2-MM/ssp245/r1i1p1f1/Omo...32331548c3s-cmip6ScenarioMIPNCCNorESM2-MMssp245r1i1p1f1Omontosgnv201911082081-01-16T12:00:002090-12-16T12:00:000.00, -80.11, 359.99, 89.76NaN
36119c3s-cmip6.ScenarioMIP.NCC.NorESM2-MM.ssp245.r1...ScenarioMIP/NCC/NorESM2-MM/ssp245/r1i1p1f1/Omo...32322290c3s-cmip6ScenarioMIPNCCNorESM2-MMssp245r1i1p1f1Omontosgnv201911082091-01-16T12:00:002100-12-16T12:00:000.00, -80.11, 359.99, 89.76NaN
\n", + "
" + ], + "text/plain": [ + " ds_id \\\n", + "36111 c3s-cmip6.ScenarioMIP.NCC.NorESM2-MM.ssp245.r1... \n", + "36112 c3s-cmip6.ScenarioMIP.NCC.NorESM2-MM.ssp245.r1... \n", + "36113 c3s-cmip6.ScenarioMIP.NCC.NorESM2-MM.ssp245.r1... \n", + "36114 c3s-cmip6.ScenarioMIP.NCC.NorESM2-MM.ssp245.r1... \n", + "36115 c3s-cmip6.ScenarioMIP.NCC.NorESM2-MM.ssp245.r1... \n", + "36116 c3s-cmip6.ScenarioMIP.NCC.NorESM2-MM.ssp245.r1... \n", + "36117 c3s-cmip6.ScenarioMIP.NCC.NorESM2-MM.ssp245.r1... \n", + "36118 c3s-cmip6.ScenarioMIP.NCC.NorESM2-MM.ssp245.r1... \n", + "36119 c3s-cmip6.ScenarioMIP.NCC.NorESM2-MM.ssp245.r1... \n", + "\n", + " path size mip_era \\\n", + "36111 ScenarioMIP/NCC/NorESM2-MM/ssp245/r1i1p1f1/Omo... 20210689 c3s-cmip6 \n", + "36112 ScenarioMIP/NCC/NorESM2-MM/ssp245/r1i1p1f1/Omo... 32280986 c3s-cmip6 \n", + "36113 ScenarioMIP/NCC/NorESM2-MM/ssp245/r1i1p1f1/Omo... 32288906 c3s-cmip6 \n", + "36114 ScenarioMIP/NCC/NorESM2-MM/ssp245/r1i1p1f1/Omo... 32303821 c3s-cmip6 \n", + "36115 ScenarioMIP/NCC/NorESM2-MM/ssp245/r1i1p1f1/Omo... 32304586 c3s-cmip6 \n", + "36116 ScenarioMIP/NCC/NorESM2-MM/ssp245/r1i1p1f1/Omo... 32298230 c3s-cmip6 \n", + "36117 ScenarioMIP/NCC/NorESM2-MM/ssp245/r1i1p1f1/Omo... 32306503 c3s-cmip6 \n", + "36118 ScenarioMIP/NCC/NorESM2-MM/ssp245/r1i1p1f1/Omo... 32331548 c3s-cmip6 \n", + "36119 ScenarioMIP/NCC/NorESM2-MM/ssp245/r1i1p1f1/Omo... 32322290 c3s-cmip6 \n", + "\n", + " activity_id institution_id source_id experiment_id member_id \\\n", + "36111 ScenarioMIP NCC NorESM2-MM ssp245 r1i1p1f1 \n", + "36112 ScenarioMIP NCC NorESM2-MM ssp245 r1i1p1f1 \n", + "36113 ScenarioMIP NCC NorESM2-MM ssp245 r1i1p1f1 \n", + "36114 ScenarioMIP NCC NorESM2-MM ssp245 r1i1p1f1 \n", + "36115 ScenarioMIP NCC NorESM2-MM ssp245 r1i1p1f1 \n", + "36116 ScenarioMIP NCC NorESM2-MM ssp245 r1i1p1f1 \n", + "36117 ScenarioMIP NCC NorESM2-MM ssp245 r1i1p1f1 \n", + "36118 ScenarioMIP NCC NorESM2-MM ssp245 r1i1p1f1 \n", + "36119 ScenarioMIP NCC NorESM2-MM ssp245 r1i1p1f1 \n", + "\n", + " table_id variable_id grid_label version start_time \\\n", + "36111 Omon tos gn v20191108 2015-01-16T12:00:00 \n", + "36112 Omon tos gn v20191108 2021-01-16T12:00:00 \n", + "36113 Omon tos gn v20191108 2031-01-16T12:00:00 \n", + "36114 Omon tos gn v20191108 2041-01-16T12:00:00 \n", + "36115 Omon tos gn v20191108 2051-01-16T12:00:00 \n", + "36116 Omon tos gn v20191108 2061-01-16T12:00:00 \n", + "36117 Omon tos gn v20191108 2071-01-16T12:00:00 \n", + "36118 Omon tos gn v20191108 2081-01-16T12:00:00 \n", + "36119 Omon tos gn v20191108 2091-01-16T12:00:00 \n", + "\n", + " end_time bbox level \n", + "36111 2020-12-16T12:00:00 0.00, -80.11, 359.99, 89.76 NaN \n", + "36112 2030-12-16T12:00:00 0.00, -80.11, 359.99, 89.76 NaN \n", + "36113 2040-12-16T12:00:00 0.00, -80.11, 359.99, 89.76 NaN \n", + "36114 2050-12-16T12:00:00 0.00, -80.11, 359.99, 89.76 NaN \n", + "36115 2060-12-16T12:00:00 0.00, -80.11, 359.99, 89.76 NaN \n", + "36116 2070-12-16T12:00:00 0.00, -80.11, 359.99, 89.76 NaN \n", + "36117 2080-12-16T12:00:00 0.00, -80.11, 359.99, 89.76 NaN \n", + "36118 2090-12-16T12:00:00 0.00, -80.11, 359.99, 89.76 NaN \n", + "36119 2100-12-16T12:00:00 0.00, -80.11, 359.99, 89.76 NaN " + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df = df_cmip6.loc[\n", + " (df_cmip6.source_id==\"NorESM2-MM\" )\n", + " & (df_cmip6.table_id==\"Omon\")\n", + " & (df_cmip6.variable_id==\"tos\")\n", + " & (df_cmip6.experiment_id==\"ssp245\")\n", + "]\n", + "df" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "b9bf08bf-f878-471d-8e6f-1786355603ad", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['c3s-cmip6.ScenarioMIP.NCC.NorESM2-MM.ssp245.r1i1p1f1.Omon.tos.gn.v20191108']" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ds_ids = list(df.ds_id.unique())\n", + "ds_ids" + ] + }, + { + "cell_type": "markdown", + "id": "6d4704ba-4112-4f39-8b73-01f2b598f710", + "metadata": {}, + "source": [ + "## Run subset operator" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "6adae59b-7e57-4969-bbde-6285a82c5ee7", + "metadata": {}, + "outputs": [], + "source": [ + "import os\n", + "os.environ['ROOK_URL'] = 'http://rook.dkrz.de/wps'\n", + "\n", + "from rooki import rooki" + ] + }, + { + "cell_type": "markdown", + "id": "c17b25c6-67ba-4c06-86b0-58c9c6c3818f", + "metadata": {}, + "source": [ + "### Failing request" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "7dc1049c-0363-41a1-a57f-7186d6b1eea6", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "resp = rooki.subset(\n", + " collection=ds_ids,\n", + " time='2050/2051',\n", + " time_components='year:2050,2051|month:april',\n", + " area='90,-180,-90,180'\n", + ")\n", + "resp.ok" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "26fc25a0-9fdc-4ecb-9196-972e788e85fb", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Process error: item is not yet a valid method on dask arrays" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "resp" + ] + }, + { + "cell_type": "markdown", + "id": "91f5715b-7545-4b8e-aae5-b8787a9fd346", + "metadata": {}, + "source": [ + "### Works: one year only" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "766ff671-735b-44ca-8a57-b6bb98cc8d63", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "resp = rooki.subset(\n", + " collection=ds_ids,\n", + " time='2050/2050',\n", + " time_components='year:2050|month:april',\n", + " area='90,-180,-90,180'\n", + ")\n", + "resp.ok" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "1523591d-4fa6-468e-8c1e-447a93949c87", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Downloading to /var/folders/5f/t661zdnd181ck1dv429s4p8r0000gn/T/metalink_ot_gnzeu/tos_Omon_NorESM2-MM_ssp245_r1i1p1f1_gn_20500416-20500416.nc.\n" + ] + }, + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
<xarray.Dataset> Size: 8MB\n",
+       "Dimensions:             (time: 1, bnds: 2, j: 385, i: 251, vertices: 4)\n",
+       "Coordinates:\n",
+       "  * time                (time) object 8B 2050-04-16 00:00:00\n",
+       "  * j                   (j) int32 2kB 1 2 3 4 5 6 7 ... 380 381 382 383 384 385\n",
+       "  * i                   (i) int32 1kB 21 22 23 24 25 26 ... 267 268 269 270 271\n",
+       "    latitude            (j, i) float64 773kB ...\n",
+       "    longitude           (j, i) float64 773kB ...\n",
+       "Dimensions without coordinates: bnds, vertices\n",
+       "Data variables:\n",
+       "    time_bnds           (time, bnds) object 16B ...\n",
+       "    vertices_latitude   (j, i, vertices) float64 3MB ...\n",
+       "    vertices_longitude  (j, i, vertices) float64 3MB ...\n",
+       "    tos                 (time, j, i) float32 387kB ...\n",
+       "Attributes: (12/49)\n",
+       "    Conventions:               CF-1.7 CMIP-6.2\n",
+       "    activity_id:               ScenarioMIP\n",
+       "    branch_method:             Hybrid-restart from year 2015-01-01 of historical\n",
+       "    branch_time:               0.0\n",
+       "    branch_time_in_child:      0.0\n",
+       "    branch_time_in_parent:     60225.0\n",
+       "    ...                        ...\n",
+       "    title:                     NorESM2-MM output prepared for CMIP6\n",
+       "    variable_id:               tos\n",
+       "    variant_label:             r1i1p1f1\n",
+       "    license:                   CMIP6 model data produced by NCC is licensed u...\n",
+       "    cmor_version:              3.5.0\n",
+       "    tracking_id:               hdl:21.14100/ddb7b746-0a81-43e2-9511-1b696aa26b49
" + ], + "text/plain": [ + " Size: 8MB\n", + "Dimensions: (time: 1, bnds: 2, j: 385, i: 251, vertices: 4)\n", + "Coordinates:\n", + " * time (time) object 8B 2050-04-16 00:00:00\n", + " * j (j) int32 2kB 1 2 3 4 5 6 7 ... 380 381 382 383 384 385\n", + " * i (i) int32 1kB 21 22 23 24 25 26 ... 267 268 269 270 271\n", + " latitude (j, i) float64 773kB ...\n", + " longitude (j, i) float64 773kB ...\n", + "Dimensions without coordinates: bnds, vertices\n", + "Data variables:\n", + " time_bnds (time, bnds) object 16B ...\n", + " vertices_latitude (j, i, vertices) float64 3MB ...\n", + " vertices_longitude (j, i, vertices) float64 3MB ...\n", + " tos (time, j, i) float32 387kB ...\n", + "Attributes: (12/49)\n", + " Conventions: CF-1.7 CMIP-6.2\n", + " activity_id: ScenarioMIP\n", + " branch_method: Hybrid-restart from year 2015-01-01 of historical\n", + " branch_time: 0.0\n", + " branch_time_in_child: 0.0\n", + " branch_time_in_parent: 60225.0\n", + " ... ...\n", + " title: NorESM2-MM output prepared for CMIP6\n", + " variable_id: tos\n", + " variant_label: r1i1p1f1\n", + " license: CMIP6 model data produced by NCC is licensed u...\n", + " cmor_version: 3.5.0\n", + " tracking_id: hdl:21.14100/ddb7b746-0a81-43e2-9511-1b696aa26b49" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ds = resp.datasets()[0]\n", + "ds" + ] + }, + { + "cell_type": "markdown", + "id": "cd20886a-955f-4df3-a9e1-eda3546c29a6", + "metadata": {}, + "source": [ + "### Works: no area selection" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "2a06019e-080f-486d-a3ea-d80493849239", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "resp = rooki.subset(\n", + " collection=ds_ids,\n", + " time='2050/2051',\n", + " time_components='year:2051|month:april',\n", + " # area='90,-180,-90,180'\n", + ")\n", + "resp.ok" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "44d80dc3-e0d8-46d2-964a-0baa3e2b2f05", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Downloading to /var/folders/5f/t661zdnd181ck1dv429s4p8r0000gn/T/metalink_kz6u0jg_/tos_Omon_NorESM2-MM_ssp245_r1i1p1f1_gn_20510416-20510416.nc.\n" + ] + }, + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
<xarray.Dataset> Size: 12MB\n",
+       "Dimensions:             (time: 1, bnds: 2, j: 385, i: 360, vertices: 4)\n",
+       "Coordinates:\n",
+       "  * time                (time) object 8B 2051-04-16 00:00:00\n",
+       "  * j                   (j) int32 2kB 1 2 3 4 5 6 7 ... 380 381 382 383 384 385\n",
+       "  * i                   (i) int32 1kB 1 2 3 4 5 6 7 ... 355 356 357 358 359 360\n",
+       "    latitude            (j, i) float64 1MB ...\n",
+       "    longitude           (j, i) float64 1MB ...\n",
+       "Dimensions without coordinates: bnds, vertices\n",
+       "Data variables:\n",
+       "    time_bnds           (time, bnds) object 16B ...\n",
+       "    vertices_latitude   (time, j, i, vertices) float64 4MB ...\n",
+       "    vertices_longitude  (time, j, i, vertices) float64 4MB ...\n",
+       "    tos                 (time, j, i) float32 554kB ...\n",
+       "Attributes: (12/49)\n",
+       "    Conventions:               CF-1.7 CMIP-6.2\n",
+       "    activity_id:               ScenarioMIP\n",
+       "    branch_method:             Hybrid-restart from year 2015-01-01 of historical\n",
+       "    branch_time:               0.0\n",
+       "    branch_time_in_child:      0.0\n",
+       "    branch_time_in_parent:     60225.0\n",
+       "    ...                        ...\n",
+       "    title:                     NorESM2-MM output prepared for CMIP6\n",
+       "    variable_id:               tos\n",
+       "    variant_label:             r1i1p1f1\n",
+       "    license:                   CMIP6 model data produced by NCC is licensed u...\n",
+       "    cmor_version:              3.5.0\n",
+       "    tracking_id:               hdl:21.14100/ddb7b746-0a81-43e2-9511-1b696aa26b49
" + ], + "text/plain": [ + " Size: 12MB\n", + "Dimensions: (time: 1, bnds: 2, j: 385, i: 360, vertices: 4)\n", + "Coordinates:\n", + " * time (time) object 8B 2051-04-16 00:00:00\n", + " * j (j) int32 2kB 1 2 3 4 5 6 7 ... 380 381 382 383 384 385\n", + " * i (i) int32 1kB 1 2 3 4 5 6 7 ... 355 356 357 358 359 360\n", + " latitude (j, i) float64 1MB ...\n", + " longitude (j, i) float64 1MB ...\n", + "Dimensions without coordinates: bnds, vertices\n", + "Data variables:\n", + " time_bnds (time, bnds) object 16B ...\n", + " vertices_latitude (time, j, i, vertices) float64 4MB ...\n", + " vertices_longitude (time, j, i, vertices) float64 4MB ...\n", + " tos (time, j, i) float32 554kB ...\n", + "Attributes: (12/49)\n", + " Conventions: CF-1.7 CMIP-6.2\n", + " activity_id: ScenarioMIP\n", + " branch_method: Hybrid-restart from year 2015-01-01 of historical\n", + " branch_time: 0.0\n", + " branch_time_in_child: 0.0\n", + " branch_time_in_parent: 60225.0\n", + " ... ...\n", + " title: NorESM2-MM output prepared for CMIP6\n", + " variable_id: tos\n", + " variant_label: r1i1p1f1\n", + " license: CMIP6 model data produced by NCC is licensed u...\n", + " cmor_version: 3.5.0\n", + " tracking_id: hdl:21.14100/ddb7b746-0a81-43e2-9511-1b696aa26b49" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "ds = resp.datasets()[0]\n", + "ds" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.13.5" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}