{ "cells": [ { "cell_type": "markdown", "id": "86a08059-c833-46a9-afd0-35e450f65087", "metadata": {}, "source": [ "# Loading data from the catalog" ] }, { "cell_type": "markdown", "id": "56ac911d-5c95-4e7c-8c7d-99be25fa378f", "metadata": { "incorrectly_encoded_metadata": "jp-MarkdownHeadingCollapsed=true", "tags": [] }, "source": [ "## Long story short:\n", "```\n", "import intake\n", "try:\n", " import outtake\n", "except:\n", " import sys\n", " print (\"\"\"Could not load outtake - tape downloads might not work. Try adding\n", "\n", "module use /work/k20200/k202134/hsm-tools/outtake/module\n", "module load hsm-tools/unstable\n", "\n", "to your ~./kernel_env file\"\"\", file=sys.stderr)\n", "\n", "\n", "catalog_file = \"/work/ka1081/Catalogs/dyamond-nextgems.json\" # nextGEMS and DYAMOND Winter\n", "cat = intake.open_esm_datastore(catalog_file)\n", "hits = cat.search(simulation_id=\"ngc2009\", variable_id=\"tas\", frequency=\"30minute\")\n", "dataset_dict = hits.to_dataset_dict(cdf_kwargs={\"chunks\": {\"time\": 1}})\n", "keys = list(dataset_dict.keys())\n", "dataset = dataset_dict[keys[0]]\n", "dataset.tas.isel(time=1).max().values\n", "\n", "# use get_from_cat from below to search a catalog\n", "```" ] }, { "cell_type": "markdown", "id": "56f31167-b732-4b5f-9e88-fca82fbf401f", "metadata": { "tags": [] }, "source": [ "## Loading the catalog" ] }, { "cell_type": "markdown", "id": "ec278650-c70a-416a-93c5-0ffb0da5ef0e", "metadata": {}, "source": [ "The [intake-esm package](https://intake-esm.readthedocs.io/en/stable/) provides a tool to access big amounts of data, without having to worry about where it comes from. We will give you a short overview of how to do use the catalog to your advantage.\n", "The root of the intake catalog, is a '.json' file." ] }, { "cell_type": "code", "execution_count": 1, "id": "203d720d-31a9-4af1-9808-91534508aa57", "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "\n", "pd.set_option(\"max_colwidth\", None) # makes the tables render better\n", "\n", "import intake\n", "\n", "try:\n", " import outtake\n", "except:\n", " import sys\n", "\n", " print(\n", " \"\"\"Could not load outtake - tape downloads might not work. Try adding\n", " \n", "module use /work/k20200/k202134/hsm-tools/outtake/module\n", "module load hsm-tools/unstable\n", "\n", "to your ~./kernel_env file\"\"\",\n", " file=sys.stderr,\n", " )\n", "\n", "\n", "def get_from_cat(catalog, columns):\n", " \"\"\"A helper function for inspecting an intake catalog.\n", "\n", " Call with the catalog to be inspected and a list of columns of interest.\"\"\"\n", " import pandas as pd\n", "\n", " pd.set_option(\"max_colwidth\", None) # makes the tables render better\n", "\n", " if type(columns) == type(\"\"):\n", " columns = [columns]\n", " return (\n", " catalog.df[columns]\n", " .drop_duplicates()\n", " .sort_values(columns)\n", " .reset_index(drop=True)\n", " )" ] }, { "cell_type": "code", "execution_count": 2, "id": "7cedb06f-3243-4fce-ac8c-a033aeff5c91", "metadata": {}, "outputs": [ { "data": { "text/html": [ "

/work/k20200/k202134/Catalogs/dng-merged catalog with 167 dataset(s) from 120310 asset(s):

\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
unique
variable_id643
project2
institution_id13
source_id21
experiment_id5
simulation_id16
realm6
frequency16
time_reduction5
grid_label11
level_type6
time_min3153
time_max7000
grid_id16
format2
uri120044
\n", "
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "catalog_file = \"/work/ka1081/Catalogs/dyamond-nextgems.json\"\n", "\n", "cat = intake.open_esm_datastore(catalog_file)\n", "cat" ] }, { "cell_type": "markdown", "id": "0c60d2fe-e67d-4d35-a8f7-4a6395fe644d", "metadata": {}, "source": [ "The meanings of the categories are:\n", "\n", "Info | Description |\n", "---|--- |\n", "**variable_id** | Shortname of variables.\n", "**project** | Larger project the simulation belongs to.\n", "**source_id**| Model name.\n", "**experiment_id**| Class of experiment\n", "**simulation_id**| Id of the run.\n", "**realm**| oceanic or atmospheric data\n", "**frequency**| Frequency in time of datapoints.\n", "**time_reduction**| Average/Instantaneous/...\n", "**grid_label**| Identifier for horizontal gridtype.\n", "**level_type**| Identifier for vertical gridtype.\n", "**time_min**| Starting time for a specific file.\n", "**time_max**| End of time covered by a specific file.\n", "**grid_id**| Identifier of horizontal grid.\n", "**uri**|Uniform resource identifier, location of data files." ] }, { "cell_type": "markdown", "id": "d3d47515-2339-4b42-b2a6-0117ff92a034", "metadata": {}, "source": [ "## Searching the catalog" ] }, { "cell_type": "markdown", "id": "4d1c1279-c1c1-4c49-a6ef-6369079d3a09", "metadata": {}, "source": [ "You can access the underlying pandas [dataframe](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html) with \"cat.df\". Here we show the first 2 entries with [head()](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.head.html):" ] }, { "cell_type": "code", "execution_count": 3, "id": "2eb9bf8d-ca57-4ee9-b068-142b797e5f3d", "metadata": { "tags": [] }, "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", "
variable_idprojectinstitution_idsource_idexperiment_idsimulation_idrealmfrequencytime_reductiongrid_labellevel_typetime_mintime_maxgrid_idformaturi
0(c, l, i, v, i)DYAMOND_WINTERCAMSGRIST-5kmDW-ATMr1i1p1f1atmos15minunkonwngn2d2020-01-20T00:00:00.0002020-01-20T23:45:00.000not_implementednetcdf/work/ka1081/DYAMOND_WINTER/CAMS/GRIST-5km/DW-ATM/atmos/15min/clivi/r1i1p1f1/2d/gn/clivi_15min_GRIST-5km_DW-ATM_r1i1p1f1_2d_gn_20200120000000-20200120234500.nc
1(c, l, t)DYAMOND_WINTERCAMSGRIST-5kmDW-ATMr1i1p1f1atmos15minunkonwngn2d2020-01-20T00:00:00.0002020-01-20T23:45:00.000not_implementednetcdf/work/ka1081/DYAMOND_WINTER/CAMS/GRIST-5km/DW-ATM/atmos/15min/clt/r1i1p1f1/2d/gn/clt_15min_GRIST-5km_DW-ATM_r1i1p1f1_2d_gn_20200120000000-20200120234500.nc
\n", "
" ], "text/plain": [ " variable_id project institution_id source_id experiment_id \\\n", "0 (c, l, i, v, i) DYAMOND_WINTER CAMS GRIST-5km DW-ATM \n", "1 (c, l, t) DYAMOND_WINTER CAMS GRIST-5km DW-ATM \n", "\n", " simulation_id realm frequency time_reduction grid_label level_type \\\n", "0 r1i1p1f1 atmos 15min unkonwn gn 2d \n", "1 r1i1p1f1 atmos 15min unkonwn gn 2d \n", "\n", " time_min time_max grid_id format \\\n", "0 2020-01-20T00:00:00.000 2020-01-20T23:45:00.000 not_implemented netcdf \n", "1 2020-01-20T00:00:00.000 2020-01-20T23:45:00.000 not_implemented netcdf \n", "\n", " uri \n", "0 /work/ka1081/DYAMOND_WINTER/CAMS/GRIST-5km/DW-ATM/atmos/15min/clivi/r1i1p1f1/2d/gn/clivi_15min_GRIST-5km_DW-ATM_r1i1p1f1_2d_gn_20200120000000-20200120234500.nc \n", "1 /work/ka1081/DYAMOND_WINTER/CAMS/GRIST-5km/DW-ATM/atmos/15min/clt/r1i1p1f1/2d/gn/clt_15min_GRIST-5km_DW-ATM_r1i1p1f1_2d_gn_20200120000000-20200120234500.nc " ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cat.df.head(n=2)" ] }, { "cell_type": "markdown", "id": "ac7ee2a6-1e77-4e2d-8f39-349fadfc1446", "metadata": {}, "source": [ "**To reduce the output, we have defined a helper function in the header of this document.\n", "We can use it to get an overview of projects, experiments, and models in the catalog.**" ] }, { "cell_type": "code", "execution_count": 4, "id": "6e6e0494-e101-498f-ab82-99d36e61a58a", "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
projectexperiment_idsource_idsimulation_id
0DYAMOND_WINTERDW-ATMARPEGE-NH-2kmr1i1p1f1
1DYAMOND_WINTERDW-ATMGEMr1i1p1f1
2DYAMOND_WINTERDW-ATMGEOS-1kmr1i1p1f1
3DYAMOND_WINTERDW-ATMGEOS-3kmr1i1p1f1
4DYAMOND_WINTERDW-ATMGRIST-5kmr1i1p1f1
5DYAMOND_WINTERDW-ATMICON-NWP-2kmr1i1p1f1
6DYAMOND_WINTERDW-ATMICON-SAP-5kmdpp0014
7DYAMOND_WINTERDW-ATMMPAS-3kmr1i1p1f1
8DYAMOND_WINTERDW-ATMSCREAM-3kmr1i1p1f1
9DYAMOND_WINTERDW-ATMSHiELD-3kmr1i1p1f1
10DYAMOND_WINTERDW-ATMUM-5kmr1i1p1f1
11DYAMOND_WINTERDW-ATMgSAM-4kmr1i1p1f1
12DYAMOND_WINTERDW-CPLGEOS-6kmr1i1p1f1
13DYAMOND_WINTERDW-CPLICON-SAP-5kmdpp0029
14DYAMOND_WINTERDW-CPLICON-SAP-5kmr1i1p1f1
15DYAMOND_WINTERDW-CPLIFS-4kmr1i1p1f1
16DYAMOND_WINTERDW-CPLIFS-9kmr1i1p1f1
17nextGEMSCycle1IFS-FESOM2-4kmhlq0
18nextGEMSCycle1IFS-NEMO-4kmhmrt
19nextGEMSCycle1IFS-NEMO-9kmhmt0
20nextGEMSCycle1IFS-NEMO-DEEPon-4kmhmwz
21nextGEMSCycle2-alphaICON-ESMdpp0066
22nextGEMSCycle2-alphaICON-ESMdpp0067
23nextGEMSnextgems_cycle2ICON-ESMngc2009
24nextGEMSnextgems_cycle2ICON-ESMngc2012
25nextGEMSnextgems_cycle2ICON-ESMngc2013
26nextGEMSnextgems_cycle2IFS-FESOMHQYS
27nextGEMSnextgems_cycle2IFS-FESOMHR0N
28nextGEMSnextgems_cycle2IFS-FESOMHR2N
29nextGEMSnextgems_cycle2IFS-FESOMHR2N_nodeep
\n", "
" ], "text/plain": [ " project experiment_id source_id simulation_id\n", "0 DYAMOND_WINTER DW-ATM ARPEGE-NH-2km r1i1p1f1\n", "1 DYAMOND_WINTER DW-ATM GEM r1i1p1f1\n", "2 DYAMOND_WINTER DW-ATM GEOS-1km r1i1p1f1\n", "3 DYAMOND_WINTER DW-ATM GEOS-3km r1i1p1f1\n", "4 DYAMOND_WINTER DW-ATM GRIST-5km r1i1p1f1\n", "5 DYAMOND_WINTER DW-ATM ICON-NWP-2km r1i1p1f1\n", "6 DYAMOND_WINTER DW-ATM ICON-SAP-5km dpp0014\n", "7 DYAMOND_WINTER DW-ATM MPAS-3km r1i1p1f1\n", "8 DYAMOND_WINTER DW-ATM SCREAM-3km r1i1p1f1\n", "9 DYAMOND_WINTER DW-ATM SHiELD-3km r1i1p1f1\n", "10 DYAMOND_WINTER DW-ATM UM-5km r1i1p1f1\n", "11 DYAMOND_WINTER DW-ATM gSAM-4km r1i1p1f1\n", "12 DYAMOND_WINTER DW-CPL GEOS-6km r1i1p1f1\n", "13 DYAMOND_WINTER DW-CPL ICON-SAP-5km dpp0029\n", "14 DYAMOND_WINTER DW-CPL ICON-SAP-5km r1i1p1f1\n", "15 DYAMOND_WINTER DW-CPL IFS-4km r1i1p1f1\n", "16 DYAMOND_WINTER DW-CPL IFS-9km r1i1p1f1\n", "17 nextGEMS Cycle1 IFS-FESOM2-4km hlq0\n", "18 nextGEMS Cycle1 IFS-NEMO-4km hmrt\n", "19 nextGEMS Cycle1 IFS-NEMO-9km hmt0\n", "20 nextGEMS Cycle1 IFS-NEMO-DEEPon-4km hmwz\n", "21 nextGEMS Cycle2-alpha ICON-ESM dpp0066\n", "22 nextGEMS Cycle2-alpha ICON-ESM dpp0067\n", "23 nextGEMS nextgems_cycle2 ICON-ESM ngc2009\n", "24 nextGEMS nextgems_cycle2 ICON-ESM ngc2012\n", "25 nextGEMS nextgems_cycle2 ICON-ESM ngc2013\n", "26 nextGEMS nextgems_cycle2 IFS-FESOM HQYS\n", "27 nextGEMS nextgems_cycle2 IFS-FESOM HR0N\n", "28 nextGEMS nextgems_cycle2 IFS-FESOM HR2N\n", "29 nextGEMS nextgems_cycle2 IFS-FESOM HR2N_nodeep" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "get_from_cat(cat, [\"project\", \"experiment_id\", \"source_id\", \"simulation_id\"])" ] }, { "cell_type": "markdown", "id": "789249e2-a736-4871-a6de-1cf3a29bdddc", "metadata": {}, "source": [ "**Let's look into the variables of ICON in NGC2009.\n", "Detailed information about how to search the catalog can be found [here](https://intake-esm.readthedocs.io/en/stable/tutorials/loading-cmip6-data.html#finding-unique-entries).**" ] }, { "cell_type": "code", "execution_count": 5, "id": "1f2dd3d9-c677-4f74-a0cb-997db00e9b84", "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", "
realmfrequencyvariable_id
0atm1day(clt, evspsbl, tas, ts, rldscs, rlutcs, rsdscs, rsuscs, rsutcs)
1atm1day(psl, clt, evspsbl, tas, ts, rldscs, rlutcs, rsdscs, rsuscs, rsutcs)
2atm1month(sfcwind, clivi, cllvi, cptgzvi, hfls, hfss, prlr, pr, prw, qgvi, qrvi, qsvi, rlds, rlus, rlut, rsds, rsdt, rsus, rsut, tauu, tauv, rpds_dir, rpds_dif, rvds_dif, rnds_dif)
3atm1month(sfcwind, clivi, cllvi, cptgzvi, hfls, hfss, prlr, pr, prw, qgvi, qrvi, qsvi, rlds, rlus, rlut, rsds, rsdt, rsus, rsut, tauu, tauv, rpds_dir, rpds_dif, rvds_dif, rnds_dif, clt, evspsbl, tas, ts, rldscs, rlutcs, rsdscs, rsuscs, rsutcs)
4atm1month(sfcwind, clivi, cllvi, cptgzvi, hfls, hfss, prlr, pr, prw, qgvi, qrvi, qsvi, rlds, rlus, rlut, rsds, rsdt, rsus, rsut, tauu, tauv, rpds_dir, rpds_dif, rvds_dif, rnds_dif, psl, clt, evspsbl, tas, ts, rldscs, rlutcs, rsdscs, rsuscs, rsutcs)
5atm1month(ua, va, wa, ta, hus, rho, clw, cli, pfull, zghalf, zg, dzghalf)
6atm2hour(phalf,)
7atm2minute(fc, frland, hsurf, p, rnds_dif, rnds_dir, rsds, rvds_dif, rvds_dir, soiltype, t, u, v, w)
8atm30minute(hydro_canopy_cond_limited_box, hydro_w_snow_box, hydro_snow_soil_dens_box)
9atm30minute(hydro_discharge_ocean_box, hydro_drainage_box, hydro_runoff_box, hydro_transpiration_box, sse_grnd_hflx_old_box)
10atm30minute(psl, ps, sit, sic, tas, ts, uas, vas, cfh_lnd)
11atm30minute(sfcwind, clivi, cllvi, cptgzvi, hfls, hfss, prlr, pr, prw, qgvi, qrvi, qsvi, rlds, rlus, rlut, rsds, rsdt, rsus, rsut, tauu, tauv, rpds_dir, rpds_dif, rvds_dif, rnds_dif)
12atm6hour(clw, cli, pfull)
13atm6hour(hydro_w_soil_sl_box, hydro_w_ice_sl_box, sse_t_soil_sl_box)
14atm6hour(ta, hus, rho)
15atm6hour(ta, ua, va, clw, hus, zfull, cli, pv)
16atm6hour(tas_gmean, rsdt_gmean, rsut_gmean, rlut_gmean, radtop_gmean, prec_gmean, evap_gmean, fwfoce_gmean)
17atm6hour(ua, va, wa)
18atmfx(zghalf, zg, dzghalf)
19lnd1month(hydro_discharge_ocean_box, hydro_drainage_box, hydro_runoff_box, hydro_transpiration_box, sse_grnd_hflx_old_box, hydro_canopy_cond_limited_box, hydro_w_snow_box, hydro_snow_soil_dens_box, hydro_w_soil_sl_box, hydro_w_ice_sl_box, sse_t_soil_sl_box)
20oce1day(atlantic_hfbasin, atlantic_hfl, atlantic_moc, atlantic_sltbasin, atlantic_wfl, global_hfbasin, global_hfl, global_moc, global_sltbasin, global_wfl, pacific_hfbasin, pacific_hfl, pacific_moc, pacific_sltbasin, pacific_wfl)
21oce1day(atmos_fluxes_FrshFlux_Evaporation, atmos_fluxes_FrshFlux_Precipitation, atmos_fluxes_FrshFlux_Runoff, atmos_fluxes_FrshFlux_SnowFall, atmos_fluxes_HeatFlux_Latent, atmos_fluxes_HeatFlux_LongWave, atmos_fluxes_HeatFlux_Sensible, atmos_fluxes_HeatFlux_ShortWave, atmos_fluxes_HeatFlux_Total, atmos_fluxes_stress_x, atmos_fluxes_stress_xw, atmos_fluxes_stress_y, atmos_fluxes_stress_yw, conc, heat_content_seaice, heat_content_snow, heat_content_total, hi, hs, ice_u, ice_v, mlotst, Qbot, Qtop, sea_level_pressure, stretch_c, zos, verticallyTotal_mass_flux_e, Wind_Speed_10m)
22oce1day(so, tke, to, u, v, w, A_tracer_v_to, A_veloc_v, heat_content_liquid_water)
23oce1hour(atmos_fluxes_FrshFlux_Evaporation, atmos_fluxes_FrshFlux_Precipitation, atmos_fluxes_FrshFlux_Runoff, atmos_fluxes_FrshFlux_SnowFall, atmos_fluxes_HeatFlux_Latent, atmos_fluxes_HeatFlux_LongWave, atmos_fluxes_HeatFlux_Sensible, atmos_fluxes_HeatFlux_ShortWave, atmos_fluxes_HeatFlux_Total, atmos_fluxes_stress_x, atmos_fluxes_stress_xw, atmos_fluxes_stress_y, atmos_fluxes_stress_yw, Qbot, Qtop)
24oce1hour(so, to, u, v, conc, hi, hs, ice_u, ice_v, mlotst, sea_level_pressure, stretch_c, Wind_Speed_10m, zos)
25oce1month(A_tracer_v_to, tke)
26oce1month(atmos_fluxes_FrshFlux_Evaporation, atmos_fluxes_FrshFlux_Precipitation, atmos_fluxes_FrshFlux_Runoff, atmos_fluxes_FrshFlux_SnowFall, atmos_fluxes_HeatFlux_Latent, atmos_fluxes_HeatFlux_LongWave, atmos_fluxes_HeatFlux_Sensible, atmos_fluxes_HeatFlux_ShortWave, atmos_fluxes_HeatFlux_Total, atmos_fluxes_stress_x, atmos_fluxes_stress_xw, atmos_fluxes_stress_y, atmos_fluxes_stress_yw, conc, heat_content_seaice, heat_content_snow, heat_content_total, hi, hs, ice_u, ice_v, mlotst, Qbot, Qtop, sea_level_pressure, stretch_c, zos, Wind_Speed_10m)
27oce1month(so, tke, to, u, v, w, A_tracer_v_to, heat_content_liquid_water)
28oce1month(so, to, u, v, w)
29oce3hour(A_tracer_v_to, A_veloc_v, tke)
30oce3hour(so, to, u, v, w)
31oce6hour(total_salt, total_saltinseaice, total_saltinliquidwater, amoc26n, kin_energy_global, pot_energy_global, total_energy_global, ssh_global, sst_global, sss_global, potential_enstrophy_global, HeatFlux_Total_global, FrshFlux_Precipitation_global, FrshFlux_SnowFall_global, FrshFlux_Evaporation_global, FrshFlux_Runoff_global, FrshFlux_VolumeIce_global, FrshFlux_TotalOcean_global, FrshFlux_TotalIce_global, FrshFlux_VolumeTotal_global, totalsnowfall_global, ice_volume_nh, ice_volume_sh, ice_extent_nh, ice_extent_sh, global_heat_content, global_heat_content_solid)
\n", "
" ], "text/plain": [ " realm frequency \\\n", "0 atm 1day \n", "1 atm 1day \n", "2 atm 1month \n", "3 atm 1month \n", "4 atm 1month \n", "5 atm 1month \n", "6 atm 2hour \n", "7 atm 2minute \n", "8 atm 30minute \n", "9 atm 30minute \n", "10 atm 30minute \n", "11 atm 30minute \n", "12 atm 6hour \n", "13 atm 6hour \n", "14 atm 6hour \n", "15 atm 6hour \n", "16 atm 6hour \n", "17 atm 6hour \n", "18 atm fx \n", "19 lnd 1month \n", "20 oce 1day \n", "21 oce 1day \n", "22 oce 1day \n", "23 oce 1hour \n", "24 oce 1hour \n", "25 oce 1month \n", "26 oce 1month \n", "27 oce 1month \n", "28 oce 1month \n", "29 oce 3hour \n", "30 oce 3hour \n", "31 oce 6hour \n", "\n", " variable_id \n", "0 (clt, evspsbl, tas, ts, rldscs, rlutcs, rsdscs, rsuscs, rsutcs) \n", "1 (psl, clt, evspsbl, tas, ts, rldscs, rlutcs, rsdscs, rsuscs, rsutcs) \n", "2 (sfcwind, clivi, cllvi, cptgzvi, hfls, hfss, prlr, pr, prw, qgvi, qrvi, qsvi, rlds, rlus, rlut, rsds, rsdt, rsus, rsut, tauu, tauv, rpds_dir, rpds_dif, rvds_dif, rnds_dif) \n", "3 (sfcwind, clivi, cllvi, cptgzvi, hfls, hfss, prlr, pr, prw, qgvi, qrvi, qsvi, rlds, rlus, rlut, rsds, rsdt, rsus, rsut, tauu, tauv, rpds_dir, rpds_dif, rvds_dif, rnds_dif, clt, evspsbl, tas, ts, rldscs, rlutcs, rsdscs, rsuscs, rsutcs) \n", "4 (sfcwind, clivi, cllvi, cptgzvi, hfls, hfss, prlr, pr, prw, qgvi, qrvi, qsvi, rlds, rlus, rlut, rsds, rsdt, rsus, rsut, tauu, tauv, rpds_dir, rpds_dif, rvds_dif, rnds_dif, psl, clt, evspsbl, tas, ts, rldscs, rlutcs, rsdscs, rsuscs, rsutcs) \n", "5 (ua, va, wa, ta, hus, rho, clw, cli, pfull, zghalf, zg, dzghalf) \n", "6 (phalf,) \n", "7 (fc, frland, hsurf, p, rnds_dif, rnds_dir, rsds, rvds_dif, rvds_dir, soiltype, t, u, v, w) \n", "8 (hydro_canopy_cond_limited_box, hydro_w_snow_box, hydro_snow_soil_dens_box) \n", "9 (hydro_discharge_ocean_box, hydro_drainage_box, hydro_runoff_box, hydro_transpiration_box, sse_grnd_hflx_old_box) \n", "10 (psl, ps, sit, sic, tas, ts, uas, vas, cfh_lnd) \n", "11 (sfcwind, clivi, cllvi, cptgzvi, hfls, hfss, prlr, pr, prw, qgvi, qrvi, qsvi, rlds, rlus, rlut, rsds, rsdt, rsus, rsut, tauu, tauv, rpds_dir, rpds_dif, rvds_dif, rnds_dif) \n", "12 (clw, cli, pfull) \n", "13 (hydro_w_soil_sl_box, hydro_w_ice_sl_box, sse_t_soil_sl_box) \n", "14 (ta, hus, rho) \n", "15 (ta, ua, va, clw, hus, zfull, cli, pv) \n", "16 (tas_gmean, rsdt_gmean, rsut_gmean, rlut_gmean, radtop_gmean, prec_gmean, evap_gmean, fwfoce_gmean) \n", "17 (ua, va, wa) \n", "18 (zghalf, zg, dzghalf) \n", "19 (hydro_discharge_ocean_box, hydro_drainage_box, hydro_runoff_box, hydro_transpiration_box, sse_grnd_hflx_old_box, hydro_canopy_cond_limited_box, hydro_w_snow_box, hydro_snow_soil_dens_box, hydro_w_soil_sl_box, hydro_w_ice_sl_box, sse_t_soil_sl_box) \n", "20 (atlantic_hfbasin, atlantic_hfl, atlantic_moc, atlantic_sltbasin, atlantic_wfl, global_hfbasin, global_hfl, global_moc, global_sltbasin, global_wfl, pacific_hfbasin, pacific_hfl, pacific_moc, pacific_sltbasin, pacific_wfl) \n", "21 (atmos_fluxes_FrshFlux_Evaporation, atmos_fluxes_FrshFlux_Precipitation, atmos_fluxes_FrshFlux_Runoff, atmos_fluxes_FrshFlux_SnowFall, atmos_fluxes_HeatFlux_Latent, atmos_fluxes_HeatFlux_LongWave, atmos_fluxes_HeatFlux_Sensible, atmos_fluxes_HeatFlux_ShortWave, atmos_fluxes_HeatFlux_Total, atmos_fluxes_stress_x, atmos_fluxes_stress_xw, atmos_fluxes_stress_y, atmos_fluxes_stress_yw, conc, heat_content_seaice, heat_content_snow, heat_content_total, hi, hs, ice_u, ice_v, mlotst, Qbot, Qtop, sea_level_pressure, stretch_c, zos, verticallyTotal_mass_flux_e, Wind_Speed_10m) \n", "22 (so, tke, to, u, v, w, A_tracer_v_to, A_veloc_v, heat_content_liquid_water) \n", "23 (atmos_fluxes_FrshFlux_Evaporation, atmos_fluxes_FrshFlux_Precipitation, atmos_fluxes_FrshFlux_Runoff, atmos_fluxes_FrshFlux_SnowFall, atmos_fluxes_HeatFlux_Latent, atmos_fluxes_HeatFlux_LongWave, atmos_fluxes_HeatFlux_Sensible, atmos_fluxes_HeatFlux_ShortWave, atmos_fluxes_HeatFlux_Total, atmos_fluxes_stress_x, atmos_fluxes_stress_xw, atmos_fluxes_stress_y, atmos_fluxes_stress_yw, Qbot, Qtop) \n", "24 (so, to, u, v, conc, hi, hs, ice_u, ice_v, mlotst, sea_level_pressure, stretch_c, Wind_Speed_10m, zos) \n", "25 (A_tracer_v_to, tke) \n", "26 (atmos_fluxes_FrshFlux_Evaporation, atmos_fluxes_FrshFlux_Precipitation, atmos_fluxes_FrshFlux_Runoff, atmos_fluxes_FrshFlux_SnowFall, atmos_fluxes_HeatFlux_Latent, atmos_fluxes_HeatFlux_LongWave, atmos_fluxes_HeatFlux_Sensible, atmos_fluxes_HeatFlux_ShortWave, atmos_fluxes_HeatFlux_Total, atmos_fluxes_stress_x, atmos_fluxes_stress_xw, atmos_fluxes_stress_y, atmos_fluxes_stress_yw, conc, heat_content_seaice, heat_content_snow, heat_content_total, hi, hs, ice_u, ice_v, mlotst, Qbot, Qtop, sea_level_pressure, stretch_c, zos, Wind_Speed_10m) \n", "27 (so, tke, to, u, v, w, A_tracer_v_to, heat_content_liquid_water) \n", "28 (so, to, u, v, w) \n", "29 (A_tracer_v_to, A_veloc_v, tke) \n", "30 (so, to, u, v, w) \n", "31 (total_salt, total_saltinseaice, total_saltinliquidwater, amoc26n, kin_energy_global, pot_energy_global, total_energy_global, ssh_global, sst_global, sss_global, potential_enstrophy_global, HeatFlux_Total_global, FrshFlux_Precipitation_global, FrshFlux_SnowFall_global, FrshFlux_Evaporation_global, FrshFlux_Runoff_global, FrshFlux_VolumeIce_global, FrshFlux_TotalOcean_global, FrshFlux_TotalIce_global, FrshFlux_VolumeTotal_global, totalsnowfall_global, ice_volume_nh, ice_volume_sh, ice_extent_nh, ice_extent_sh, global_heat_content, global_heat_content_solid) " ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "get_from_cat(cat.search(simulation_id=\"ngc2009\"), [\"realm\", \"frequency\", \"variable_id\"])" ] }, { "cell_type": "markdown", "id": "b9481a0d-73ae-4a24-a98a-34105b68682a", "metadata": {}, "source": [ "**Let's look into surface air temperature (tas)**" ] }, { "cell_type": "code", "execution_count": 6, "id": "29ca2538-6603-41e6-8e39-c3cfa56ac5c9", "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", "
realmfrequencylevel_typevariable_id
0atm1dayml(clt, evspsbl, tas, ts, rldscs, rlutcs, rsdscs, rsuscs, rsutcs)
1atm1dayml(psl, clt, evspsbl, tas, ts, rldscs, rlutcs, rsdscs, rsuscs, rsutcs)
2atm1monthml(sfcwind, clivi, cllvi, cptgzvi, hfls, hfss, prlr, pr, prw, qgvi, qrvi, qsvi, rlds, rlus, rlut, rsds, rsdt, rsus, rsut, tauu, tauv, rpds_dir, rpds_dif, rvds_dif, rnds_dif, clt, evspsbl, tas, ts, rldscs, rlutcs, rsdscs, rsuscs, rsutcs)
3atm1monthml(sfcwind, clivi, cllvi, cptgzvi, hfls, hfss, prlr, pr, prw, qgvi, qrvi, qsvi, rlds, rlus, rlut, rsds, rsdt, rsus, rsut, tauu, tauv, rpds_dir, rpds_dif, rvds_dif, rnds_dif, psl, clt, evspsbl, tas, ts, rldscs, rlutcs, rsdscs, rsuscs, rsutcs)
4atm30minuteml(psl, ps, sit, sic, tas, ts, uas, vas, cfh_lnd)
\n", "
" ], "text/plain": [ " realm frequency level_type \\\n", "0 atm 1day ml \n", "1 atm 1day ml \n", "2 atm 1month ml \n", "3 atm 1month ml \n", "4 atm 30minute ml \n", "\n", " variable_id \n", "0 (clt, evspsbl, tas, ts, rldscs, rlutcs, rsdscs, rsuscs, rsutcs) \n", "1 (psl, clt, evspsbl, tas, ts, rldscs, rlutcs, rsdscs, rsuscs, rsutcs) \n", "2 (sfcwind, clivi, cllvi, cptgzvi, hfls, hfss, prlr, pr, prw, qgvi, qrvi, qsvi, rlds, rlus, rlut, rsds, rsdt, rsus, rsut, tauu, tauv, rpds_dir, rpds_dif, rvds_dif, rnds_dif, clt, evspsbl, tas, ts, rldscs, rlutcs, rsdscs, rsuscs, rsutcs) \n", "3 (sfcwind, clivi, cllvi, cptgzvi, hfls, hfss, prlr, pr, prw, qgvi, qrvi, qsvi, rlds, rlus, rlut, rsds, rsdt, rsus, rsut, tauu, tauv, rpds_dir, rpds_dif, rvds_dif, rnds_dif, psl, clt, evspsbl, tas, ts, rldscs, rlutcs, rsdscs, rsuscs, rsutcs) \n", "4 (psl, ps, sit, sic, tas, ts, uas, vas, cfh_lnd) " ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "get_from_cat(\n", " cat.search(simulation_id=\"ngc2009\", variable_id=\"tas\"),\n", " [\"realm\", \"frequency\", \"level_type\", \"variable_id\"],\n", ")" ] }, { "cell_type": "code", "execution_count": 7, "id": "849d8703-62be-44fa-9373-08f104685861", "metadata": {}, "outputs": [ { "data": { "text/html": [ "

/work/k20200/k202134/Catalogs/dng-merged catalog with 1 dataset(s) from 817 asset(s):

\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
unique
variable_id9
project1
institution_id1
source_id1
experiment_id1
simulation_id1
realm1
frequency1
time_reduction1
grid_label1
level_type1
time_min817
time_max817
grid_id1
format1
uri817
\n", "
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "hits = cat.search(simulation_id=\"ngc2009\", variable_id=\"tas\", frequency=\"30minute\")\n", "# The 1day files would have crashed the jupyter because the files are inconsistent across the run.\n", "hits" ] }, { "cell_type": "markdown", "id": "99055d11-cee1-4516-8e7d-8f2479124f15", "metadata": {}, "source": [ "**Note**: The variable_id field still is on 9, as there are 9 variables in total in the file(s) containing tas." ] }, { "cell_type": "markdown", "id": "4816f6cc-254c-47ca-87a8-ebce27f9601a", "metadata": {}, "source": [ "## Loading the Data" ] }, { "cell_type": "markdown", "id": "ce1ee181-948b-4884-94d6-8918d19ddb4d", "metadata": {}, "source": [ "When you searched the catalog and now want to access the actual data, it is time to load it.\n", "\n", "The Option `cdf_kwargs={\"chunks\": {\"time\":1}}` is used, so that only reasonably sized chunks of data are loaded at a time. Your kernel WILL break if you want to load the whole set at once!" ] }, { "cell_type": "code", "execution_count": 8, "id": "55cebf32-be72-4cce-b35c-901b21b14587", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "--> The keys in the returned dictionary of datasets are constructed as follows:\n", "\t'project.institution_id.source_id.experiment_id.simulation_id.realm.frequency.time_reduction.grid_label.level_type'\n" ] }, { "data": { "text/html": [ "\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n", "
\n", " \n", " 100.00% [1/1 00:00<00:00]\n", "
\n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "dataset_dict = hits.to_dataset_dict(cdf_kwargs={\"chunks\": {\"time\": 1}})" ] }, { "cell_type": "markdown", "id": "7c8bd5fc-77df-4fa0-b65a-9bfb47884ed8", "metadata": {}, "source": [ "We have only one dataset, to access it, we need the keys:" ] }, { "cell_type": "code", "execution_count": 9, "id": "6dd9e394-7499-4362-bb0c-4ee6ca81cd9d", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['nextGEMS.MPI-M.ICON-ESM.nextgems_cycle2.ngc2009.atm.30minute.inst.gn.ml']" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "keys = list(dataset_dict.keys())\n", "keys" ] }, { "cell_type": "markdown", "id": "d18e5612-2028-4d4a-8735-d992b34c8bcc", "metadata": {}, "source": [ "Now we can finally access the data:" ] }, { "cell_type": "code", "execution_count": 10, "id": "eb051981-1e78-4e76-bdfc-dbbcc6cf66e8", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
<xarray.Dataset>\n",
       "Dimensions:  (time: 36722, height: 1, ncells: 20971520)\n",
       "Coordinates:\n",
       "  * height   (height) float64 2.0\n",
       "  * time     (time) datetime64[ns] 2020-01-20 2020-01-20T00:30:00 ... 2022-03-01\n",
       "Dimensions without coordinates: ncells\n",
       "Data variables:\n",
       "    tas      (time, height, ncells) float32 dask.array<chunksize=(1, 1, 20971520), meta=np.ndarray>\n",
       "Attributes: (12/13)\n",
       "    Conventions:             CF-1.6\n",
       "    institution:             Max Planck Institute for Meteorology/Deutscher W...\n",
       "    number_of_grid_used:     15\n",
       "    CDI:                     Climate Data Interface version 1.8.3rc (http://m...\n",
       "    uuidOfHGrid:             0f1e7d66-637e-11e8-913b-51232bb4d8f9\n",
       "    history:                 ./icon at 20220512 152214\\n./icon at 20220512 19...\n",
       "    ...                      ...\n",
       "    title:                   ICON simulation\n",
       "    grid_file_uri:           http://icon-downloads.mpimet.mpg.de/grids/public...\n",
       "    comment:                 Sapphire Dyamond (k203123) on l10739 (Linux 4.18...\n",
       "    source:                  git@gitlab.dkrz.de:icon/icon-aes.git@87a1eaded69...\n",
       "    intake_esm_varname:      ['tas']\n",
       "    intake_esm_dataset_key:  nextGEMS.MPI-M.ICON-ESM.nextgems_cycle2.ngc2009....
" ], "text/plain": [ "\n", "Dimensions: (time: 36722, height: 1, ncells: 20971520)\n", "Coordinates:\n", " * height (height) float64 2.0\n", " * time (time) datetime64[ns] 2020-01-20 2020-01-20T00:30:00 ... 2022-03-01\n", "Dimensions without coordinates: ncells\n", "Data variables:\n", " tas (time, height, ncells) float32 dask.array\n", "Attributes: (12/13)\n", " Conventions: CF-1.6\n", " institution: Max Planck Institute for Meteorology/Deutscher W...\n", " number_of_grid_used: 15\n", " CDI: Climate Data Interface version 1.8.3rc (http://m...\n", " uuidOfHGrid: 0f1e7d66-637e-11e8-913b-51232bb4d8f9\n", " history: ./icon at 20220512 152214\\n./icon at 20220512 19...\n", " ... ...\n", " title: ICON simulation\n", " grid_file_uri: http://icon-downloads.mpimet.mpg.de/grids/public...\n", " comment: Sapphire Dyamond (k203123) on l10739 (Linux 4.18...\n", " source: git@gitlab.dkrz.de:icon/icon-aes.git@87a1eaded69...\n", " intake_esm_varname: ['tas']\n", " intake_esm_dataset_key: nextGEMS.MPI-M.ICON-ESM.nextgems_cycle2.ngc2009...." ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dataset = dataset_dict[keys[0]]\n", "dataset" ] }, { "cell_type": "code", "execution_count": 11, "id": "91130f78-08ab-45e9-a7fc-2466e5b9276f", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array(225.27545, dtype=float32)" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dataset.tas.isel(time=1).min().values\n", "# the first time step just contains zeros, so we take the second by saying isel(time=1)" ] }, { "cell_type": "code", "execution_count": 12, "id": "9ca331ab-6a67-4c4c-aa38-c2c3989a4fd7", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array(312.81677, dtype=float32)" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dataset.tas.isel(time=1).max().values" ] }, { "cell_type": "code", "execution_count": 13, "id": "759b160e-0875-4eae-ae67-9854564de9c5", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
<xarray.DataArray 'tas' (time: 36722, height: 1)>\n",
       "dask.array<_nanmax_skip-aggregate, shape=(36722, 1), dtype=float32, chunksize=(1, 1), chunktype=numpy.ndarray>\n",
       "Coordinates:\n",
       "  * height   (height) float64 2.0\n",
       "  * time     (time) datetime64[ns] 2020-01-20 2020-01-20T00:30:00 ... 2022-03-01
" ], "text/plain": [ "\n", "dask.array<_nanmax_skip-aggregate, shape=(36722, 1), dtype=float32, chunksize=(1, 1), chunktype=numpy.ndarray>\n", "Coordinates:\n", " * height (height) float64 2.0\n", " * time (time) datetime64[ns] 2020-01-20 2020-01-20T00:30:00 ... 2022-03-01" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "dataset.tas.max(dim=\"ncells\") # lazy evaluation - no real work is done yet." ] }, { "cell_type": "code", "execution_count": 14, "id": "2ff9ce0a-5fdd-4cc9-8104-867858dd8e52", "metadata": {}, "outputs": [], "source": [ "# evaluate if you have time to spare\n", "# dataset.tas.max(dim=\"ncells\").values" ] } ], "metadata": { "jupytext": { "notebook_metadata_filter": "-jupytext.text_representation.jupytext_version" }, "kernelspec": { "display_name": "Python 3 (based on the module python3/2022.01)", "language": "python", "name": "python3_2022_01" }, "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.9.9" } }, "nbformat": 4, "nbformat_minor": 5 }