{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Loading Metek MRR2 data" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "import gzip\n", "\n", "import cmweather # noqa\n", "import matplotlib.pyplot as plt\n", "from open_radar_data import DATASETS\n", "\n", "import xradar as xd" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "`xd.io.open_metek_datatree` supports the Metek MRR2 processed (.pro, .ave) and raw (.raw) files. The initalized datatree will contain all of the vertically pointing radar data in one sweep. \n", "\n", "In this example, we are loading the 60 s average files from the MRR2 sampling a rain event over the Argonne Testbed for Multiscale Observational Science at Argonne National Laboratory in the Chicago suburbs." ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "mrr_test_file = DATASETS.fetch(\"0308.pro.gz\")\n", "with gzip.open(mrr_test_file, \"rt\") as test_file:\n", " ds = xd.io.open_metek_datatree(test_file)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "View the structure of the loaded datatree. " ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
<xarray.DatasetView> Size: 18MB\n",
"Dimensions: (sample: 64, time: 362, range: 31,\n",
" index: 11222)\n",
"Coordinates:\n",
" velocity_bins (sample) float64 512B ...\n",
" * range (range) float64 248B 150.0 300.0 ... 4.65e+03\n",
" * time (time) datetime64[ns] 3kB 2024-03-08T23:00:...\n",
"Dimensions without coordinates: sample, index\n",
"Data variables: (12/17)\n",
" transfer_function (time, range) float64 90kB ...\n",
" spectral_reflectivity (index, sample) float64 6MB ...\n",
" drop_size (index, sample) float64 6MB ...\n",
" drop_number_density (index, sample) float64 6MB ...\n",
" percentage_valid_spectra (time) float64 3kB ...\n",
" path_integrated_attenuation (time, range) float64 90kB ...\n",
" ... ...\n",
" altitude float64 8B ...\n",
" longitude float64 8B ...\n",
" latitude float64 8B ...\n",
" spectrum_index (time, range) float64 90kB ...\n",
" azimuth (time) float64 3kB ...\n",
" elevation (time) float64 3kB ...