{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Halo Photonics Doppler Lidar" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "from open_radar_data import DATASETS\n", "\n", "import xradar as xd" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Opening a Halo Photonics Doppler lidar .hpl file.\n", "\n", "We use the `xd.io.open_hpl_datatree` in order to load the Halo Photonics Doppler lidar data. After that we will need to enter in the latitude and longitude in order to properly georeference the data. The .hpl file does not contain the latitude, longitude, or altitude of the lidar, so these need to be entered in as keywords as a part of the `backend_kwargs` argument to `xd.io.open_hpl_datatree`.\n", "\n", "In this example, we are using the coordinates of the Doppler lidar at the Nantucket Wastewater Management Facility, deployed as as part of the DOE Energy Effciency and Renewable Energy Office's [3rd Wind Forecast Improvement Project](https://www2.whoi.edu/site/wfip3/)." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ds = xd.io.open_hpl_datatree(\n", " DATASETS.fetch(\"User1_184_20240601_013257.hpl\"),\n", " sweep=[0, 1, 2, 3, 4, 5, 6, 7, 8],\n", " backend_kwargs=dict(latitude=41.24276244459537, longitude=-70.1070364814594),\n", ")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "ds[\"sweep_2\"][\"mean_doppler_velocity\"].plot(vmin=-20, vmax=0, cmap=\"Spectral\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In order to plot each sweep, we need to georeference the underlying sweeps." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "fig, ax = plt.subplots(3, 3, figsize=(12, 10))\n", "for sweep in range(9):\n", " sweep_ds = xd.georeference.get_x_y_z(ds[f\"sweep_{sweep}\"].ds)\n", " sweep_ds = sweep_ds.set_coords([\"x\", \"y\", \"z\", \"time\", \"range\"])\n", " sweep_ds[\"mean_doppler_velocity\"].plot(\n", " x=\"x\", y=\"y\", ax=ax[int(sweep / 3), sweep % 3]\n", " )\n", " ax[int(sweep / 3), sweep % 3].set_title(\n", " \"{angle:2.1f} degree scan\".format(angle=sweep_ds[\"sweep_fixed_angle\"].values)\n", " )\n", " ax[int(sweep / 3), sweep % 3].set_ylim([-4000, 0])\n", " ax[int(sweep / 3), sweep % 3].set_xlim([-4000, 1000])\n", "fig.tight_layout()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [] } ], "metadata": { "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.12.7" } }, "nbformat": 4, "nbformat_minor": 4 }