{ "cells": [ { "cell_type": "markdown", "id": "bb773305-349b-487b-b3d8-2bd8765d5eff", "metadata": {}, "source": [ "# Short DBS Scans" ] }, { "cell_type": "markdown", "id": "7d440d25-bed7-4cac-a1a0-893aedcc632c", "metadata": {}, "source": [ "### Introduction:\n", "\n", "One possible way to retrieve winds using wind lidar is using the Doppler beam swing (DBS) scanning strategy. The DBS consists of four slanted observations of the wind. Each one of the observations is from a different azimuth, equally separated by 90 degrees (0, 90, 180, 270). While executing the DBS, the lidar first observes the wind at azimuths of 0 and 180 degrees and then at 90 and 270 degrees. From those observations, the north-south and east-west wind components can be calculated directly.\n", "\n", "This example focuses on using lidarwind to retrieve wind speed and direction profiles from the observations collected by the WindCube using the DBS scan strategy. " ] }, { "cell_type": "markdown", "id": "3c0f5804-734f-4ce4-937a-2ca2730483d7", "metadata": {}, "source": [ "### Steps:\n", "\n", "1) Downloading sample data from zenodo\n", "1) Reading the DBS files\n", "2) Merging the DBS files\n", "3) Retrieving the wind profiles \n", "4) Visualising the profiles" ] }, { "cell_type": "code", "execution_count": 1, "id": "d48102e0-d462-491d-9f93-5a5c9b2b2f09", "metadata": {}, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "import lidarwind\n", "from lidarwind.utilities import sample_data" ] }, { "cell_type": "markdown", "id": "af18abd4-3ac4-41ee-8247-15cd2ab779fd", "metadata": {}, "source": [ "### Step 0: Downloading the sample data" ] }, { "cell_type": "markdown", "id": "766aa9b4-f1cc-4705-b32d-8d398d4907c3", "metadata": {}, "source": [ "Caching the short DBS sample data" ] }, { "cell_type": "code", "execution_count": null, "id": "386b50e5-c32a-48ac-a65f-88675e43174f", "metadata": {}, "outputs": [], "source": [ "# 6-beam sample data\n", "\n", "file_list = sample_data(\"wc_short_dbs\")" ] }, { "cell_type": "markdown", "id": "df122154-b517-4d1c-9cc9-69f060ebfd22", "metadata": {}, "source": [ "### Step 1 and 2: Reading and merging the DBS " ] }, { "cell_type": "markdown", "id": "52c53bc8-07d2-4cb0-8f7d-8505807f13fd", "metadata": {}, "source": [ "Here we are going to read all the DBS files. Be careful to provide a list of files that are compatible with each other. Here we also indicate the variables required for processing the DBS files. Finally, the merged dataset is created. " ] }, { "cell_type": "code", "execution_count": 3, "id": "3839b2d4-34d4-42cb-b63a-bc2fdf8fc62c", "metadata": {}, "outputs": [], "source": [ "var_list = ['azimuth', 'elevation', 'radial_wind_speed', \n", " 'radial_wind_speed_status', 'measurement_height', 'cnr']\n", "\n", "merged_ds = lidarwind.DbsOperations(file_list, var_list).merged_ds" ] }, { "cell_type": "markdown", "id": "066d4646-1fc7-481e-bef4-464175612124", "metadata": {}, "source": [ "Below, you can see the merged dataset and the variables used during the wind retrieval. You can also see one additional variable, the scan_mean_time. This variable is used to identify observations belonging to the same DBS sequence and is used if the parameter method from GetWindProperties5Beam is set to single_dbs. " ] }, { "cell_type": "code", "execution_count": 4, "id": "3493e1ed-dbb4-47be-a67f-053f361286a1", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
<xarray.Dataset>\n",
"Dimensions: (time: 349, gate_index: 159)\n",
"Coordinates:\n",
" * time (time) datetime64[ns] 2021-07-01T13:03:28.08800...\n",
" * gate_index (gate_index) int32 0 1 2 3 4 ... 155 156 157 158\n",
"Data variables:\n",
" azimuth (time) float64 0.0 0.0 180.0 ... 180.0 180.0 270.0\n",
" elevation (time) float64 75.0 90.0 75.0 ... 90.0 75.0 75.0\n",
" radial_wind_speed (time, gate_index) float64 0.2 -0.07 ... -19.05\n",
" radial_wind_speed_status (time, gate_index) float32 1.0 1.0 1.0 ... 0.0 0.0\n",
" measurement_height (time, gate_index) float64 200.0 250.0 ... 8.1e+03\n",
" cnr (time, gate_index) float64 -10.05 -9.8 ... -34.31\n",
" scan_mean_time (time) datetime64[ns] 2021-07-01T13:03:35.09280...