{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Superposition of 2 fields" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "execution": { "iopub.execute_input": "2025-01-13T11:30:59.830211Z", "iopub.status.busy": "2025-01-13T11:30:59.829597Z", "iopub.status.idle": "2025-01-13T11:31:00.360529Z", "shell.execute_reply": "2025-01-13T11:31:00.359861Z" } }, "outputs": [], "source": [ "%matplotlib inline\n", "# for figures in notebook\n", "\n", "# import & initialize epygram\n", "import epygram\n", "epygram.init_env()\n", "\n", "import os\n", "INPUTS_DIR = os.path.join('..', 'inputs')" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "execution": { "iopub.execute_input": "2025-01-13T11:31:00.362816Z", "iopub.status.busy": "2025-01-13T11:31:00.362585Z", "iopub.status.idle": "2025-01-13T11:31:00.512104Z", "shell.execute_reply": "2025-01-13T11:31:00.511372Z" } }, "outputs": [], "source": [ "r = epygram.open(os.path.join(INPUTS_DIR, 'ICMSHAROM+0022'), 'r')" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "execution": { "iopub.execute_input": "2025-01-13T11:31:00.514390Z", "iopub.status.busy": "2025-01-13T11:31:00.514181Z", "iopub.status.idle": "2025-01-13T11:31:02.614603Z", "shell.execute_reply": "2025-01-13T11:31:02.614084Z" } }, "outputs": [], "source": [ "ps = r.readfield('SURFPRESSION')\n", "ps.sp2gp()\n", "rain = r.readfield('SURFACCPLUIE')" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "execution": { "iopub.execute_input": "2025-01-13T11:31:02.616868Z", "iopub.status.busy": "2025-01-13T11:31:02.616646Z", "iopub.status.idle": "2025-01-13T11:31:03.337073Z", "shell.execute_reply": "2025-01-13T11:31:03.336691Z" } }, "outputs": [], "source": [ "fig, ax = ps.cartoplot(plot_method='contour', colorsnumber=5, contourcolor='green')\n", "fig, ax = rain.cartoplot(fig=fig, ax=ax, colormap='rr1h')" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.10.12" } }, "nbformat": 4, "nbformat_minor": 2 }