{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Figure 11.\n", "\n", "Histograms of instantaneous TOA OLR values in (a, b) the full *HighRes* domain, sampled over 100 days, and (c, d) in the central part of the *HighRes* domain (shown by the blue box in Figs. 9 and 10), sampled over 10 days for (a) Trappist-1e and (b) Proxima b. Light blue bars show the global model values, while dark blue bars show *HighRes* model values" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "[Skip code and jump to the figure](#Show-the-figure)\n", "\n", "----------------------------------" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Import the necessary libraries." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import warnings\n", "\n", "warnings.filterwarnings(\"ignore\")" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from datetime import datetime, timedelta" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Progress bar" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "from fastprogress import progress_bar" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Scientific stack" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "import iris\n", "\n", "import numpy as np\n", "\n", "import matplotlib.pyplot as plt" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "from aeolus.coord_utils import UM_LATLON\n", "from aeolus.core import Run\n", "from aeolus.region import Region\n", "from aeolus.subset import _dim_constr\n", "from aeolus.util import fmt_lonlat, subplot_label_generator" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Local modules" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "from commons import (\n", " DT_FMT,\n", " FCST_DIM_CNSTR,\n", " FCST_PRD_CNSTR,\n", " GLM_RUNID,\n", " NS_COLORS,\n", " NS_MODEL_TYPES,\n", " NS_OUTPUT_NAME_PREFIX,\n", " NS_RUN_ALIASES,\n", " NS_RUNID,\n", " PLANET_ALIASES,\n", " SS_REGION,\n", ")\n", "import mypaths\n", "from plot_func import use_style\n", "from proc_um_output import process_cubes" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Global stylesheet for figures." ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "use_style()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Define two sampling methods: a large domain and the duration of 100 days, and a smaller domain with only the last 10 days." ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "# Simulation time (the UM simulation length is defined using real Earth dates,\n", "# whose exact values obviously do not matter for exoplanets)\n", "\n", "SAMPLE_METHODS = {\n", " \"100day_full_domain\": {\n", " \"start\": datetime(2009, 4, 28, 9, 0),\n", " \"ndays\": 100,\n", " \"region\": Region(-22, 42, -30, 30, \"highres_domain\"),\n", " \"title\": \"Full HighRes domain,\\nlast 100 days\",\n", " },\n", " \"10day_ss_region\": {\n", " \"start\": datetime(2009, 7, 27, 9, 0),\n", " \"ndays\": 10,\n", " \"region\": SS_REGION,\n", " \"title\": \"Subset of HighRes domain,\\nlast 10 days\",\n", " },\n", "}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Load data" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Change file mask to load only the files with TOA radiation data." ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "NS_MODEL_TYPES[\"global\"][\"path\"] = (\n", " NS_MODEL_TYPES[\"global\"][\"path\"].parent / f\"{GLM_RUNID}_pd*\"\n", ")\n", "NS_MODEL_TYPES[\"lam\"][\"path\"] = NS_MODEL_TYPES[\"lam\"][\"path\"].parent / f\"{NS_RUNID}_pa*\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Create a dictionary of `Run` objects with UM data." ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "