Long DBS scans

Introduction:

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.

This example focuses on using lidarSuit to retrieve wind speed and direction profiles from the observations collected by the WindCube using the DBS scan strategy. This example is structurally similar to dbs_scans. The only difference is the input data. Instead of individual files for each complete DBS scan, each file contains several complete DBS scans.

Steps:

  1. Downloading sample data from zenodo

  2. Reading the DBS files

  3. Merging the DBS files

  4. Retrieving the wind profiles

  5. Visualising the profiles

[1]:
import pooch
import matplotlib.pyplot as plt
import lidarSuit as lst

Step 0: Downloading the sample data

[2]:
file_list = pooch.retrieve(
    url="doi:10.5281/zenodo.7312960/wc_long_dbs.zip",
    known_hash="md5:53b4eb6e5dad6dfdaddfbb718dcf8910",
    processor=pooch.Unzip())

file_list = sorted(file_list)

Step 1 and 2: Reading and merging the long DBS files

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 fils. Finally, the merged dataset is created.

[3]:
var_list = ['azimuth', 'elevation', 'radial_wind_speed',
            'radial_wind_speed_status', 'measurement_height', 'cnr']

merged_ds = lst.DbsOperations(file_list, var_list).merged_ds

Step 3: Wind profile retrievals

Once the merged dataset is created, you can use the dedicated class to retrieve the wind profiles.

[4]:
wind_obj = lst.GetWindProperties5Beam(merged_ds)

As indicated below, you can read the wind profiles directly from the wind_obj (wind object). Since they have different timestamps, it is helpful to resample the data into a regular time grid.

[5]:
hor_wind_speed = lst.GetResampledData(wind_obj.hor_wind_speed, time_freq='20s', tolerance=10)
ver_wind_speed = lst.GetResampledData(wind_obj.ver_wind_speed, time_freq='20s', tolerance=10)
hor_wind_dir = lst.GetResampledData(wind_obj.hor_wind_dir, time_freq='20s', tolerance=10)

Step 4: Visualising the profiles

After resampling, you can use the xarray methods to plot the data.

[6]:
t1 = merged_ds.time.values[0]
t2 = merged_ds.time.values[-1]

hor_wind_speed.resampled.sel(time_ref=slice(t1,t2)).plot(y='range', cmap='turbo')
plt.show()

ver_wind_speed.resampled.sel(time_ref=slice(t1,t2)).plot(y='range', cmap='turbo')
plt.show()

hor_wind_dir.resampled.sel(time_ref=slice(t1,t2)).plot(y='range', cmap='hsv')
plt.show()
../_images/examples_reading_long_dbs_rendered_15_0.png
../_images/examples_reading_long_dbs_rendered_15_1.png
../_images/examples_reading_long_dbs_rendered_15_2.png