{ "cells": [ { "cell_type": "markdown", "id": "6bd56b4e", "metadata": {}, "source": [ "1. Load 1993-04_uv_multilevel_dhourmean.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-11-01T17:20:28.207774Z", "start_time": "2022-11-01T17:20:27.244490Z" } }, "outputs": [], "source": [ "import metview as mv" ] }, { "cell_type": "code", "execution_count": 3, "id": "2e28c5d2", "metadata": { "ExecuteTime": { "end_time": "2022-11-01T17:21:56.852297Z", "start_time": "2022-11-01T17:21:56.210108Z" } }, "outputs": [], "source": [ "uv = mv.read('/bog/amuttaqin/Datasets/ERA5/skto/1991_skto.grib')" ] }, { "cell_type": "code", "execution_count": 4, "id": "105ac9b6", "metadata": { "ExecuteTime": { "end_time": "2022-11-01T17:22:07.745120Z", "start_time": "2022-11-01T17:22:00.011013Z" } }, "outputs": [ { "data": { "text/html": [ " \n", " \n", " \n", " \n", "
parametertypeOfLevelleveldatetimestepparamIdclassstreamtypeexperimentVersionNumber
sktsurface019910101,19910102,...0,100,...0235eaoperan0001
" ], "text/plain": [ "" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "uv.describe()" ] }, { "cell_type": "code", "execution_count": null, "id": "9093af26", "metadata": { "ExecuteTime": { "end_time": "2022-02-07T17:20:12.333154Z", "start_time": "2022-02-07T17:20:12.253475Z" } }, "outputs": [], "source": [ "uv.describe('u')" ] }, { "cell_type": "code", "execution_count": null, "id": "178ba83f", "metadata": { "ExecuteTime": { "end_time": "2022-02-07T17:20:15.772739Z", "start_time": "2022-02-07T17:20:15.764003Z" } }, "outputs": [], "source": [ "uv.describe('v')" ] }, { "cell_type": "code", "execution_count": null, "id": "534bdfc0", "metadata": { "ExecuteTime": { "end_time": "2022-02-07T17:10:18.802704Z", "start_time": "2022-02-07T17:10:18.424966Z" } }, "outputs": [], "source": [ "v = mv.read(data = uv, param = 'v')" ] }, { "cell_type": "code", "execution_count": null, "id": "613e4cb0", "metadata": { "ExecuteTime": { "end_time": "2022-02-07T17:10:27.290871Z", "start_time": "2022-02-07T17:10:27.053048Z" } }, "outputs": [], "source": [ "u = mv.read(data = uv, param = 'u')" ] }, { "cell_type": "code", "execution_count": null, "id": "d5c146a4", "metadata": { "ExecuteTime": { "end_time": "2022-02-07T17:10:32.742809Z", "start_time": "2022-02-07T17:10:32.150420Z" } }, "outputs": [], "source": [ "spd = mv.sqrt(u*u + v*v)" ] }, { "cell_type": "code", "execution_count": null, "id": "fbc5dc3b", "metadata": { "ExecuteTime": { "end_time": "2022-02-07T17:10:53.166229Z", "start_time": "2022-02-07T17:10:53.124275Z" } }, "outputs": [], "source": [ "v[0].describe()" ] }, { "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": null, "id": "7882642f", "metadata": { "ExecuteTime": { "end_time": "2022-02-07T17:19:35.511393Z", "start_time": "2022-02-07T17:19:35.023759Z" } }, "outputs": [], "source": [ "v1000 = mv.read(data = v, levelist = 1000)\n", "spd1000 = mv.read(data = spd, levelist = 1000)" ] }, { "cell_type": "code", "execution_count": null, "id": "aff42b3f", "metadata": { "ExecuteTime": { "end_time": "2022-02-07T17:12:13.098058Z", "start_time": "2022-02-07T17:12:13.056399Z" } }, "outputs": [], "source": [ "v1000[0].describe()" ] }, { "cell_type": "code", "execution_count": null, "id": "7660847f", "metadata": { "ExecuteTime": { "end_time": "2022-02-07T17:12:17.855472Z", "start_time": "2022-02-07T17:12:17.822671Z" } }, "outputs": [], "source": [ "mv.setoutput('jupyter')" ] }, { "cell_type": "code", "execution_count": null, "id": "4a1879eb", "metadata": { "ExecuteTime": { "end_time": "2022-02-07T17:15:45.487099Z", "start_time": "2022-02-07T17:15:40.951245Z" } }, "outputs": [], "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": null, "id": "fc193dec", "metadata": { "ExecuteTime": { "end_time": "2022-02-07T17:13:29.858926Z", "start_time": "2022-02-07T17:13:29.856568Z" } }, "outputs": [], "source": [ "line = [-7.2,106,-8.6,114] # S, W, N, E" ] }, { "cell_type": "code", "execution_count": null, "id": "e6454e05", "metadata": { "ExecuteTime": { "end_time": "2022-02-07T17:13:35.974618Z", "start_time": "2022-02-07T17:13:31.252959Z" } }, "outputs": [], "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", " v1000,\n", " mv.mcont(contour_automatic_setting='ecmwf', legend='on'),\n", " mv.mvl_geoline(*line,1),line_graph\n", ")" ] }, { "cell_type": "code", "execution_count": null, "id": "4f7fc8f8", "metadata": { "ExecuteTime": { "end_time": "2022-02-07T17:13:42.923582Z", "start_time": "2022-02-07T17:13:42.916481Z" } }, "outputs": [], "source": [ "xs_view = mv.mxsectview(\n", " bottom_level = 1000.0,\n", " top_level = 500,\n", " line = line\n", " )" ] }, { "cell_type": "code", "execution_count": null, "id": "d5eedc6d", "metadata": { "ExecuteTime": { "end_time": "2022-02-07T17:13:46.381275Z", "start_time": "2022-02-07T17:13:46.377493Z" } }, "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": null, "id": "55ffb58f", "metadata": { "ExecuteTime": { "end_time": "2022-02-07T17:19:21.313822Z", "start_time": "2022-02-07T17:19:21.311339Z" } }, "outputs": [], "source": [ "mv.plot(xs_view, v[step='696'], xs_shade)" ] }, { "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" }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": true, "toc_window_display": false }, "varInspector": { "cols": { "lenName": 16, "lenType": 16, "lenVar": 40 }, "kernels_config": { "python": { "delete_cmd_postfix": "", "delete_cmd_prefix": "del ", "library": "var_list.py", "varRefreshCmd": "print(var_dic_list())" }, "r": { "delete_cmd_postfix": ") ", "delete_cmd_prefix": "rm(", "library": "var_list.r", "varRefreshCmd": "cat(var_dic_list()) " } }, "types_to_exclude": [ "module", "function", "builtin_function_or_method", "instance", "_Feature" ], "window_display": false } }, "nbformat": 4, "nbformat_minor": 5 }