{ "cells": [ { "cell_type": "markdown", "id": "a6d493e2", "metadata": {}, "source": [ "# Figures for the SAIL CMAC2.0 Technical Document" ] }, { "cell_type": "code", "execution_count": 14, "id": "0654aa66", "metadata": {}, "outputs": [], "source": [ "import os\n", "import glob\n", "import time\n", "import numpy as np\n", "import xarray as xr\n", "import pandas as pd\n", "\n", "from matplotlib import pyplot as plt\n", "from matplotlib import colors\n", "from matplotlib import ticker\n", "\n", "import pyart" ] }, { "cell_type": "code", "execution_count": 2, "id": "2144d34e", "metadata": {}, "outputs": [], "source": [ "def _generate_title(radar, ds, field, sweep):\n", " \"\"\" Generates a title for each plot. \"\"\"\n", " time_str = ds['time'].data[0]\n", " fixed_angle = radar.fixed_angle['data'][sweep]\n", " line_one = \"%.1f Deg. %s \" % (fixed_angle, time_str)\n", " field_name = str(field)\n", " field_name = field_name.replace('_', ' ')\n", " field_name = field_name[0].upper() + field_name[1:]\n", " return line_one + '\\n' + field_name" ] }, { "cell_type": "markdown", "id": "1f4d8151", "metadata": {}, "source": [ "### Processing Keywords" ] }, { "cell_type": "code", "execution_count": 3, "id": "23b20fa9", "metadata": {}, "outputs": [], "source": [ "# Directory where the data are located\n", "DATA_DIR = '/Users/jrobrien/ARM/data/CSU-XPrecipRadar/cmac2/'\n", "# Desired Case for the following figures\n", "CASE_FILE = 'gucxprecipradarcmacM1.c1.20220314-024759.nc'" ] }, { "cell_type": "code", "execution_count": 4, "id": "13430dc1", "metadata": {}, "outputs": [], "source": [ "# Easier to check variable names with xarray\n", "ds = xr.open_dataset(DATA_DIR + CASE_FILE)" ] }, { "cell_type": "code", "execution_count": 5, "id": "508059b6", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
<xarray.Dataset>\n", "Dimensions: (time: 9016, range: 668, sweep: 8)\n", "Coordinates:\n", " * time (time) datetime64[ns] 2022-03-1...\n", " * range (range) float32 306.9 ... 4.029...\n", " azimuth (time) float32 0.1251 ... 0.2962\n", " elevation (time) float32 1.055 ... 14.99\n", "Dimensions without coordinates: sweep\n", "Data variables: (12/46)\n", " DBZ (time, range) float64 ...\n", " VEL (time, range) float64 ...\n", " WIDTH (time, range) float64 ...\n", " ZDR (time, range) float64 ...\n", " PHIDP (time, range) float64 ...\n", " RHOHV (time, range) float64 ...\n", " ... ...\n", " longitude float64 -106.9\n", " altitude float64 3.149e+03\n", " time_coverage_start |S192 b'2022-03-14T02:47:59Z'\n", " time_coverage_end |S192 b'2022-03-14T02:52:08Z'\n", " time_reference |S192 b'1970-01-01T00:00:00Z'\n", " volume_number int32 0\n", "Attributes: (12/24)\n", " Conventions: CF/Radial instrument_parameters ARM-1.3\n", " site_id: guc\n", " facility_id: C1\n", " comment: This is highly experimental and initial data. Ther...\n", " attributions: This data is collected by the ARM Climate Research...\n", " process_version: CMAC 2.0\n", " ... ...\n", " datastream: nsaxsaprcmacppiC1.c1\n", " location_description: North Slope of Alaska (NSA), Barrow, Alaska\n", " doi: 10.5439/1781398\n", " command_line: cmac_sail.py 202203\n", " field_names: DBZ, VEL, WIDTH, ZDR, PHIDP, RHOHV, NCP, DBZhv, cb...\n", " history: created by rjackson on cirrus127.ccs.ornl.gov at 2...