Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 73 additions & 16 deletions docs/source/how-tos/bufr/bufr_synop.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,48 @@
"ds"
]
},
{
"cell_type": "raw",
"id": "29a316e5-adec-45fa-9e9e-13ce50a768f5",
"metadata": {
"editable": true,
"raw_mimetype": "text/restructuredtext",
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [
"To inspect BUFR data we need to convert it into a featureslist. It is a similar object to a fieldList, but it is an iterable of “features”, where a “feature” can be anything. In a BUFR featurelist each feature is a BUFR message (a :py:class:`~earthkit.data.readers.bufr.message.BUFRMessage` object)."
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "5eda4c70-0eea-4cc2-ba84-a915d7048eec",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [],
"source": [
"ds = ds.to_featurelist()"
"fl = ds.to_featurelist()"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "07571864-48af-451b-be4a-6a42436d193c",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [
{
"data": {
Expand All @@ -100,7 +127,7 @@
}
],
"source": [
"len(ds)"
"len(fl)"
]
},
{
Expand All @@ -115,7 +142,7 @@
"tags": []
},
"source": [
"We use :py:meth:`~earthkit.data.readers.bufr.file.BUFRList.ls` to see metadata from the header section of the BUFR messages: "
"We use :py:meth:`~earthkit.data.readers.bufr.file.BUFRList.ls` to see metadata from the header section of each BUFR message: "
]
},
{
Expand Down Expand Up @@ -387,7 +414,7 @@
}
],
"source": [
"ds.ls()"
"fl.ls()"
]
},
{
Expand Down Expand Up @@ -549,7 +576,7 @@
}
],
"source": [
"df = ds.to_pandas(columns=[\"latitude\", \"longitude\", \"heightOfStation\", \"airTemperatureAt2M\"])\n",
"df = fl.to_pandas(columns=[\"latitude\", \"longitude\", \"heightOfStation\", \"airTemperatureAt2M\"])\n",
"df"
]
},
Expand All @@ -573,7 +600,13 @@
"cell_type": "code",
"execution_count": 7,
"id": "26cebaca-9b17-4e15-9564-d92804886ea9",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -636,7 +669,7 @@
}
],
"source": [
"df = ds.to_pandas(\n",
"df = fl.to_pandas(\n",
" columns=[\"latitude\", \"longitude\", \"heightOfStation\", \"airTemperatureAt2M\", \"WMO_station_id\"],\n",
" filters={\"WMO_station_id\": [30846, 89514]},\n",
")\n",
Expand All @@ -655,7 +688,13 @@
"cell_type": "code",
"execution_count": 8,
"id": "04ec7393-8969-4f46-82a6-5feb8f8a54c8",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -723,7 +762,7 @@
}
],
"source": [
"df = ds.to_pandas(\n",
"df = fl.to_pandas(\n",
" columns=[\"latitude\", \"longitude\", \"heightOfStation\", \"airTemperatureAt2M\"],\n",
" filters={\"airTemperatureAt2M\": slice(None, 290)},\n",
")\n",
Expand All @@ -742,7 +781,13 @@
"cell_type": "code",
"execution_count": 9,
"id": "d75fe63b-baaa-43fa-8689-c3838e6b0fe5",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -818,7 +863,7 @@
}
],
"source": [
"df = ds.to_pandas(\n",
"df = fl.to_pandas(\n",
" columns=[\"latitude\", \"longitude\", \"heightOfStation\", \"airTemperatureAt2M\"],\n",
" filters={\"airTemperatureAt2M\": slice(290, 300)},\n",
")\n",
Expand All @@ -837,7 +882,13 @@
"cell_type": "code",
"execution_count": 10,
"id": "c7611278-9426-46fd-8c49-402545122414",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [
{
"data": {
Expand Down Expand Up @@ -905,7 +956,7 @@
}
],
"source": [
"df = ds.to_pandas(\n",
"df = fl.to_pandas(\n",
" columns=[\"latitude\", \"longitude\", \"heightOfStation\", \"airTemperatureAt2M\"],\n",
" filters={\"airTemperatureAt2M\": slice(300, None)},\n",
")\n",
Expand All @@ -916,7 +967,13 @@
"cell_type": "code",
"execution_count": null,
"id": "eb71e23d-d813-471e-8749-c283ee7e9ada",
"metadata": {},
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"outputs": [],
"source": []
}
Expand Down
Loading
Loading