{ "cells": [ { "cell_type": "markdown", "id": "7dcd8659", "metadata": {}, "source": [ "## Analyzing Wave Statistics from ADCP Altimeter Data\n", "\n", "The following notebook illustrates how to process and compute wave statistics from acoustic Doppler current profilers (ADCPs) with the ability to measure waves (Nortek AWAC, Signature and RDI SentinelV). This example assumes the user is familiar with the basic workflow for processing ADCP data.\n", "\n", "Firstly, the ADCP must have been configured in wave measurement mode for deployment. This mode is only available for ADCPs with a vertically-oriented center transducer, which is used to located the water surface. The other four beams are utilized to measure water velocity at and around the water surface in order to track wave orbitals. The following basic workflow runs through the following:\n", "\n", "1. Import Data\n", "2. Review and QC altimeter measurements\n", "3. Create energy spectra from surface height\n", "4. Compute wave height and period\n", "5. Review and QC surface velocity measurements\n", "6. Use \"SUV\" method to compute wave direction and spread\n", "\n", "We'll begin analysis by importing the DOLfYN and wave modules from MHKiT. " ] }, { "cell_type": "code", "execution_count": 1, "id": "cfc84a0d", "metadata": {}, "outputs": [], "source": [ "from mhkit import dolfyn\n", "from mhkit import wave" ] }, { "cell_type": "markdown", "id": "49d7332e", "metadata": {}, "source": [ "### 1. Import Raw Datafile\n", "\n", "We'll start by using DOLfYN to read the binary file into python. This particular file is a clip from a Nortek Signature250 deployed at PacWave South, Oregon. In this case, the instrument was configured on a duty cycle to measure both waves and water velocity. Because two different profiling methods were used, DOLfYN will output two individual datasets.\n", "\n", "In this notebook, we'll focus on the waves dataset. A workflow for the water velocity dataset, which is the traditional ADCP measurement scheme, can be found in the ADCP example notebook." ] }, { "cell_type": "code", "execution_count": 2, "id": "3667665a", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "C:\\Users\\mcve343\\MHKiT-Python\\mhkit\\dolfyn\\io\\nortek2_lib.py:304: UserWarning: Dual Profile detected... Two datasets will be returned.\n", " warnings.warn(msg)\n", "Dual Profile detected... Two datasets will be returned.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Reading file data/dolfyn/Sig250_PacWave.ad2cp ...\n" ] } ], "source": [ "ds_waves, ds_avg = dolfyn.read(\"data/dolfyn/Sig250_PacWave.ad2cp\")" ] }, { "cell_type": "markdown", "id": "6a9ce962", "metadata": {}, "source": [ "If we print the dataset, we can see all of the data variables that the ADCP collects for wave measurements. ADCPs measure basic wave information by using an altimeter pulse to detect where the surface is. \n", "\n", "The ADCP first (and periodically thereafter) sends out a series of sample pulses to calibrate the altimeter. These are saved in the dataset with the tag \"_altraw\". The ADCP then sends out altimeter pings at the user-defined sampling rate, which are saved in the dataset with the \"_alt\" tag.\n", "\n", "The altimeter pings are interpreted by the instrument using two different algorithms, called \"acoustic surface tracking\" (AST) and the \"leading edge\" (LE) method. These variables have either an \"ast_\" or \"le_\" prefix to their names. AST is typically used for measuring the air-water interface, while LE is better for detecting boundaries between water and other dense mediums, such as sea ice or seafloor." ] }, { "cell_type": "code", "execution_count": 3, "id": "84dd5f7a", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
<xarray.Dataset> Size: 11MB\n",
"Dimensions: (time: 18073, time_altraw: 35, range: 13, beam: 4,\n",
" dir: 4, dirIMU: 3, n_altraw: 2583, x1: 4, x2: 4,\n",
" earth: 3, inst: 3)\n",
"Coordinates:\n",
" * time (time) datetime64[ns] 145kB 2024-10-22T19:29:36.3...\n",
" * time_altraw (time_altraw) datetime64[ns] 280B 2024-10-22T19:2...\n",
" * range (range) float64 104B 38.7 42.2 45.7 ... 77.2 80.7\n",
" * beam (beam) int32 16B 1 2 3 4\n",
" * dir (dir) int32 16B 1 2 3 4\n",
" * dirIMU (dirIMU) <U1 12B 'X' 'Y' 'Z'\n",
" * x1 (x1) int32 16B 1 2 3 4\n",
" * x2 (x2) int32 16B 1 2 3 4\n",
" * earth (earth) <U1 12B 'E' 'N' 'U'\n",
" * inst (inst) <U1 12B 'X' 'Y' 'Z'\n",
"Dimensions without coordinates: n_altraw\n",
"Data variables: (12/39)\n",
" c_sound (time) float32 72kB 1.503e+03 ... 1.485e+03\n",
" temp (time) float32 72kB 13.93 13.92 13.92 ... 8.23 8.23\n",
" pressure (time) float32 72kB 0.768 0.765 ... 74.71 74.71\n",
" heading (time) float32 72kB 216.1 215.8 ... 212.7 212.9\n",
" pitch (time) float32 72kB -27.59 -28.03 ... 2.21 2.22\n",
" roll (time) float32 72kB 73.04 71.68 67.74 ... -0.36 -0.4\n",
" ... ...\n",
" low_volt_skip (time) uint8 18kB 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0\n",
" active_config (time) uint8 18kB 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0\n",
" telemetry_data (time) uint8 18kB 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0\n",
" boost_running (time) uint8 18kB 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0\n",
" beam2inst_orientmat (x1, x2) float32 64B 1.462 0.0 -1.462 ... 0.0 0.532\n",
" orientmat (earth, inst, time) float32 651kB -0.5221 ... 0.9992\n",
"Attributes: (12/39)\n",
" filehead_config: {"CLOCKSTR": {"TIME": "\\"2024-10-22 19:29:32\\""}, ...\n",
" inst_model: Signature250\n",
" inst_make: Nortek\n",
" inst_type: ADCP\n",
" burst_config: {"press_valid": true, "temp_valid": true, "compass...\n",
" n_cells: 13\n",
" ... ...\n",
" rotate_vars: ['vel', 'accel', 'mag']\n",
" coord_sys: beam\n",
" fs: 1\n",
" bandwidth: "BROAD"\n",
" has_imu: 0\n",
" beam_angle: 20