{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "15778aeb", "metadata": {}, "outputs": [], "source": [ "import xradar as xd\n", "from open_radar_data import DATASETS" ] }, { "cell_type": "code", "execution_count": 3, "id": "29976fc6", "metadata": {}, "outputs": [], "source": [ "f = DATASETS.fetch(\"cfrad.20080604_002217_000_SPOL_v36_SUR.nc\")" ] }, { "cell_type": "code", "execution_count": 4, "id": "c792d385", "metadata": {}, "outputs": [], "source": [ "dtree = xd.io.open_cfradial1_datatree(f)" ] }, { "cell_type": "code", "execution_count": 5, "id": "14c44cba", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
<xarray.DatasetView>\n",
       "Dimensions:              (sweep: 9)\n",
       "Dimensions without coordinates: sweep\n",
       "Data variables:\n",
       "    volume_number        int32 ...\n",
       "    platform_type        |S32 ...\n",
       "    primary_axis         |S32 ...\n",
       "    status_str           |S1 ...\n",
       "    instrument_type      |S32 ...\n",
       "    time_coverage_start  |S32 ...\n",
       "    time_coverage_end    |S32 ...\n",
       "    latitude             float64 ...\n",
       "    longitude            float64 ...\n",
       "    altitude             float64 ...\n",
       "    sweep_group_name     (sweep) <U7 'sweep_0' 'sweep_1' ... 'sweep_7' 'sweep_8'\n",
       "    sweep_fixed_angle    (sweep) float32 ...\n",
       "Attributes: (12/13)\n",
       "    Conventions:         CF/Radial instrument_parameters radar_parameters rad...\n",
       "    version:             1.2\n",
       "    title:               TIMREX\n",
       "    institution:         \n",
       "    references:          \n",
       "    source:              \n",
       "    ...                  ...\n",
       "    comment:             \n",
       "    instrument_name:     SPOLRVP8\n",
       "    site_name:           \n",
       "    scan_name:           \n",
       "    scan_id:             0\n",
       "    platform_is_mobile:  false
" ], "text/plain": [ "DataTree('root', parent=None)\n", "│ Dimensions: (sweep: 9)\n", "│ Dimensions without coordinates: sweep\n", "│ Data variables:\n", "│ volume_number int32 ...\n", "│ platform_type |S32 ...\n", "│ primary_axis |S32 ...\n", "│ status_str |S1 ...\n", "│ instrument_type |S32 ...\n", "│ time_coverage_start |S32 ...\n", "│ time_coverage_end |S32 ...\n", "│ latitude float64 ...\n", "│ longitude float64 ...\n", "│ altitude float64 ...\n", "│ sweep_group_name (sweep) \n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
<xarray.Cfradial1>\n",
       "Dimensions:                            (time: 4343, range: 996, sweep: 9,\n",
       "                                        r_calib: 1)\n",
       "Coordinates:\n",
       "  * time                               (time) datetime64[ns] 2008-06-04T00:15...\n",
       "  * range                              (range) float32 150.0 300.0 ... 1.494e+05\n",
       "Dimensions without coordinates: sweep, r_calib\n",
       "Data variables: (12/99)\n",
       "    azimuth                            (time) float32 121.5 122.2 ... 213.0\n",
       "    elevation                          (time) float32 0.379 0.2362 ... 12.81\n",
       "    pulse_width                        (time) timedelta64[ns] 00:00:00 ... 00...\n",
       "    prt                                (time) timedelta64[ns] -1 days +21:13:...\n",
       "    prt_ratio                          (time) timedelta64[ns] -1 days +21:13:...\n",
       "    nyquist_velocity                   (time) float32 26.92 26.92 ... 26.92\n",
       "    ...                                 ...\n",
       "    roll_correction                    float32 ...\n",
       "    northward_ground_speed_correction  float32 ...\n",
       "    pitch_correction                   float32 ...\n",
       "    longitude_correction               float32 ...\n",
       "    radar_altitude_correction          float32 ...\n",
       "    drift_correction                   float32 ...
" ], "text/plain": [ "\n", "Dimensions: (time: 4343, range: 996, sweep: 9,\n", " r_calib: 1)\n", "Coordinates:\n", " * time (time) datetime64[ns] 2008-06-04T00:15...\n", " * range (range) float32 150.0 300.0 ... 1.494e+05\n", "Dimensions without coordinates: sweep, r_calib\n", "Data variables: (12/99)\n", " azimuth (time) float32 121.5 122.2 ... 213.0\n", " elevation (time) float32 0.379 0.2362 ... 12.81\n", " pulse_width (time) timedelta64[ns] 00:00:00 ... 00...\n", " prt (time) timedelta64[ns] -1 days +21:13:...\n", " prt_ratio (time) timedelta64[ns] -1 days +21:13:...\n", " nyquist_velocity (time) float32 26.92 26.92 ... 26.92\n", " ... ...\n", " roll_correction float32 ...\n", " northward_ground_speed_correction float32 ...\n", " pitch_correction float32 ...\n", " longitude_correction float32 ...\n", " radar_altitude_correction float32 ...\n", " drift_correction float32 ..." ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ds" ] }, { "cell_type": "code", "execution_count": 8, "id": "5e67a8f3", "metadata": {}, "outputs": [], "source": [ "dtreenew = ds.to_cfradial2_datatree()" ] }, { "cell_type": "code", "execution_count": 9, "id": "2c35c1d7", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
<xarray.DatasetView>\n",
       "Dimensions:              (sweep: 9)\n",
       "Dimensions without coordinates: sweep\n",
       "Data variables:\n",
       "    sweep_group_name     (sweep) <U7 'sweep_0' 'sweep_1' ... 'sweep_7' 'sweep_8'\n",
       "    sweep_fixed_angle    (sweep) float32 0.4999 1.099 1.802 ... 6.498 9.102 12.8\n",
       "    volume_number        int32 ...\n",
       "    platform_type        |S32 ...\n",
       "    primary_axis         |S32 ...\n",
       "    status_str           |S1 ...\n",
       "    instrument_type      |S32 ...\n",
       "    time_coverage_start  |S32 ...\n",
       "    time_coverage_end    |S32 ...\n",
       "    latitude             float64 ...\n",
       "    longitude            float64 ...\n",
       "    altitude             float64 ...
" ], "text/plain": [ "DataTree('root', parent=None)\n", "│ Dimensions: (sweep: 9)\n", "│ Dimensions without coordinates: sweep\n", "│ Data variables:\n", "│ sweep_group_name (sweep)