{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Histogram of field(s)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "execution": { "iopub.execute_input": "2025-01-13T11:31:56.108139Z", "iopub.status.busy": "2025-01-13T11:31:56.107637Z", "iopub.status.idle": "2025-01-13T11:31:56.633431Z", "shell.execute_reply": "2025-01-13T11:31:56.632833Z" } }, "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:56.635451Z", "iopub.status.busy": "2025-01-13T11:31:56.635245Z", "iopub.status.idle": "2025-01-13T11:31:56.777533Z", "shell.execute_reply": "2025-01-13T11:31:56.777040Z" } }, "outputs": [], "source": [ "# open resource in read mode\n", "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:56.779485Z", "iopub.status.busy": "2025-01-13T11:31:56.779298Z", "iopub.status.idle": "2025-01-13T11:31:58.869755Z", "shell.execute_reply": "2025-01-13T11:31:58.869232Z" } }, "outputs": [], "source": [ "t90 = r.readfield('S090TEMPERATURE')\n", "t90.sp2gp()\n", "t2m = r.readfield('CLSTEMPERATURE')" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "execution": { "iopub.execute_input": "2025-01-13T11:31:58.871715Z", "iopub.status.busy": "2025-01-13T11:31:58.871471Z", "iopub.status.idle": "2025-01-13T11:31:59.116483Z", "shell.execute_reply": "2025-01-13T11:31:59.116037Z" } }, "outputs": [], "source": [ "fig, ax = t2m.histogram(subzone='CI', bins=50)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "execution": { "iopub.execute_input": "2025-01-13T11:31:59.118043Z", "iopub.status.busy": "2025-01-13T11:31:59.117852Z", "iopub.status.idle": "2025-01-13T11:31:59.380687Z", "shell.execute_reply": "2025-01-13T11:31:59.380166Z" } }, "outputs": [], "source": [ "fig, ax = t2m.histogram(subzone='CI', bins=50, together_with=t90)" ] }, { "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 }