diff --git a/docs/source/how-tos/grib/grib_array_namespace.ipynb b/docs/source/how-tos/grib/grib_array_namespace.ipynb
index 5bac248e..7175f35a 100644
--- a/docs/source/how-tos/grib/grib_array_namespace.ipynb
+++ b/docs/source/how-tos/grib/grib_array_namespace.ipynb
@@ -25,7 +25,7 @@
"tags": []
},
"source": [
- "In this example we will use a GRIB file containing 4 messages. First we ensure the file is available and read it into a fieldlist."
+ "In this example we will use a GRIB file containing 4 messages."
]
},
{
@@ -39,12 +39,26 @@
},
"tags": []
},
- "outputs": [],
+ "outputs": [
+ {
+ "data": {
+ "application/vnd.jupyter.widget-view+json": {
+ "model_id": "04d3229edb8841ecbc451a3f9a2eadae",
+ "version_major": 2,
+ "version_minor": 0
+ },
+ "text/plain": [
+ "test4.grib: 0%| | 0.00/509k [00:00, ?B/s]"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
"source": [
"import earthkit.data as ekd\n",
"\n",
- "ekd.download_example_file(\"test4.grib\")\n",
- "ds_in = ekd.from_source(\"file\", \"test4.grib\").to_fieldlist()"
+ "fl_in = ekd.from_source(\"sample\", \"test4.grib\").to_fieldlist()"
]
},
{
@@ -86,16 +100,6 @@
"execution_count": 2,
"id": "6ec4489f-2030-4a55-8292-7f50fb845677",
"metadata": {},
- "outputs": [],
- "source": [
- "ds = ds_in.to_fieldlist()"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 3,
- "id": "07e0823d-ff1d-43d1-8ffb-e5a6d0616ce4",
- "metadata": {},
"outputs": [
{
"data": {
@@ -103,13 +107,14 @@
"4"
]
},
- "execution_count": 3,
+ "execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
- "len(ds)"
+ "fl = fl_in.to_fieldlist()\n",
+ "len(fl)"
]
},
{
@@ -130,7 +135,7 @@
},
{
"cell_type": "code",
- "execution_count": 4,
+ "execution_count": 3,
"id": "b3b30d9f-0edb-4938-baec-7026acd70192",
"metadata": {
"editable": true,
@@ -146,7 +151,7 @@
},
{
"cell_type": "code",
- "execution_count": 5,
+ "execution_count": 4,
"id": "5d2174d7-0f36-4b20-8ad5-bd93fd12f91b",
"metadata": {
"editable": true,
@@ -157,12 +162,12 @@
},
"outputs": [],
"source": [
- "ds = ds_in.to_fieldlist(array_namespace=\"torch\")"
+ "fl = fl_in.to_fieldlist(array_namespace=\"torch\")"
]
},
{
"cell_type": "code",
- "execution_count": 6,
+ "execution_count": 5,
"id": "3c108a25-5f41-422f-9adb-98c932205dce",
"metadata": {
"editable": true,
@@ -266,13 +271,13 @@
"3 850 pressure 0 regular_ll "
]
},
- "execution_count": 6,
+ "execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
- "ds.ls()"
+ "fl.ls()"
]
},
{
@@ -306,7 +311,7 @@
},
{
"cell_type": "code",
- "execution_count": 7,
+ "execution_count": 6,
"id": "21a1e8b1-f0e5-4de6-bdbf-e92c5df5989e",
"metadata": {
"editable": true,
@@ -323,18 +328,18 @@
" 228.0460, 228.0460, 228.0460], dtype=torch.float64)"
]
},
- "execution_count": 7,
+ "execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
- "ds[0].values[:10]"
+ "fl[0].values[:10]"
]
},
{
"cell_type": "code",
- "execution_count": 8,
+ "execution_count": 7,
"id": "fbd92126-bb5b-47e5-80a7-d4bed3097764",
"metadata": {
"editable": true,
@@ -350,18 +355,18 @@
"torch.Size([65160])"
]
},
- "execution_count": 8,
+ "execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
- "ds[0].values.shape"
+ "fl[0].values.shape"
]
},
{
"cell_type": "code",
- "execution_count": 9,
+ "execution_count": 8,
"id": "714b320c-90ea-4326-bc5f-340dda66daab",
"metadata": {
"editable": true,
@@ -377,13 +382,13 @@
"torch.Size([4, 65160])"
]
},
- "execution_count": 9,
+ "execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
- "ds.values.shape"
+ "fl.values.shape"
]
},
{
@@ -417,7 +422,7 @@
},
{
"cell_type": "code",
- "execution_count": 10,
+ "execution_count": 9,
"id": "f60797eb-d578-4638-b1d0-bd18949dd249",
"metadata": {
"editable": true,
@@ -434,18 +439,18 @@
" [228.6085, 228.5792]], dtype=torch.float64)"
]
},
- "execution_count": 10,
+ "execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
- "ds[0].to_array()[:2, :2]"
+ "fl[0].to_array()[:2, :2]"
]
},
{
"cell_type": "code",
- "execution_count": 11,
+ "execution_count": 10,
"id": "f4d053fa-2acf-4949-9bbd-a0b2ccf30318",
"metadata": {
"editable": true,
@@ -461,18 +466,18 @@
"torch.Size([4, 181, 360])"
]
},
- "execution_count": 11,
+ "execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
- "ds.to_array().shape"
+ "fl.to_array().shape"
]
},
{
"cell_type": "code",
- "execution_count": 12,
+ "execution_count": 11,
"id": "04cd31df-34cd-47a9-90cc-833b9805bd55",
"metadata": {
"editable": true,
@@ -488,13 +493,13 @@
"torch.Size([4, 65160])"
]
},
- "execution_count": 12,
+ "execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
- "ds.to_array(flatten=True).shape"
+ "fl.to_array(flatten=True).shape"
]
},
{
@@ -528,7 +533,7 @@
},
{
"cell_type": "code",
- "execution_count": 13,
+ "execution_count": 12,
"id": "b60eea0f-0da1-48f1-a64e-f1b75e36a737",
"metadata": {
"editable": true,
@@ -545,18 +550,18 @@
" [228.60850525, 228.57920837]])"
]
},
- "execution_count": 13,
+ "execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
- "ds[0].to_numpy()[:2, :2]"
+ "fl[0].to_numpy()[:2, :2]"
]
},
{
"cell_type": "code",
- "execution_count": 14,
+ "execution_count": 13,
"id": "ae6bd7cd-b043-4993-b715-e5ea2531490a",
"metadata": {
"editable": true,
@@ -572,40 +577,34 @@
"(4, 181, 360)"
]
},
- "execution_count": 14,
+ "execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
- "ds.to_numpy().shape"
+ "fl.to_numpy().shape"
]
},
{
"cell_type": "markdown",
- "id": "920f6b98-f0e6-4ffc-a5e4-f8f643c23f76",
- "metadata": {
- "editable": true,
- "slideshow": {
- "slide_type": ""
- },
- "tags": []
- },
+ "id": "48f6f5a4-1304-43ef-b357-563cfa071309",
+ "metadata": {},
"source": [
- "As expected, the values in *r1* are now differing by 2 from the ones in the original fieldlist (*r*)."
+ "### Building a fieldlist in a loop"
]
},
{
"cell_type": "markdown",
- "id": "48f6f5a4-1304-43ef-b357-563cfa071309",
+ "id": "7270c9ed-9bf9-4261-b949-b3f32d0af268",
"metadata": {},
"source": [
- "### Building an array fieldlist in a loop"
+ "The following cell adds 2 to each field value and creates a new fieldlist from the modified fields."
]
},
{
"cell_type": "code",
- "execution_count": 15,
+ "execution_count": 18,
"id": "a4b086a5-406d-4d1c-bd93-1edbde84bf81",
"metadata": {},
"outputs": [
@@ -703,22 +702,36 @@
"3 850 pressure 0 regular_ll "
]
},
- "execution_count": 15,
+ "execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"fields = []\n",
- "for f in ds:\n",
+ "for f in fl:\n",
" fields.append(f.set(values=f.values + 2.0))\n",
"r1 = ekd.create_fieldlist(fields)\n",
"r1.ls()"
]
},
+ {
+ "cell_type": "markdown",
+ "id": "920f6b98-f0e6-4ffc-a5e4-f8f643c23f76",
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
+ "source": [
+ "As expected, the values in *r1* are now differing by 2 from the ones in the original fieldlist (*r*)."
+ ]
+ },
{
"cell_type": "code",
- "execution_count": 16,
+ "execution_count": 15,
"id": "5b78ea8a-64e9-4bfa-9d11-8b390995994b",
"metadata": {
"editable": true,
@@ -735,7 +748,7 @@
" 230.0460, 230.0460, 230.0460], dtype=torch.float64)"
]
},
- "execution_count": 16,
+ "execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
@@ -776,7 +789,7 @@
},
{
"cell_type": "code",
- "execution_count": 17,
+ "execution_count": 16,
"id": "9ceea7b3-5059-4378-9a26-d282caa3b74a",
"metadata": {
"editable": true,
@@ -880,7 +893,7 @@
"3 850 pressure 0 regular_ll "
]
},
- "execution_count": 17,
+ "execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
@@ -888,13 +901,13 @@
"source": [
"path = \"_from_pytroch.grib\"\n",
"r1.to_target(\"file\", path)\n",
- "ds1 = ekd.from_source(\"file\", path).to_fieldlist()\n",
- "ds1.ls()"
+ "fl1 = ekd.from_source(\"file\", path).to_fieldlist()\n",
+ "fl1.ls()"
]
},
{
"cell_type": "code",
- "execution_count": 18,
+ "execution_count": 17,
"id": "1ed4315d-0078-4e2e-b8a1-88b132f71da0",
"metadata": {},
"outputs": [
@@ -906,14 +919,14 @@
" 230.04600525, 230.04600525])"
]
},
- "execution_count": 18,
+ "execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# the modified values were correctly written to the GRIB file\n",
- "ds1[0].values[:10]"
+ "fl1[0].values[:10]"
]
},
{
diff --git a/docs/source/how-tos/grib/grib_contents.ipynb b/docs/source/how-tos/grib/grib_contents.ipynb
index ed040886..b14b18c0 100644
--- a/docs/source/how-tos/grib/grib_contents.ipynb
+++ b/docs/source/how-tos/grib/grib_contents.ipynb
@@ -41,7 +41,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
- "model_id": "f3160c346d904c93bacc5d7fbdba96ac",
+ "model_id": "234a1782252d42c885a0f608553d68b4",
"version_major": 2,
"version_minor": 0
},
@@ -56,7 +56,7 @@
"source": [
"import earthkit.data as ekd\n",
"\n",
- "ds = ekd.from_source(\"sample\", \"test6.grib\").to_fieldlist()"
+ "fl = ekd.from_source(\"sample\", \"test6.grib\").to_fieldlist()"
]
},
{
@@ -69,7 +69,7 @@
"tags": []
},
"source": [
- "### Using ls(), head() and tail()"
+ "## ls()"
]
},
{
@@ -83,34 +83,7 @@
"tags": []
},
"source": [
- "All these methods (see e.g.: :py:meth:`~earthkit.data.core.fieldlist.FieldList.ls`) take the same set of keyword arguments."
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {
- "editable": true,
- "slideshow": {
- "slide_type": ""
- },
- "tags": []
- },
- "source": [
- "#### ls()"
- ]
- },
- {
- "cell_type": "raw",
- "metadata": {
- "editable": true,
- "raw_mimetype": "text/restructuredtext",
- "slideshow": {
- "slide_type": ""
- },
- "tags": []
- },
- "source": [
- ":py:meth:`~earthkit.data.core.fieldlist.FieldList.ls`) lists all the fields:"
+ ":py:meth:`~earthkit.data.core.fieldlist.FieldList.ls` lists all the fields:"
]
},
{
@@ -250,7 +223,7 @@
}
],
"source": [
- "ds.ls()"
+ "fl.ls()"
]
},
{
@@ -264,6 +237,10 @@
"cell_type": "code",
"execution_count": 3,
"metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
"tags": []
},
"outputs": [
@@ -341,13 +318,17 @@
}
],
"source": [
- "ds.ls(2)"
+ "fl.ls(2)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
"tags": []
},
"outputs": [
@@ -425,7 +406,7 @@
}
],
"source": [
- "ds.ls(n=2)"
+ "fl.ls(n=2)"
]
},
{
@@ -445,7 +426,13 @@
{
"cell_type": "code",
"execution_count": 5,
- "metadata": {},
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
"outputs": [
{
"data": {
@@ -516,13 +503,19 @@
}
],
"source": [
- "ds.ls(keys=\"time.base_datetime\")"
+ "fl.ls(keys=\"time.base_datetime\")"
]
},
{
"cell_type": "code",
"execution_count": 6,
- "metadata": {},
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
"outputs": [
{
"data": {
@@ -600,7 +593,7 @@
}
],
"source": [
- "ds.ls(keys=[\"time.base_datetime\", \"vertical.level\"])"
+ "fl.ls(keys=[\"time.base_datetime\", \"vertical.level\"])"
]
},
{
@@ -613,7 +606,13 @@
{
"cell_type": "code",
"execution_count": 7,
- "metadata": {},
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
"outputs": [
{
"data": {
@@ -708,6 +707,18 @@
"
regular_ll | \n",
" meter / second | \n",
" \n",
+ " \n",
+ " | 5 | \n",
+ " v | \n",
+ " 2018-08-01 12:00:00 | \n",
+ " 2018-08-01 12:00:00 | \n",
+ " 0 days | \n",
+ " 850 | \n",
+ " pressure | \n",
+ " 0 | \n",
+ " regular_ll | \n",
+ " meter / second | \n",
+ "
\n",
" \n",
"\n",
""
@@ -719,6 +730,7 @@
"2 v 2018-08-01 12:00:00 2018-08-01 12:00:00 0 days \n",
"3 t 2018-08-01 12:00:00 2018-08-01 12:00:00 0 days \n",
"4 u 2018-08-01 12:00:00 2018-08-01 12:00:00 0 days \n",
+ "5 v 2018-08-01 12:00:00 2018-08-01 12:00:00 0 days \n",
"\n",
" vertical.level vertical.level_type ensemble.member geography.grid_type \\\n",
"0 1000 pressure 0 regular_ll \n",
@@ -726,13 +738,15 @@
"2 1000 pressure 0 regular_ll \n",
"3 850 pressure 0 regular_ll \n",
"4 850 pressure 0 regular_ll \n",
+ "5 850 pressure 0 regular_ll \n",
"\n",
" parameter.units \n",
"0 kelvin \n",
"1 meter / second \n",
"2 meter / second \n",
"3 kelvin \n",
- "4 meter / second "
+ "4 meter / second \n",
+ "5 meter / second "
]
},
"execution_count": 7,
@@ -741,14 +755,14 @@
}
],
"source": [
- "ds.head(extra_keys=\"parameter.units\")"
+ "fl.ls(extra_keys=\"parameter.units\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "#### tail()"
+ "## head()"
]
},
{
@@ -762,7 +776,7 @@
"tags": []
},
"source": [
- ":py:func:`~earthkit.data.core.fieldlist.FieldList.tail` displays the last 5 messages by default:"
+ ":py:meth:`~earthkit.data.core.fieldlist.FieldList.head` works in the same way as :py:meth:`~earthkit.data.core.fieldlist.FieldList.ls` but it lists fields from the start of the fieldlist."
]
},
{
@@ -810,7 +824,7 @@
" \n",
" \n",
" | 0 | \n",
- " u | \n",
+ " t | \n",
" 2018-08-01 12:00:00 | \n",
" 2018-08-01 12:00:00 | \n",
" 0 days | \n",
@@ -821,44 +835,11 @@
"
\n",
" \n",
" | 1 | \n",
- " v | \n",
- " 2018-08-01 12:00:00 | \n",
- " 2018-08-01 12:00:00 | \n",
- " 0 days | \n",
- " 1000 | \n",
- " pressure | \n",
- " 0 | \n",
- " regular_ll | \n",
- "
\n",
- " \n",
- " | 2 | \n",
- " t | \n",
- " 2018-08-01 12:00:00 | \n",
- " 2018-08-01 12:00:00 | \n",
- " 0 days | \n",
- " 850 | \n",
- " pressure | \n",
- " 0 | \n",
- " regular_ll | \n",
- "
\n",
- " \n",
- " | 3 | \n",
" u | \n",
" 2018-08-01 12:00:00 | \n",
" 2018-08-01 12:00:00 | \n",
" 0 days | \n",
- " 850 | \n",
- " pressure | \n",
- " 0 | \n",
- " regular_ll | \n",
- "
\n",
- " \n",
- " | 4 | \n",
- " v | \n",
- " 2018-08-01 12:00:00 | \n",
- " 2018-08-01 12:00:00 | \n",
- " 0 days | \n",
- " 850 | \n",
+ " 1000 | \n",
" pressure | \n",
" 0 | \n",
" regular_ll | \n",
@@ -869,18 +850,12 @@
],
"text/plain": [
" parameter.variable time.valid_datetime time.base_datetime time.step \\\n",
- "0 u 2018-08-01 12:00:00 2018-08-01 12:00:00 0 days \n",
- "1 v 2018-08-01 12:00:00 2018-08-01 12:00:00 0 days \n",
- "2 t 2018-08-01 12:00:00 2018-08-01 12:00:00 0 days \n",
- "3 u 2018-08-01 12:00:00 2018-08-01 12:00:00 0 days \n",
- "4 v 2018-08-01 12:00:00 2018-08-01 12:00:00 0 days \n",
+ "0 t 2018-08-01 12:00:00 2018-08-01 12:00:00 0 days \n",
+ "1 u 2018-08-01 12:00:00 2018-08-01 12:00:00 0 days \n",
"\n",
" vertical.level vertical.level_type ensemble.member geography.grid_type \n",
"0 1000 pressure 0 regular_ll \n",
- "1 1000 pressure 0 regular_ll \n",
- "2 850 pressure 0 regular_ll \n",
- "3 850 pressure 0 regular_ll \n",
- "4 850 pressure 0 regular_ll "
+ "1 1000 pressure 0 regular_ll "
]
},
"execution_count": 8,
@@ -889,14 +864,20 @@
}
],
"source": [
- "ds.tail(5)"
+ "fl.head(2)"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
"source": [
- "#### ls()"
+ "## tail()"
]
},
{
@@ -910,7 +891,7 @@
"tags": []
},
"source": [
- "By default :py:func:`~earthkit.data.fieldlist.FieldList.ls` lists all the fields:"
+ ":py:func:`~earthkit.data.core.fieldlist.FieldList.tail` works in the same way as :py:meth:`~earthkit.data.core.fieldlist.FieldList.ls` but it lists fields from the end of the fieldlist. "
]
},
{
@@ -923,229 +904,6 @@
},
"tags": []
},
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " | \n",
- " parameter.variable | \n",
- " time.valid_datetime | \n",
- " time.base_datetime | \n",
- " time.step | \n",
- " vertical.level | \n",
- " vertical.level_type | \n",
- " ensemble.member | \n",
- " geography.grid_type | \n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " | 0 | \n",
- " t | \n",
- " 2018-08-01 12:00:00 | \n",
- " 2018-08-01 12:00:00 | \n",
- " 0 days | \n",
- " 1000 | \n",
- " pressure | \n",
- " 0 | \n",
- " regular_ll | \n",
- "
\n",
- " \n",
- " | 1 | \n",
- " u | \n",
- " 2018-08-01 12:00:00 | \n",
- " 2018-08-01 12:00:00 | \n",
- " 0 days | \n",
- " 1000 | \n",
- " pressure | \n",
- " 0 | \n",
- " regular_ll | \n",
- "
\n",
- " \n",
- " | 2 | \n",
- " v | \n",
- " 2018-08-01 12:00:00 | \n",
- " 2018-08-01 12:00:00 | \n",
- " 0 days | \n",
- " 1000 | \n",
- " pressure | \n",
- " 0 | \n",
- " regular_ll | \n",
- "
\n",
- " \n",
- " | 3 | \n",
- " t | \n",
- " 2018-08-01 12:00:00 | \n",
- " 2018-08-01 12:00:00 | \n",
- " 0 days | \n",
- " 850 | \n",
- " pressure | \n",
- " 0 | \n",
- " regular_ll | \n",
- "
\n",
- " \n",
- " | 4 | \n",
- " u | \n",
- " 2018-08-01 12:00:00 | \n",
- " 2018-08-01 12:00:00 | \n",
- " 0 days | \n",
- " 850 | \n",
- " pressure | \n",
- " 0 | \n",
- " regular_ll | \n",
- "
\n",
- " \n",
- " | 5 | \n",
- " v | \n",
- " 2018-08-01 12:00:00 | \n",
- " 2018-08-01 12:00:00 | \n",
- " 0 days | \n",
- " 850 | \n",
- " pressure | \n",
- " 0 | \n",
- " regular_ll | \n",
- "
\n",
- " \n",
- "
\n",
- "
"
- ],
- "text/plain": [
- " parameter.variable time.valid_datetime time.base_datetime time.step \\\n",
- "0 t 2018-08-01 12:00:00 2018-08-01 12:00:00 0 days \n",
- "1 u 2018-08-01 12:00:00 2018-08-01 12:00:00 0 days \n",
- "2 v 2018-08-01 12:00:00 2018-08-01 12:00:00 0 days \n",
- "3 t 2018-08-01 12:00:00 2018-08-01 12:00:00 0 days \n",
- "4 u 2018-08-01 12:00:00 2018-08-01 12:00:00 0 days \n",
- "5 v 2018-08-01 12:00:00 2018-08-01 12:00:00 0 days \n",
- "\n",
- " vertical.level vertical.level_type ensemble.member geography.grid_type \n",
- "0 1000 pressure 0 regular_ll \n",
- "1 1000 pressure 0 regular_ll \n",
- "2 1000 pressure 0 regular_ll \n",
- "3 850 pressure 0 regular_ll \n",
- "4 850 pressure 0 regular_ll \n",
- "5 850 pressure 0 regular_ll "
- ]
- },
- "execution_count": 9,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "ds.ls()"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "The number of fields to list can also be specified:"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 10,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " | \n",
- " parameter.variable | \n",
- " time.valid_datetime | \n",
- " time.base_datetime | \n",
- " time.step | \n",
- " vertical.level | \n",
- " vertical.level_type | \n",
- " ensemble.member | \n",
- " geography.grid_type | \n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " | 0 | \n",
- " t | \n",
- " 2018-08-01 12:00:00 | \n",
- " 2018-08-01 12:00:00 | \n",
- " 0 days | \n",
- " 1000 | \n",
- " pressure | \n",
- " 0 | \n",
- " regular_ll | \n",
- "
\n",
- " \n",
- " | 1 | \n",
- " u | \n",
- " 2018-08-01 12:00:00 | \n",
- " 2018-08-01 12:00:00 | \n",
- " 0 days | \n",
- " 1000 | \n",
- " pressure | \n",
- " 0 | \n",
- " regular_ll | \n",
- "
\n",
- " \n",
- "
\n",
- "
"
- ],
- "text/plain": [
- " parameter.variable time.valid_datetime time.base_datetime time.step \\\n",
- "0 t 2018-08-01 12:00:00 2018-08-01 12:00:00 0 days \n",
- "1 u 2018-08-01 12:00:00 2018-08-01 12:00:00 0 days \n",
- "\n",
- " vertical.level vertical.level_type ensemble.member geography.grid_type \n",
- "0 1000 pressure 0 regular_ll \n",
- "1 1000 pressure 0 regular_ll "
- ]
- },
- "execution_count": 10,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "ds.ls(2)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 11,
- "metadata": {},
"outputs": [
{
"data": {
@@ -1215,33 +973,51 @@
"1 850 pressure 0 regular_ll "
]
},
- "execution_count": 11,
+ "execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
- "ds.ls(-2)"
+ "fl.tail(2)"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
"source": [
"### Inspecting fields"
]
},
{
"cell_type": "markdown",
- "metadata": {},
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
"source": [
"The simplest ways to inspect a field contents is to use the automatic display."
]
},
{
"cell_type": "code",
- "execution_count": 12,
- "metadata": {},
+ "execution_count": 10,
+ "metadata": {
+ "editable": true,
+ "slideshow": {
+ "slide_type": ""
+ },
+ "tags": []
+ },
"outputs": [
{
"data": {
@@ -1376,13 +1152,13 @@
" }\n",
"Field
\n",
"\n",
- "
\n",
+ "\n",
"\n",
"
\n",
"
\n",
"\n",
- "
\n",
- "
\n",
+ "
\n",
+ "
\n",
"
\n",
"