{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Global lon/lat grids: shift center" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "execution": { "iopub.execute_input": "2025-01-13T11:30:35.694841Z", "iopub.status.busy": "2025-01-13T11:30:35.694334Z", "iopub.status.idle": "2025-01-13T11:30:36.218463Z", "shell.execute_reply": "2025-01-13T11:30:36.217894Z" } }, "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:30:36.220744Z", "iopub.status.busy": "2025-01-13T11:30:36.220541Z", "iopub.status.idle": "2025-01-13T11:30:36.240304Z", "shell.execute_reply": "2025-01-13T11:30:36.239928Z" } }, "outputs": [], "source": [ "r = epygram.open(os.path.join(INPUTS_DIR, 'glob01.grib'), 'r')" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "execution": { "iopub.execute_input": "2025-01-13T11:30:36.242011Z", "iopub.status.busy": "2025-01-13T11:30:36.241863Z", "iopub.status.idle": "2025-01-13T11:30:36.389578Z", "shell.execute_reply": "2025-01-13T11:30:36.389061Z" } }, "outputs": [], "source": [ "f = r.readfield('shortName:prmsl')" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "execution": { "iopub.execute_input": "2025-01-13T11:30:36.391668Z", "iopub.status.busy": "2025-01-13T11:30:36.391500Z", "iopub.status.idle": "2025-01-13T11:30:47.359426Z", "shell.execute_reply": "2025-01-13T11:30:47.358997Z" } }, "outputs": [], "source": [ "fig, ax = f.cartoplot()" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "execution": { "iopub.execute_input": "2025-01-13T11:30:47.363865Z", "iopub.status.busy": "2025-01-13T11:30:47.363716Z", "iopub.status.idle": "2025-01-13T11:30:57.971857Z", "shell.execute_reply": "2025-01-13T11:30:57.971369Z" } }, "outputs": [], "source": [ "f.global_shift_center(180)\n", "fig, ax = f.cartoplot()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "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 }