{
"cells": [
{
"cell_type": "markdown",
"id": "6bd56b4e",
"metadata": {},
"source": [
"1. Load 1993-04_uv_multilevel_hrmean.grib\n",
"2. Select meridional wind (v) and save as v\n",
"3. Done in cdo: Select time period for April 1-30 1993\n",
"4. Calculate hourly average for the period resulting only 24 times over MC for 6 layers of meridional wind\n",
"5. Plot cross-section over southern coast of Java, select representable land-breeze and sea-breeze"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "b16e45ed",
"metadata": {
"ExecuteTime": {
"end_time": "2022-02-07T16:48:45.838329Z",
"start_time": "2022-02-07T16:48:45.162913Z"
}
},
"outputs": [],
"source": [
"import metview as mv"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "2e28c5d2",
"metadata": {
"ExecuteTime": {
"end_time": "2022-02-07T16:48:58.988463Z",
"start_time": "2022-02-07T16:48:58.874649Z"
}
},
"outputs": [],
"source": [
"uv = mv.read('ERA5/uv_multilevel/1993-04_uv_multilevel_hrmean.grib')"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "105ac9b6",
"metadata": {
"ExecuteTime": {
"end_time": "2022-02-07T16:50:21.219716Z",
"start_time": "2022-02-07T16:50:21.139007Z"
}
},
"outputs": [
{
"data": {
"text/html": [
" \n",
"
\n",
"
\n",
" | shortName | u |
|---|
| name | U component of wind |
|---|
| paramId | 131 |
|---|
| units | m s**-1 |
|---|
| typeOfLevel | isobaricInhPa |
|---|
| level | 500,700,850,900,950,1000 |
|---|
| date | 19930401,19930402,19930403,19930404,19930405,19930406,19930407,19930408,19930409,19930410,19930411,19930412,19930413,19930414,19930415,19930416,19930417,19930418,19930419,19930420,19930421,19930422,19930423,19930424,19930425,19930426,19930427,19930428,19930429,19930430 |
|---|
| time | 0,100,200,300,400,500,600,700,800,900,1000,1100,1200,1300,1400,1500,1600,1700,1800,1900,2000,2100,2200,2300 |
|---|
| step | 0 |
|---|
| number | None |
|---|
| class | None |
|---|
| stream | None |
|---|
| type | None |
|---|
| experimentVersionNumber | None |
\n",
"
"
],
"text/plain": [
""
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"uv.describe('u')"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "534bdfc0",
"metadata": {
"ExecuteTime": {
"end_time": "2022-02-07T16:52:32.813367Z",
"start_time": "2022-02-07T16:52:29.277161Z"
}
},
"outputs": [],
"source": [
"v = mv.read(data = uv, param = 'v')"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "613e4cb0",
"metadata": {
"ExecuteTime": {
"end_time": "2022-02-07T16:52:36.498795Z",
"start_time": "2022-02-07T16:52:32.862261Z"
}
},
"outputs": [],
"source": [
"u = mv.read(data = uv, param = 'u')"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "d5c146a4",
"metadata": {
"ExecuteTime": {
"end_time": "2022-02-07T16:52:56.036450Z",
"start_time": "2022-02-07T16:52:38.928853Z"
}
},
"outputs": [],
"source": [
"spd = mv.sqrt(u*u + v*v)"
]
},
{
"cell_type": "markdown",
"id": "3f93de30",
"metadata": {},
"source": [
"Think again, how to filter wind component with certain criteria: perpendicular to a specified line"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "7882642f",
"metadata": {
"ExecuteTime": {
"end_time": "2022-02-07T16:53:04.053784Z",
"start_time": "2022-02-07T16:53:02.475769Z"
}
},
"outputs": [],
"source": [
"spd1000 = mv.read(data = spd, levelist = 1000)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "7660847f",
"metadata": {
"ExecuteTime": {
"end_time": "2022-02-07T16:53:06.402615Z",
"start_time": "2022-02-07T16:53:06.371014Z"
}
},
"outputs": [],
"source": [
"mv.setoutput('jupyter')"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "4a1879eb",
"metadata": {
"ExecuteTime": {
"end_time": "2022-02-07T16:55:57.714939Z",
"start_time": "2022-02-07T16:53:08.861536Z"
}
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "0b4920dc70cb4feaaa630c78708a0cf4",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Image(value=b'', layout=\"Layout(visibility='hidden')\")"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "073d9e1787ff45cb9526976363749d38",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Label(value='Generating plots....')"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "874adcb23cdf40a4a3cc1d11643a1196",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"VBox(children=(IntSlider(value=1, description='Frame:', layout=Layout(width='800px'), max=1, min=1), HBox(chil…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"view = mv.geoview(\n",
" map_area_definition = \"corners\",\n",
" area = [-10,105,-5,115]\n",
" )\n",
"mv.plot(view, spd1000, mv.mcont(contour_automatic_setting='ecmwf', legend='on'))"
]
},
{
"cell_type": "markdown",
"id": "8614b4d7",
"metadata": {},
"source": [
"Think again, how to average hourly from this period 1993-04"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "fc193dec",
"metadata": {
"ExecuteTime": {
"end_time": "2022-02-07T16:55:57.719078Z",
"start_time": "2022-02-07T16:55:57.716737Z"
}
},
"outputs": [],
"source": [
"line = [-7.2,106,-8.6,114] # S, W, N, E"
]
},
{
"cell_type": "code",
"execution_count": 13,
"id": "e6454e05",
"metadata": {
"ExecuteTime": {
"end_time": "2022-02-07T16:55:58.478699Z",
"start_time": "2022-02-07T16:55:57.720200Z"
}
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "837f086b961b4546b84569589a8a7dd9",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Image(value=b'', layout=\"Layout(visibility='hidden')\")"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "b461861a505f4a238cfa6df0e4b88ae1",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Label(value='Generating plots....')"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"line_graph = mv.mgraph(\n",
" graph_type = \"curve\",\n",
" graph_line_colour = \"pink\",\n",
" graph_line_thickness = 7\n",
")\n",
"\n",
"mv.plot(\n",
" view,\n",
" spd1000[0],\n",
" mv.mcont(contour_automatic_setting='ecmwf', legend='on'),\n",
" mv.mvl_geoline(*line,1),line_graph\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 14,
"id": "4f7fc8f8",
"metadata": {
"ExecuteTime": {
"end_time": "2022-02-07T16:55:58.487308Z",
"start_time": "2022-02-07T16:55:58.480614Z"
}
},
"outputs": [],
"source": [
"xs_view = mv.mxsectview(\n",
" bottom_level = 1000.0,\n",
" top_level = 500,\n",
" line = line\n",
" )"
]
},
{
"cell_type": "code",
"execution_count": 15,
"id": "d5eedc6d",
"metadata": {
"ExecuteTime": {
"end_time": "2022-02-07T16:55:58.492046Z",
"start_time": "2022-02-07T16:55:58.488435Z"
}
},
"outputs": [],
"source": [
"xs_shade = mv.mcont(\n",
" legend = \"on\",\n",
" contour_line_style = \"dash\",\n",
" contour_line_colour = \"charcoal\",\n",
" contour_highlight = \"off\",\n",
" contour_level_count = 20,\n",
" contour_label = \"off\",\n",
" contour_shade = \"on\",\n",
" contour_shade_method = \"area_fill\",\n",
" contour_shade_max_level_colour = \"red\",\n",
" contour_shade_min_level_colour = \"blue\",\n",
" contour_shade_colour_direction = \"clockwise\"\n",
" )"
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "fdb9ea5c",
"metadata": {
"ExecuteTime": {
"end_time": "2022-02-07T16:56:17.680481Z",
"start_time": "2022-02-07T16:55:58.493376Z"
}
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "9dd4b90eaae949cc9877f569852ed295",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Image(value=b'', layout=\"Layout(visibility='hidden')\")"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "3520b7d72f084f52b208f319db1ccd2d",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Label(value='Generating plots....')"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"mv.plot(xs_view, spd, xs_shade)"
]
},
{
"cell_type": "code",
"execution_count": 23,
"id": "55ffb58f",
"metadata": {
"ExecuteTime": {
"end_time": "2022-02-07T16:58:34.956769Z",
"start_time": "2022-02-07T16:58:16.164410Z"
}
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "2479c21aa3014c75828ddd1e0166d5ee",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Image(value=b'', layout=\"Layout(visibility='hidden')\")"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "119c8e9504bb4110b945440aa06800fe",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Label(value='Generating plots....')"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"mv.plot(xs_view, v, xs_shade)"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "065639ce",
"metadata": {
"ExecuteTime": {
"end_time": "2022-02-07T16:56:57.820496Z",
"start_time": "2022-02-07T16:56:57.817280Z"
}
},
"outputs": [
{
"data": {
"text/plain": [
""
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"v"
]
},
{
"cell_type": "code",
"execution_count": 21,
"id": "66ee675f",
"metadata": {
"ExecuteTime": {
"end_time": "2022-02-07T16:57:22.713824Z",
"start_time": "2022-02-07T16:57:22.710696Z"
}
},
"outputs": [
{
"data": {
"text/html": [
" \n",
" \n",
" | parameter | typeOfLevel | level | date | time | step | number | paramId | class | stream | type | experimentVersionNumber |
\n",
" | v | isobaricInhPa | 500,700,... | 19930401,19930402,... | 0,100,... | 0 | None | 132 | None | None | None | None |
\n",
"
"
],
"text/plain": [
""
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"v.describe()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "e2972bf4",
"metadata": {},
"outputs": [],
"source": []
}
],
"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.7.12"
}
},
"nbformat": 4,
"nbformat_minor": 5
}